Skip to contentSkip to conversation

Please pull 'upstream' branch of rt2x00

PATCH New Ivo van Doorn 1 participant 20 messages Feb 3, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

Hi John,

Here is the 2.1.0 release of rt2x00.
The most important changes in this release:
- Queue handling overhaul
- Multiple virtual AP interfaces support for rt61 and rt73
- LED class support
- Adhoc & master mode enabled

Note that this patch series is _not_ intended for 2.6.25, a lot might still be broken because the code has changed so much. Adhoc and master mode is only enabled for testing purposes, in no way it means that it is working for all drivers...

With these changes adding support for rt2800pci and rt2800usb will be easier as well. Hopefully I can soon provide an initial version for those 2 drivers as well.

All indivual patches can also be found here:
http://kernel.org//pub/linux/kernel/people/ivd/rt2x00-2.1.0/

Ivo

---

The following changes since commit e0e6138382c56aa99a1aabe5dddddbb332b5a4f8:
Stefano Brivio (1):
rc80211-pid: fix rate adjustment

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git/ upstream

Adam Baker (1):
rt2x00: don't write past the end when writing short descriptors on rt61

Ivo van Doorn (18):
rt2x00: Update copyright notice
rt2x00: Queue handling overhaul
rt2x00: Add new USB ID to rt2500usb
rt2x00: Fix tx parameter initialization
rt2x00: Enable master and adhoc mode again
rt2x00: Driver requiring firmware should select crc algo
rt2x00: Add per-interface structure
rt2x00: Rate structure overhaul
rt2x00: Remove HWMODE_{A,B,G}
rt2x00: Remove TX_MGMT queue usage
rt2x00: Initialize QID from queue->qid
rt2x00: Use ieee80211_channel_to_frequency()
rt2x00: Make use of MAC80211_LED_TRIGGERS
rt2x00: Enable LED class support for rt2500usb/rt73usb
rt2x00: Fix rate initialization
rt2x00: Move beacon and atim queue defines into rt2x00
rt2x00: Fix queue index handling
rt2x00: Release rt2x00 2.1.0

 drivers/net/wireless/rt2x00/Kconfig          |   43 ++
 drivers/net/wireless/rt2x00/Makefile         |    6 +-
 drivers/net/wireless/rt2x00/rt2400pci.c      |  431 +++++++++------
 drivers/net/wireless/rt2x00/rt2400pci.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2500pci.c      |  436 +++++++++------
 drivers/net/wireless/rt2x00/rt2500pci.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2500usb.c      |  497 ++++++++++--------
 drivers/net/wireless/rt2x00/rt2500usb.h      |    5 +-
 drivers/net/wireless/rt2x00/rt2x00.h         |  288 ++++++-----
 drivers/net/wireless/rt2x00/rt2x00config.c   |  140 +++---
 drivers/net/wireless/rt2x00/rt2x00debug.c    |   34 +-
 drivers/net/wireless/rt2x00/rt2x00debug.h    |    2 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c      |  756 +++++++++++---------------
 drivers/net/wireless/rt2x00/rt2x00dump.h     |    8 +-
 drivers/net/wireless/rt2x00/rt2x00firmware.c |   43 ++-
 drivers/net/wireless/rt2x00/rt2x00leds.c     |  217 ++++++++
 drivers/net/wireless/rt2x00/rt2x00leds.h     |   63 +++
 drivers/net/wireless/rt2x00/rt2x00lib.h      |  100 ++++-
 drivers/net/wireless/rt2x00/rt2x00mac.c      |  221 +++++---
 drivers/net/wireless/rt2x00/rt2x00pci.c      |  238 ++++-----
 drivers/net/wireless/rt2x00/rt2x00pci.h      |   57 ++-
 drivers/net/wireless/rt2x00/rt2x00queue.c    |  295 ++++++++++
 drivers/net/wireless/rt2x00/rt2x00queue.h    |  447 +++++++++++++++
 drivers/net/wireless/rt2x00/rt2x00reg.h      |   75 +---
 drivers/net/wireless/rt2x00/rt2x00rfkill.c   |    2 +-
 drivers/net/wireless/rt2x00/rt2x00ring.h     |  290 ----------
 drivers/net/wireless/rt2x00/rt2x00usb.c      |  345 ++++++++-----
 drivers/net/wireless/rt2x00/rt2x00usb.h      |  179 +++++--
 drivers/net/wireless/rt2x00/rt61pci.c        |  601 +++++++++++----------
 drivers/net/wireless/rt2x00/rt61pci.h        |   21 +-
 drivers/net/wireless/rt2x00/rt73usb.c        |  468 +++++++++-------
 drivers/net/wireless/rt2x00/rt73usb.h        |   20 +-
 32 files changed, 3831 insertions(+), 2501 deletions(-)
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00leds.c
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00leds.h
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00queue.c
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00queue.h
 delete mode 100644 drivers/net/wireless/rt2x00/rt2x00ring.h
#1 lore raw

PATCH 1/19 rt2x00: Update copyright notice

---
 drivers/net/wireless/rt2x00/rt2400pci.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2400pci.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2500pci.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2500pci.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2500usb.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2500usb.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00.h         |    2 +-
 drivers/net/wireless/rt2x00/rt2x00config.c   |    2 +-
 drivers/net/wireless/rt2x00/rt2x00debug.c    |    2 +-
 drivers/net/wireless/rt2x00/rt2x00debug.h    |    2 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00dump.h     |    2 +-
 drivers/net/wireless/rt2x00/rt2x00firmware.c |    2 +-
 drivers/net/wireless/rt2x00/rt2x00lib.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00mac.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00pci.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00pci.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00reg.h      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00rfkill.c   |    2 +-
 drivers/net/wireless/rt2x00/rt2x00ring.h     |    2 +-
 drivers/net/wireless/rt2x00/rt2x00usb.c      |    2 +-
 drivers/net/wireless/rt2x00/rt2x00usb.h      |    2 +-
 drivers/net/wireless/rt2x00/rt61pci.c        |    2 +-
 drivers/net/wireless/rt2x00/rt61pci.h        |    2 +-
 drivers/net/wireless/rt2x00/rt73usb.c        |    2 +-
 drivers/net/wireless/rt2x00/rt73usb.h        |    2 +-
 26 files changed, 26 insertions(+), 26 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +1 -1
index d6cba13..406f589 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2400pci.h +1 -1
index 369aac6..3d59d66 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2500pci.c +1 -1
index e874fdc..0436e4a 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2500pci.h +1 -1
index 92ba090..0af130c 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2500usb.c +1 -1
index 86ded40..4753424 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2500usb.h +1 -1
index 9e04337..e9f2cd9 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00.h +1 -1
index 6847585..dc4ae56 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00config.c +1 -1
index 9e5bfce..0ebdf81 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00debug.c +1 -1
index b44a9f4..d70ce6e 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00debug.h +1 -1
index d37efbd..c4ce895 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -1
index d5e4512..628cfb9 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00dump.h +1 -1
index 99f3f36..93f8967 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00firmware.c +1 -1
index 0a475e4..442ff80 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00lib.h +1 -1
index 1adbd28..7540d29 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00mac.c +1 -1
index e3f15e5..e638c65 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00pci.c +1 -1
index b76c130..6df4a3e 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00pci.h +1 -1
index 2d1eb81..9ac560b 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00reg.h +1 -1
index 8384212..04e4799 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00rfkill.c +1 -1
index 34a96d4..6712142 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00ring.h +1 -1
index 1caa6d6..764c255 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00usb.c +1 -1
index dc7695c..e566acc 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt2x00usb.h +1 -1
index e40df40..b5c1d17 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt61pci.c +1 -1
index 5f97217..b3044cf 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt61pci.h +1 -1
index 4c6524e..e4578fb 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt73usb.c +1 -1
index e2d9dcc..2f0d7e2 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
drivers/net/wireless/rt2x00/rt73usb.h +1 -1
index d49dcaa..bc63590 100644
@@ -1,5 +1,5 @@
 /*
-	Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+	Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
 	<http://rt2x00.serialmonkey.com>
 
 	This program is free software; you can redistribute it and/or modify
Signature · 1 line
1.5.3.8
#2 lore raw

PATCH 2/19 rt2x00: Queue handling overhaul

In reply to Ivo van Doorn

This introduces a big queue handling overhaul, this also renames "ring" to "queues".

Move queue handling into rt2x00queue.c and the matching header, use Kerneldoc to improve rt2x00 library documentation.

Access to the queues is now protected under a spinlock, this to prevent race conditions which could corrupt the indexing system of the queue.

Each queue entry allocates x bytes for driver/device specific data, this cleans up the queue structure significantly and improves code readability.

rt2500usb no longer needs 2 entries in the beacon queue to correctly send out the guardian byte. This is now handled in the entry specific structure.

rt61 and rt73 now use the correct descriptor size for beacon frames, since this data is written into the registers not the entire TXD descriptor was used but instead of a subset of it named TXINFO.

Finally this also fixes numerous other bugs related to incorrect beacon handling or beacon related code.

---

patch size 164k, located on server:
http://kernel.org//pub/linux/kernel/people/ivd/rt2x00-2.1.0/0002-rt2x00-Queue-handling-overhaul.patch

 drivers/net/wireless/rt2x00/Makefile      |    2 +-
 drivers/net/wireless/rt2x00/rt2400pci.c   |  204 ++++++++------
 drivers/net/wireless/rt2x00/rt2500pci.c   |  199 ++++++++------
 drivers/net/wireless/rt2x00/rt2500usb.c   |  201 ++++++++------
 drivers/net/wireless/rt2x00/rt2x00.h      |  133 ++++------
 drivers/net/wireless/rt2x00/rt2x00debug.c |   32 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c   |  403 +++++++--------------------
 drivers/net/wireless/rt2x00/rt2x00dump.h  |    6 +-
 drivers/net/wireless/rt2x00/rt2x00lib.h   |   10 +
 drivers/net/wireless/rt2x00/rt2x00mac.c   |   55 ++--
 drivers/net/wireless/rt2x00/rt2x00pci.c   |  223 ++++++++-------
 drivers/net/wireless/rt2x00/rt2x00pci.h   |   49 +++-
 drivers/net/wireless/rt2x00/rt2x00queue.c |  291 +++++++++++++++++++
 drivers/net/wireless/rt2x00/rt2x00queue.h |  435 +++++++++++++++++++++++++++++
 drivers/net/wireless/rt2x00/rt2x00reg.h   |    2 +-
 drivers/net/wireless/rt2x00/rt2x00ring.h  |  290 -------------------
 drivers/net/wireless/rt2x00/rt2x00usb.c   |  291 +++++++++++---------
 drivers/net/wireless/rt2x00/rt2x00usb.h   |   48 +++-
 drivers/net/wireless/rt2x00/rt61pci.c     |  256 +++++++++--------
 drivers/net/wireless/rt2x00/rt61pci.h     |    1 +
 drivers/net/wireless/rt2x00/rt73usb.c     |  134 ++++++---
 drivers/net/wireless/rt2x00/rt73usb.h     |    1 +
 22 files changed, 1881 insertions(+), 1385 deletions(-)
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00queue.c
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00queue.h
 delete mode 100644 drivers/net/wireless/rt2x00/rt2x00ring.h
#3 lore raw

PATCH 3/19 rt2x00: don't write past the end when writing short descriptors on rt61

In reply to Ivo van Doorn

From: Adam Baker <[email protected]>

The space allocated in the skb for a descriptor is only 24 bytes when setting up beacons in rt61 so make sure we don't write to the descriptor words beyond that and corrupt the beacon packet.

---
 drivers/net/wireless/rt2x00/rt61pci.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt61pci.c +5 -3
index b543801..fc5acdf 100644
@@ -1528,9 +1528,11 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 	rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
 	rt2x00_desc_write(txd, 5, word);
 
-	rt2x00_desc_read(txd, 11, &word);
-	rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len);
-	rt2x00_desc_write(txd, 11, word);
+	if (skbdesc->desc_len > TXINFO_SIZE) {
+		rt2x00_desc_read(txd, 11, &word);
+		rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0, skbdesc->data_len);
+		rt2x00_desc_write(txd, 11, word);
+	}
 
 	rt2x00_desc_read(txd, 0, &word);
 	rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1);
Signature · 1 line
1.5.3.8
#4 lore raw

PATCH 4/19 rt2x00: Add new USB ID to rt2500usb

In reply to Ivo van Doorn
---
 drivers/net/wireless/rt2x00/rt2500usb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2500usb.c +1 -1
index 764a920..4a7c665 100644
@@ -1876,11 +1876,11 @@ static struct usb_device_id rt2500usb_device_table[] = {
 	/* Hercules */
 	{ USB_DEVICE(0x06f8, 0xe000), USB_DEVICE_DATA(&rt2500usb_ops) },
 	/* Melco */
+	{ USB_DEVICE(0x0411, 0x005e), USB_DEVICE_DATA(&rt2500usb_ops) },
 	{ USB_DEVICE(0x0411, 0x0066), USB_DEVICE_DATA(&rt2500usb_ops) },
 	{ USB_DEVICE(0x0411, 0x0067), USB_DEVICE_DATA(&rt2500usb_ops) },
 	{ USB_DEVICE(0x0411, 0x008b), USB_DEVICE_DATA(&rt2500usb_ops) },
 	{ USB_DEVICE(0x0411, 0x0097), USB_DEVICE_DATA(&rt2500usb_ops) },
-
 	/* MSI */
 	{ USB_DEVICE(0x0db0, 0x6861), USB_DEVICE_DATA(&rt2500usb_ops) },
 	{ USB_DEVICE(0x0db0, 0x6865), USB_DEVICE_DATA(&rt2500usb_ops) },
Signature · 1 line
1.5.3.8
#5 lore raw

PATCH 5/19 rt2x00: Fix tx parameter initialization

In reply to Ivo van Doorn

Check if the aifs, cw_min and cw_max are above 0 when determining if the default should be used. Tor aifs a negative number is used to determine if the default should be used or not.

---
 drivers/net/wireless/rt2x00/rt2x00mac.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +3 -3
index 411ed5d..380cc5b 100644
@@ -396,17 +396,17 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue_idx,
 	 * The passed variables are stored as real value ((2^n)-1).
 	 * Ralink registers require to know the bit number 'n'.
 	 */
-	if (params->cw_min)
+	if (params->cw_min > 0)
 		queue->cw_min = fls(params->cw_min);
 	else
 		queue->cw_min = 5; /* cw_min: 2^5 = 32. */
 
-	if (params->cw_max)
+	if (params->cw_max > 0)
 		queue->cw_max = fls(params->cw_max);
 	else
 		queue->cw_max = 10; /* cw_min: 2^10 = 1024. */
 
-	if (params->aifs)
+	if (params->aifs >= 0)
 		queue->aifs = params->aifs;
 	else
 		queue->aifs = 2;
Signature · 1 line
1.5.3.8
#6 lore raw

PATCH 6/19 rt2x00: Enable master and adhoc mode again

In reply to Ivo van Doorn

This will enable the creation of master mode and adhoc interfaces again. This does not mean the issues surrounding beaconing have been resolved, but this will make testing easier and perhaps we can discover which cards are actually working and which ones not.

---
 drivers/net/wireless/rt2x00/rt2x00mac.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +0 -8
index 380cc5b..f08c151 100644
@@ -164,14 +164,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 	struct rt2x00_dev *rt2x00dev = hw->priv;
 	struct interface *intf = &rt2x00dev->interface;
 
-	/* FIXME: Beaconing is broken in rt2x00. */
-	if (conf->type == IEEE80211_IF_TYPE_IBSS ||
-	    conf->type == IEEE80211_IF_TYPE_AP) {
-		ERROR(rt2x00dev,
-		      "rt2x00 does not support Adhoc or Master mode");
-		return -EOPNOTSUPP;
-	}
-
 	/*
 	 * Don't allow interfaces to be added while
 	 * either the device has disappeared or when
Signature · 1 line
1.5.3.8
#7 lore raw

PATCH 7/19 rt2x00: Driver requiring firmware should select crc algo

In reply to Ivo van Doorn

The driver should select what CRC algorithm is required when performing a checksum on the firmware.

rt61pci & rt73usb require crc-itu-t
rt2800pci & rt2800usb require crc-ccitt

Legacy 2800pci/usb driver uses crc-itu-t + bit order reversion, but that is just inefficient especially since the end result is the same as a different algorithm which is also available as library. ;)

---
 drivers/net/wireless/rt2x00/Kconfig          |    1 +
 drivers/net/wireless/rt2x00/rt2x00.h         |    2 +
 drivers/net/wireless/rt2x00/rt2x00dev.c      |    8 ++---
 drivers/net/wireless/rt2x00/rt2x00firmware.c |   41 ++++++++++++++++++++------
 drivers/net/wireless/rt2x00/rt61pci.c        |    3 +-
 drivers/net/wireless/rt2x00/rt73usb.c        |    3 +-
 6 files changed, 42 insertions(+), 16 deletions(-)
drivers/net/wireless/rt2x00/Kconfig +1 -0
index da05b1f..28f3e5e 100644
@@ -28,6 +28,7 @@ config RT2X00_LIB_USB
 config RT2X00_LIB_FIRMWARE
 	boolean
 	depends on RT2X00_LIB
+	select CRC_CCITT
 	select CRC_ITU_T
 	select FW_LOADER
 
drivers/net/wireless/rt2x00/rt2x00.h +2 -0
index 14668f0..d5b9a3c 100644
@@ -555,6 +555,8 @@ enum rt2x00_flags {
 	 * Driver features
 	 */
 	DRIVER_REQUIRE_FIRMWARE,
+	DRIVER_REQUIRE_FIRMWARE_CRC_ITU_T,
+	DRIVER_REQUIRE_FIRMWARE_CCITT,
 	DRIVER_REQUIRE_BEACON_GUARD,
 	DRIVER_REQUIRE_ATIM_QUEUE,
 
drivers/net/wireless/rt2x00/rt2x00dev.c +3 -5
index 9c4ebb0..7089808 100644
@@ -983,11 +983,9 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)
 	 * If this is the first interface which is added,
 	 * we should load the firmware now.
 	 */
-	if (test_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags)) {
-		retval = rt2x00lib_load_firmware(rt2x00dev);
-		if (retval)
-			return retval;
-	}
+	retval = rt2x00lib_load_firmware(rt2x00dev);
+	if (retval)
+		return retval;
 
 	/*
 	 * Initialize the device.
drivers/net/wireless/rt2x00/rt2x00firmware.c +32 -9

68 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt61pci.c +2 -1
index fc5acdf..6c97361 100644
@@ -2255,9 +2255,10 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
 	rt61pci_probe_hw_mode(rt2x00dev);
 
 	/*
-	 * This device requires firmware
+	 * This device requires firmware.
 	 */
 	__set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
+	__set_bit(DRIVER_REQUIRE_FIRMWARE_CRC_ITU_T, &rt2x00dev->flags);
 
 	/*
 	 * Set the rssi offset.
drivers/net/wireless/rt2x00/rt73usb.c +2 -1
index 2231557..01c020b 100644
@@ -1846,9 +1846,10 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
 	rt73usb_probe_hw_mode(rt2x00dev);
 
 	/*
-	 * This device requires firmware
+	 * This device requires firmware.
 	 */
 	__set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
+	__set_bit(DRIVER_REQUIRE_FIRMWARE_CRC_ITU_T, &rt2x00dev->flags);
 
 	/*
 	 * Set the rssi offset.
Signature · 1 line
1.5.3.8
#8 lore raw

PATCH 8/19 rt2x00: Add per-interface structure

In reply to Ivo van Doorn

Rework the interface handling. Delete the interface structure and replace it with a per-interface structure. This changes the way rt2x00 handles the active interface drastically.

Copy ieee80211_bss_conf to the this rt2x00_intf structure during the bss_info_changed() callback function. This will allow us to reference it later, and removes the requirement for the device flag SHORT_PREAMBLE flag which is interface specific.

Drivers receive the option to give the maximum number of virtual interfaces the device can handle. Virtual interface support:
rt2400pci: 1 sta or 1 ap, * monitor interfaces
rt2500pci: 1 sta or 1 ap, * monitor interfaces
rt2500usb: 1 sta or 1 ap, * monitor interfaces
rt61pci: 1 sta or 4 ap, * monitor interfaces
rt73usb: 1 sta or 4 ap, * monitor interfaces

At the moment none of the drivers support AP and STA interfaces simultaneously, this is a hardware limitation so future support will be very unlikely.

Each interface structure receives its dedicated beacon entry, with this we can easily work with beaconing while multiple master mode interfaces are currently active.

The configuration handlers for the MAC, BSSID and type are often called together since they all belong to the interface configuration. Merge the 3 configuration calls and cleanup the API between rt2x00lib and the drivers. While we are cleaning up the interface configuration anyway, we might as well clean up the configuration handler as well.

---

Patch size 77k, located on server
http://kernel.org//pub/linux/kernel/people/ivd/rt2x00-2.1.0/0008-rt2x00-Add-per-interface-structure.patch

 drivers/net/wireless/rt2x00/rt2400pci.c    |   84 ++++++------
 drivers/net/wireless/rt2x00/rt2500pci.c    |   98 +++++++------
 drivers/net/wireless/rt2x00/rt2500usb.c    |  207 ++++++++++++++++------------
 drivers/net/wireless/rt2x00/rt2500usb.h    |    1 +
 drivers/net/wireless/rt2x00/rt2x00.h       |  113 +++++++++++----
 drivers/net/wireless/rt2x00/rt2x00config.c |  119 ++++++++++-------
 drivers/net/wireless/rt2x00/rt2x00dev.c    |  154 +++++++++++++++------
 drivers/net/wireless/rt2x00/rt2x00lib.h    |   10 +-
 drivers/net/wireless/rt2x00/rt2x00mac.c    |  152 ++++++++++++++-------
 drivers/net/wireless/rt2x00/rt2x00pci.c    |   32 +++--
 drivers/net/wireless/rt2x00/rt2x00queue.h  |    3 -
 drivers/net/wireless/rt2x00/rt61pci.c      |  169 +++++++++++++----------
 drivers/net/wireless/rt2x00/rt61pci.h      |   18 ++-
 drivers/net/wireless/rt2x00/rt73usb.c      |  179 +++++++++++++-----------
 drivers/net/wireless/rt2x00/rt73usb.h      |   17 ++-
 15 files changed, 826 insertions(+), 530 deletions(-)
#9 lore raw

PATCH 9/19 rt2x00: Rate structure overhaul

In reply to Ivo van Doorn

Recent changes to the rate structure registration broke rt2x00, the hw_value was reduced from 32bits to 16bits while rt2x00 used the full 32bits. However the way rt2x00 used the value was inflexible and needed to be changed anyway.

This patch creates a array containing information for each rate, the hw_value passed to mac80211 is the index value for that array including a field to indicate if short preamble should be enabled.

---
 drivers/net/wireless/rt2x00/rt2x00config.c |    4 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c    |  173 +++++++++++++++++-----------
 drivers/net/wireless/rt2x00/rt2x00lib.h    |   45 +++++++
 drivers/net/wireless/rt2x00/rt2x00reg.h    |   71 -----------
 4 files changed, 153 insertions(+), 140 deletions(-)
drivers/net/wireless/rt2x00/rt2x00config.c +1 -3
index bbbf356..b39d816 100644
@@ -242,9 +242,7 @@ config:
 
 		band = &rt2x00dev->bands[conf->channel->band];
 		rate = &band->bitrates[band->n_bitrates - 1];
-
-		libconf.basic_rates =
-		    DEVICE_GET_RATE_FIELD(rate->hw_value, RATEMASK) & DEV_BASIC_RATEMASK;
+		libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask;
 	}
 
 	if (flags & CONFIG_UPDATE_CHANNEL) {
drivers/net/wireless/rt2x00/rt2x00dev.c +107 -66

268 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00lib.h +45 -0

51 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00reg.h +0 -71

75 lines not on this page · raw message

Signature · 1 line
1.5.3.8
#10 lore raw

PATCH 10/19 rt2x00: Remove HWMODE_{A,B,G}

In reply to Ivo van Doorn

rt2500usb initialized the SIFS and EIFS without using the values coming from rt2x000lib. After this is fixed HWMODE_{A,B,G} is now unused and can be removed in favour of the ieee80211_band enumeration which could still be usefull later.

---
 drivers/net/wireless/rt2x00/rt2500usb.c    |   14 +++-----------
 drivers/net/wireless/rt2x00/rt2500usb.h    |    2 +-
 drivers/net/wireless/rt2x00/rt2x00.h       |    6 +-----
 drivers/net/wireless/rt2x00/rt2x00config.c |   17 ++---------------
 drivers/net/wireless/rt2x00/rt2x00dev.c    |    6 +++---
 5 files changed, 10 insertions(+), 35 deletions(-)
drivers/net/wireless/rt2x00/rt2500usb.c +3 -11
index 0b902c8..e348582 100644
@@ -358,18 +358,9 @@ static int rt2500usb_config_preamble(struct rt2x00_dev *rt2x00dev,
 }
 
 static void rt2500usb_config_phymode(struct rt2x00_dev *rt2x00dev,
-				     const int phymode,
 				     const int basic_rate_mask)
 {
 	rt2500usb_register_write(rt2x00dev, TXRX_CSR11, basic_rate_mask);
-
-	if (phymode == HWMODE_B) {
-		rt2500usb_register_write(rt2x00dev, MAC_CSR11, 0x000b);
-		rt2500usb_register_write(rt2x00dev, MAC_CSR12, 0x0040);
-	} else {
-		rt2500usb_register_write(rt2x00dev, MAC_CSR11, 0x0005);
-		rt2500usb_register_write(rt2x00dev, MAC_CSR12, 0x016c);
-	}
 }
 
 static void rt2500usb_config_channel(struct rt2x00_dev *rt2x00dev,
@@ -507,6 +498,8 @@ static void rt2500usb_config_duration(struct rt2x00_dev *rt2x00dev,
 	u16 reg;
 
 	rt2500usb_register_write(rt2x00dev, MAC_CSR10, libconf->slot_time);
+	rt2500usb_register_write(rt2x00dev, MAC_CSR11, libconf->sifs);
+	rt2500usb_register_write(rt2x00dev, MAC_CSR12, libconf->eifs);
 
 	rt2500usb_register_read(rt2x00dev, TXRX_CSR18, &reg);
 	rt2x00_set_field16(&reg, TXRX_CSR18_INTERVAL,
@@ -519,8 +512,7 @@ static void rt2500usb_config(struct rt2x00_dev *rt2x00dev,
 			     const unsigned int flags)
 {
 	if (flags & CONFIG_UPDATE_PHYMODE)
-		rt2500usb_config_phymode(rt2x00dev, libconf->phymode,
-					 libconf->basic_rates);
+		rt2500usb_config_phymode(rt2x00dev, libconf->basic_rates);
 	if (flags & CONFIG_UPDATE_CHANNEL)
 		rt2500usb_config_channel(rt2x00dev, &libconf->rf,
 					 libconf->conf->power_level);
drivers/net/wireless/rt2x00/rt2500usb.h +1 -1
index 23ba0c1..647cd2d 100644
@@ -135,7 +135,7 @@
  * Misc MAC_CSR registers.
  * MAC_CSR9: Timer control.
  * MAC_CSR10: Slot time.
- * MAC_CSR11: IFS.
+ * MAC_CSR11: SIFS.
  * MAC_CSR12: EIFS.
  * MAC_CSR13: Power mode0.
  * MAC_CSR14: Power mode1.
drivers/net/wireless/rt2x00/rt2x00.h +1 -5
index 01cf9e6..6c30bae 100644
@@ -390,10 +390,6 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
 	return (struct rt2x00_intf *)vif->drv_priv;
 }
 
-#define HWMODE_B	0
-#define HWMODE_G	1
-#define HWMODE_A	2
-
 /*
  * Details about the supported modes, rates and channels
  * of a particular chipset. This is used by rt2x00lib
@@ -433,7 +429,7 @@ struct rt2x00lib_conf {
 
 	struct antenna_setup ant;
 
-	int phymode;
+	enum ieee80211_band band;
 
 	int basic_rates;
 	int slot_time;
drivers/net/wireless/rt2x00/rt2x00config.c +2 -15
index b39d816..46888f9 100644
@@ -225,23 +225,10 @@ config:
 	memset(&libconf, 0, sizeof(libconf));
 
 	if (flags & CONFIG_UPDATE_PHYMODE) {
-		switch (conf->channel->band) {
-		case IEEE80211_BAND_5GHZ:
-			libconf.phymode = HWMODE_A;
-			break;
-		case IEEE80211_BAND_2GHZ:
-			/* Uh oh. what about B? */
-			libconf.phymode = HWMODE_G;
-			break;
-		default:
-			ERROR(rt2x00dev,
-			      "Attempt to configure unsupported mode (%d)"
-			      "Defaulting to 802.11b", conf->channel->band);
-			libconf.phymode = HWMODE_B;
-		}
-
 		band = &rt2x00dev->bands[conf->channel->band];
 		rate = &band->bitrates[band->n_bitrates - 1];
+
+		libconf.band = conf->channel->band;
 		libconf.basic_rates = rt2x00_get_rate(rate->hw_value)->ratemask;
 	}
 
drivers/net/wireless/rt2x00/rt2x00dev.c +3 -3
index 4fb6c58..644a09a 100644
@@ -903,7 +903,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
 	 * Rates: CCK.
 	 * Channels: 2.4 GHz
 	 */
-	if (spec->num_modes > HWMODE_B) {
+	if (spec->num_modes > 0) {
 		sbands[IEEE80211_BAND_2GHZ].n_channels = 14;
 		sbands[IEEE80211_BAND_2GHZ].n_bitrates = 4;
 		sbands[IEEE80211_BAND_2GHZ].channels = channels;
@@ -916,7 +916,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
 	 * Rates: CCK, OFDM.
 	 * Channels: 2.4 GHz
 	 */
-	if (spec->num_modes > HWMODE_G) {
+	if (spec->num_modes > 1) {
 		sbands[IEEE80211_BAND_2GHZ].n_channels = 14;
 		sbands[IEEE80211_BAND_2GHZ].n_bitrates = spec->num_rates;
 		sbands[IEEE80211_BAND_2GHZ].channels = channels;
@@ -929,7 +929,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
 	 * Rates: OFDM.
 	 * Channels: OFDM, UNII, HiperLAN2.
 	 */
-	if (spec->num_modes > HWMODE_A) {
+	if (spec->num_modes > 2) {
 		sbands[IEEE80211_BAND_5GHZ].n_channels = spec->num_channels - 14;
 		sbands[IEEE80211_BAND_5GHZ].n_bitrates = spec->num_rates - 4;
 		sbands[IEEE80211_BAND_5GHZ].channels = &channels[14];
Signature · 1 line
1.5.3.8
#11 lore raw

PATCH 11/19 rt2x00: Remove TX_MGMT queue usage

In reply to Ivo van Doorn

rt73usb doesn't have a 5th queue, correctly initialize hw->queues rt61pci had a 5th queue but was removed recently, correctly initialize hw->queues and remove the last remnants.

---
 drivers/net/wireless/rt2x00/rt61pci.c |    5 +----
 drivers/net/wireless/rt2x00/rt73usb.c |    2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/net/wireless/rt2x00/rt61pci.c +1 -4
index aa6b1cf..2f1db99 100644
@@ -1435,7 +1435,6 @@ static void rt61pci_disable_radio(struct rt2x00_dev *rt2x00dev)
 	rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC1, 1);
 	rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC2, 1);
 	rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC3, 1);
-	rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_MGMT, 1);
 	rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg);
 
 	/*
@@ -1608,8 +1607,6 @@ static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
 			   (queue == IEEE80211_TX_QUEUE_DATA2));
 	rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC3,
 			   (queue == IEEE80211_TX_QUEUE_DATA3));
-	rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_MGMT,
-			   (queue == IEEE80211_TX_QUEUE_DATA4));
 	rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg);
 }
 
@@ -2209,7 +2206,7 @@ static void rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 	rt2x00dev->hw->extra_tx_headroom = 0;
 	rt2x00dev->hw->max_signal = MAX_SIGNAL;
 	rt2x00dev->hw->max_rssi = MAX_RX_SSI;
-	rt2x00dev->hw->queues = 5;
+	rt2x00dev->hw->queues = 4;
 
 	SET_IEEE80211_DEV(rt2x00dev->hw, &rt2x00dev_pci(rt2x00dev)->dev);
 	SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
drivers/net/wireless/rt2x00/rt73usb.c +1 -1
index be8bfc5..cff5eb4 100644
@@ -1793,7 +1793,7 @@ static void rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 	rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE;
 	rt2x00dev->hw->max_signal = MAX_SIGNAL;
 	rt2x00dev->hw->max_rssi = MAX_RX_SSI;
-	rt2x00dev->hw->queues = 5;
+	rt2x00dev->hw->queues = 4;
 
 	SET_IEEE80211_DEV(rt2x00dev->hw, &rt2x00dev_usb(rt2x00dev)->dev);
 	SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
Signature · 1 line
1.5.3.8
#12 lore raw

PATCH 12/19 rt2x00: Initialize QID from queue->qid

In reply to Ivo van Doorn

The QID_MGMT is assigned to the beacon and atim queue during initialization. This means we don't need a seperate check in write_tx_desc()..

---
 drivers/net/wireless/rt2x00/rt2x00dev.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -11
index 644a09a..21d8514 100644
@@ -621,22 +621,12 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 
 	memset(&txdesc, 0, sizeof(txdesc));
 
+	txdesc.queue = skbdesc->entry->queue->qid;
 	txdesc.cw_min = skbdesc->entry->queue->cw_min;
 	txdesc.cw_max = skbdesc->entry->queue->cw_max;
 	txdesc.aifs = skbdesc->entry->queue->aifs;
 
 	/*
-	 * Identify queue
-	 */
-	if (control->queue < rt2x00dev->hw->queues)
-		txdesc.queue = control->queue;
-	else if (control->queue == IEEE80211_TX_QUEUE_BEACON ||
-		 control->queue == IEEE80211_TX_QUEUE_AFTER_BEACON)
-		txdesc.queue = QID_MGMT;
-	else
-		txdesc.queue = QID_OTHER;
-
-	/*
 	 * Read required fields from ieee80211 header.
 	 */
 	frame_control = le16_to_cpu(hdr->frame_control);
Signature · 1 line
1.5.3.8
#13 lore raw

PATCH 13/19 rt2x00: Use ieee80211_channel_to_frequency()

In reply to Ivo van Doorn

No need to perform the calculation ourselves when
wireless provides a helper function for it.

---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -4
index 21d8514..9a6ede0 100644
@@ -824,10 +824,7 @@ static void rt2x00lib_channel(struct ieee80211_channel *entry,
 			      const int channel, const int tx_power,
 			      const int value)
 {
-	if (channel <= 14)
-		entry->center_freq = 2407 + (5 * channel);
-	else
-		entry->center_freq = 5000 + (5 * channel);
+	entry->center_freq = ieee80211_channel_to_frequency(channel);
 	entry->hw_value = value;
 	entry->max_power = tx_power;
 	entry->max_antenna_gain = 0xff;
Signature · 1 line
1.5.3.8
#14 lore raw

PATCH 14/19 rt2x00: Make use of MAC80211_LED_TRIGGERS

In reply to Ivo van Doorn
Quoted 1 line

From ad1724df99ba8b555edd85b0cd0ab6cdb0559086 Mon Sep 17 00:00:00 2001

From: Ivo van Doorn <[email protected]>
Date: Sat, 2 Feb 2008 19:20:20 +0100
Subject: [PATCH] rt2x00: Make use of MAC80211_LED_TRIGGERS

Make use of the led triggers provided by mac80211 to control the led status. This can be enabled through a per-driver configuration option which will automatically enable the generic handler in rt2x00lib.

This has been enabled for rt2500usb and rt73usb for the moment since the led class will call set_brightness in irq context which will not work correctly with the usb drivers who need to sleep.

---
Patch size 37k, located on server:
http://kernel.org//pub/linux/kernel/people/ivd/rt2x00-2.1.0/0014-rt2x00-Make-use-of-MAC80211_LED_TRIGGERS.patch

 drivers/net/wireless/rt2x00/Kconfig     |   28 +++++
 drivers/net/wireless/rt2x00/Makefile    |    4 +
 drivers/net/wireless/rt2x00/rt2400pci.c |   88 ++++++++-------
 drivers/net/wireless/rt2x00/rt2500pci.c |   88 ++++++++-------
 drivers/net/wireless/rt2x00/rt2500usb.c |   91 +++++++++-------
 drivers/net/wireless/rt2x00/rt2x00.h    |   27 +++--
 drivers/net/wireless/rt2x00/rt2x00dev.c |   19 +++-
 drivers/net/wireless/rt2x00/rt2x00lib.h |   33 ++++++
 drivers/net/wireless/rt2x00/rt61pci.c   |  180 ++++++++++++++-----------------
 drivers/net/wireless/rt2x00/rt73usb.c   |  165 +++++++++++++---------------
 10 files changed, 403 insertions(+), 320 deletions(-)
#15 lore raw

PATCH 15/19 rt2x00: Enable LED class support for rt2500usb/rt73usb

In reply to Ivo van Doorn

Add kerneldoc for vendor request functions in rt2x00usb. Add asynchroneous vendor request function in rt2x00usb.

With the availability of the asynchroneuous vendor request we can now enable LED class support for rt2500usb and rt73usb. Since LED handling is not important, it doesn't really matter if a register call fails (This solution is better then no LED class support at all).

---
 drivers/net/wireless/rt2x00/Kconfig      |   14 ++
 drivers/net/wireless/rt2x00/rt2500usb.c  |   20 ++-
 drivers/net/wireless/rt2x00/rt2x00leds.c |  217 ++++++++++++++++++++++++++++++
 drivers/net/wireless/rt2x00/rt2x00leds.h |   63 +++++++++
 drivers/net/wireless/rt2x00/rt2x00usb.c  |   52 +++++++
 drivers/net/wireless/rt2x00/rt2x00usb.h  |  129 +++++++++++++-----
 drivers/net/wireless/rt2x00/rt73usb.c    |   21 ++--
 7 files changed, 463 insertions(+), 53 deletions(-)
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00leds.c
 create mode 100644 drivers/net/wireless/rt2x00/rt2x00leds.h
drivers/net/wireless/rt2x00/Kconfig +14 -0
index 88a6ef6..51adb2f 100644
@@ -133,6 +133,13 @@ config RT2500USB
 
 	  When compiled as a module, this driver will be called "rt2500usb.ko".
 
+config RT2500USB_LEDS
+	bool "RT2500 leds support"
+	depends on RT2500USB
+	select RT2X00_LIB_LEDS
+	---help---
+	  This adds support for led triggers provided my mac80211.
+
 config RT73USB
 	tristate "Ralink rt73 usb support"
 	depends on RT2X00 && USB
@@ -143,6 +150,13 @@ config RT73USB
 
 	  When compiled as a module, this driver will be called "rt73usb.ko".
 
+config RT73USB_LEDS
+	bool "RT73 leds support"
+	depends on RT73USB
+	select RT2X00_LIB_LEDS
+	---help---
+	  This adds support for led triggers provided my mac80211.
+
 config RT2X00_LIB_DEBUGFS
 	bool "Ralink debugfs support"
 	depends on RT2X00_LIB && MAC80211_DEBUGFS
drivers/net/wireless/rt2x00/rt2500usb.c +13 -7
index f10b574..7c48c10 100644
@@ -291,17 +291,16 @@ static void rt2500usb_led_brightness(struct led_classdev *led_cdev,
 	unsigned int enabled = brightness != LED_OFF;
 	unsigned int activity =
 	    led->rt2x00dev->led_flags & LED_SUPPORT_ACTIVITY;
-	u16 reg;
-
-	rt2500usb_register_read(led->rt2x00dev, MAC_CSR20, &reg);
 
 	if (led->type == LED_TYPE_RADIO || led->type == LED_TYPE_ASSOC) {
-		rt2x00_set_field16(&reg, MAC_CSR20_LINK, enabled);
-		rt2x00_set_field16(&reg, MAC_CSR20_ACTIVITY,
-				   enabled && activity);
+		rt2x00_set_field16(&led->rt2x00dev->led_mcu_reg,
+				   MAC_CSR20_LINK, enabled);
+		rt2x00_set_field16(&led->rt2x00dev->led_mcu_reg,
+				   MAC_CSR20_ACTIVITY, enabled && activity);
 	}
 
-	rt2500usb_register_write(led->rt2x00dev, MAC_CSR20, reg);
+	rt2x00usb_vendor_request_async(led->rt2x00dev, USB_SINGLE_WRITE,
+				       MAC_CSR20, led->rt2x00dev->led_mcu_reg);
 }
 #else
 #define rt2500usb_led_brightness	NULL
@@ -1373,6 +1372,13 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
 		rt2x00dev->led_flags = LED_SUPPORT_RADIO;
 		break;
 	}
+
+	/*
+	 * Store the current led register value, we need it later
+	 * in set_brightness but that is called in irq context which
+	 * means we can't use rt2500usb_register_read() at that time.
+	 */
+	rt2500usb_register_read(rt2x00dev, MAC_CSR20, &rt2x00dev->led_mcu_reg);
 #endif /* CONFIG_RT2500USB_LEDS */
 
 	/*
drivers/net/wireless/rt2x00/rt2x00leds.c new file +217 -0

217 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00leds.h new file +63 -0

63 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00usb.c +52 -0

58 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00usb.h +95 -34

174 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt73usb.c +9 -12
index 43d21aa..e970e32 100644
@@ -294,28 +294,25 @@ static void rt73usb_led_brightness(struct led_classdev *led_cdev,
 		rt2x00_set_field16(&led->rt2x00dev->led_mcu_reg,
 				   MCU_LEDCS_RADIO_STATUS, enabled);
 
-		rt2x00usb_vendor_request_sw(led->rt2x00dev, USB_LED_CONTROL, 0,
-					    led->rt2x00dev->led_mcu_reg,
-					    REGISTER_TIMEOUT);
+		rt2x00usb_vendor_request_async(led->rt2x00dev, USB_LED_CONTROL,
+					       0, led->rt2x00dev->led_mcu_reg);
 	} else if (led->type == LED_TYPE_ASSOC) {
 		rt2x00_set_field16(&led->rt2x00dev->led_mcu_reg,
 				   MCU_LEDCS_LINK_BG_STATUS, bg_mode);
 		rt2x00_set_field16(&led->rt2x00dev->led_mcu_reg,
 				   MCU_LEDCS_LINK_A_STATUS, a_mode);
 
-		rt2x00usb_vendor_request_sw(led->rt2x00dev, USB_LED_CONTROL, 0,
-					    led->rt2x00dev->led_mcu_reg,
-					    REGISTER_TIMEOUT);
+		rt2x00usb_vendor_request_async(led->rt2x00dev, USB_LED_CONTROL,
+					       0, led->rt2x00dev->led_mcu_reg);
 	} else if (led->type == LED_TYPE_QUALITY) {
 		/*
 		 * The brightness is divided into 6 levels (0 - 5),
 		 * this means we need to convert the brightness
 		 * argument into the matching level within that range.
 		 */
-		rt2x00usb_vendor_request_sw(led->rt2x00dev, USB_LED_CONTROL,
-					    brightness / (LED_FULL / 6),
-					    led->rt2x00dev->led_mcu_reg,
-					    REGISTER_TIMEOUT);
+		rt2x00usb_vendor_request_async(led->rt2x00dev, USB_LED_CONTROL,
+					       brightness / (LED_FULL / 6),
+					       led->rt2x00dev->led_mcu_reg);
 	}
 }
 #else
@@ -871,7 +868,7 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, void *data,
 
 		rt2x00usb_vendor_request(rt2x00dev, USB_MULTI_WRITE,
 					 USB_VENDOR_REQUEST_OUT,
-					 FIRMWARE_IMAGE_BASE + i, 0x0000,
+					 FIRMWARE_IMAGE_BASE + i, 0,
 					 cache, buflen, timeout);
 
 		ptr += buflen;
@@ -884,7 +881,7 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, void *data,
 	 * we need to specify a long timeout time.
 	 */
 	status = rt2x00usb_vendor_request_sw(rt2x00dev, USB_DEVICE_MODE,
-					     0x0000, USB_MODE_FIRMWARE,
+					     0, USB_MODE_FIRMWARE,
 					     REGISTER_TIMEOUT_FIRMWARE);
 	if (status < 0) {
 		ERROR(rt2x00dev, "Failed to write Firmware to device.\n");
Signature · 1 line
1.5.3.8
#16 lore raw

PATCH 16/19 rt2x00: Fix rate initialization

In reply to Ivo van Doorn

Fix typo in rate initialization. This fixes the WARN_ON() in net/wireless/util.cpp:83

---
 drivers/net/wireless/rt2x00/rt2x00dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -1
index 3ba1f37..84f0441 100644
@@ -873,7 +873,7 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
 	 * Initialize Rate list.
 	 */
 	for (i = 0; i < spec->num_rates; i++)
-		rt2x00lib_rate(&rates[0], i, rt2x00_get_rate(i));
+		rt2x00lib_rate(&rates[i], i, rt2x00_get_rate(i));
 
 	/*
 	 * Initialize Channel list.
Signature · 1 line
1.5.3.8
#17 lore raw

PATCH 17/19 rt2x00: Move beacon and atim queue defines into rt2x00

In reply to Ivo van Doorn

As Johannes Berg indicated the BEACON and AFTER_BEACON queue indeces in mac80211 should be removed because they are too hardware specific. This patch adds the queue index defines into rt2x00queue.h and removes the dependency of the defines inside mac80211.h.

Also move rt2x00pci_beacon_update() into rt2400pci and rt2500pci individually since it is no longer a generic function since rt61 and rt2800 no longer use that.

---
 drivers/net/wireless/rt2x00/rt2400pci.c   |   53 +++++++++++++++++++++++++---
 drivers/net/wireless/rt2x00/rt2500pci.c   |   55 +++++++++++++++++++++++++---
 drivers/net/wireless/rt2x00/rt2500usb.c   |   12 +++---
 drivers/net/wireless/rt2x00/rt2x00.h      |    7 ++--
 drivers/net/wireless/rt2x00/rt2x00dev.c   |    2 +-
 drivers/net/wireless/rt2x00/rt2x00mac.c   |    2 +-
 drivers/net/wireless/rt2x00/rt2x00pci.c   |   47 ------------------------
 drivers/net/wireless/rt2x00/rt2x00pci.h   |    6 ---
 drivers/net/wireless/rt2x00/rt2x00queue.c |    6 ++--
 drivers/net/wireless/rt2x00/rt2x00queue.h |   15 ++++++++
 drivers/net/wireless/rt2x00/rt61pci.c     |   12 +++---
 drivers/net/wireless/rt2x00/rt73usb.c     |   12 +++---
 12 files changed, 139 insertions(+), 90 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +48 -5
index 0975f55..693f3d3 100644
@@ -1028,11 +1028,11 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-				    unsigned int queue)
+				    const unsigned int queue)
 {
 	u32 reg;
 
-	if (queue == IEEE80211_TX_QUEUE_BEACON) {
+	if (queue == RT2X00_BCN_QUEUE_BEACON) {
 		rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
 		if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
 			rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1);
@@ -1047,7 +1047,7 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
 	rt2x00_set_field32(&reg, TXCSR0_KICK_TX,
 			   (queue == IEEE80211_TX_QUEUE_DATA1));
 	rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM,
-			   (queue == IEEE80211_TX_QUEUE_AFTER_BEACON));
+			   (queue == RT2X00_BCN_QUEUE_ATIM));
 	rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
 }
 
@@ -1152,7 +1152,7 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
 	 * 3 - Atim ring transmit done interrupt.
 	 */
 	if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING))
-		rt2400pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_AFTER_BEACON);
+		rt2400pci_txdone(rt2x00dev, RT2X00_BCN_QUEUE_ATIM);
 
 	/*
 	 * 4 - Priority ring transmit done interrupt.
@@ -1513,6 +1513,49 @@ static void rt2400pci_reset_tsf(struct ieee80211_hw *hw)
 	rt2x00pci_register_write(rt2x00dev, CSR17, 0);
 }
 
+static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
+				   struct ieee80211_tx_control *control)
+{
+	struct rt2x00_dev *rt2x00dev = hw->priv;
+	struct rt2x00_intf *intf = vif_to_intf(control->vif);
+	struct queue_entry_priv_pci_tx *priv_tx;
+	struct skb_frame_desc *skbdesc;
+
+	if (unlikely(!intf->beacon))
+		return -ENOBUFS;
+
+	priv_tx = intf->beacon->priv_data;
+
+	/*
+	 * Fill in skb descriptor
+	 */
+	skbdesc = get_skb_frame_desc(skb);
+	memset(skbdesc, 0, sizeof(*skbdesc));
+	skbdesc->data = skb->data;
+	skbdesc->data_len = skb->len;
+	skbdesc->desc = priv_tx->desc;
+	skbdesc->desc_len = intf->beacon->queue->desc_size;
+	skbdesc->entry = intf->beacon;
+
+	/*
+	 * mac80211 doesn't provide the control->queue variable
+	 * for beacons. Set our own queue identification so
+	 * it can be used during descriptor initialization.
+	 */
+	control->queue = RT2X00_BCN_QUEUE_BEACON;
+	rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
+
+	/*
+	 * Enable beacon generation.
+	 * Write entire beacon with descriptor to register,
+	 * and kick the beacon generator.
+	 */
+	memcpy(priv_tx->data, skb->data, skb->len);
+	rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);
+
+	return 0;
+}
+
 static int rt2400pci_tx_last_beacon(struct ieee80211_hw *hw)
 {
 	struct rt2x00_dev *rt2x00dev = hw->priv;
@@ -1538,7 +1581,7 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = {
 	.get_tx_stats		= rt2x00mac_get_tx_stats,
 	.get_tsf		= rt2400pci_get_tsf,
 	.reset_tsf		= rt2400pci_reset_tsf,
-	.beacon_update		= rt2x00pci_beacon_update,
+	.beacon_update		= rt2400pci_beacon_update,
 	.tx_last_beacon		= rt2400pci_tx_last_beacon,
 };
 
drivers/net/wireless/rt2x00/rt2500pci.c +49 -6

94 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2500usb.c +6 -6
index 7c48c10..eb98d28 100644
@@ -1077,11 +1077,11 @@ static int rt2500usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-				    unsigned int queue)
+				    const unsigned int queue)
 {
 	u16 reg;
 
-	if (queue != IEEE80211_TX_QUEUE_BEACON)
+	if (queue != RT2X00_BCN_QUEUE_BEACON)
 		return;
 
 	rt2500usb_register_read(rt2x00dev, TXRX_CSR19, &reg);
@@ -1758,11 +1758,11 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
 	skbdesc->entry = intf->beacon;
 
 	/*
-	 * Just in case mac80211 doesn't set this correctly,
-	 * but we need this queue set for the descriptor
-	 * initialization.
+	 * mac80211 doesn't provide the control->queue variable
+	 * for beacons. Set our own queue identification so
+	 * it can be used during descriptor initialization.
 	 */
-	control->queue = IEEE80211_TX_QUEUE_BEACON;
+	control->queue = RT2X00_BCN_QUEUE_BEACON;
 	rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
 
 	/*
drivers/net/wireless/rt2x00/rt2x00.h +4 -3
index 123fe2f..76270e9 100644
@@ -530,7 +530,7 @@ struct rt2x00lib_ops {
 	int (*get_tx_data_len) (struct rt2x00_dev *rt2x00dev,
 				struct sk_buff *skb);
 	void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev,
-			       unsigned int queue);
+			       const unsigned int queue);
 
 	/*
 	 * RX control handlers
@@ -910,10 +910,11 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate)
 /**
  * rt2x00queue_get_queue - Convert mac80211 queue index to rt2x00 queue
  * @rt2x00dev: Pointer to &struct rt2x00_dev.
- * @queue: mac80211 queue index (see &enum ieee80211_tx_queue).
+ * @queue: mac80211/rt2x00 queue index
+ *	(see &enum ieee80211_tx_queue and &enum rt2x00_bcn_queue).
  */
 struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
-					 const enum ieee80211_tx_queue queue);
+					 const unsigned int queue);
 
 /**
  * rt2x00queue_get_entry - Get queue entry where the given index points to.
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -1
index 84f0441..c714c4c 100644
@@ -673,7 +673,7 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 	 * Beacons and probe responses require the tsf timestamp
 	 * to be inserted into the frame.
 	 */
-	if (control->queue == IEEE80211_TX_QUEUE_BEACON ||
+	if (control->queue == RT2X00_BCN_QUEUE_BEACON ||
 	    is_probe_resp(frame_control))
 		__set_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc.flags);
 
drivers/net/wireless/rt2x00/rt2x00mac.c +1 -1
index 65a2bcd..8c24d3b 100644
@@ -164,7 +164,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 	struct rt2x00_dev *rt2x00dev = hw->priv;
 	struct rt2x00_intf *intf = vif_to_intf(conf->vif);
 	struct data_queue *queue =
-	    rt2x00queue_get_queue(rt2x00dev, IEEE80211_TX_QUEUE_BEACON);
+	    rt2x00queue_get_queue(rt2x00dev, RT2X00_BCN_QUEUE_BEACON);
 	struct queue_entry *entry = NULL;
 	unsigned int i;
 
drivers/net/wireless/rt2x00/rt2x00pci.c +0 -47

53 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00pci.h +0 -6
index 3b1597f..71335e1 100644
@@ -88,12 +88,6 @@ rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev,
 }
 
 /*
- * Beacon handlers.
- */
-int rt2x00pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
-			    struct ieee80211_tx_control *control);
-
-/*
  * TX data handlers.
  */
 int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
drivers/net/wireless/rt2x00/rt2x00queue.c +3 -3
index 921eca3..52bb57d 100644
@@ -30,7 +30,7 @@
 #include "rt2x00lib.h"
 
 struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
-					 const enum ieee80211_tx_queue queue)
+					 const unsigned int queue)
 {
 	int atim = test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);
 
@@ -40,9 +40,9 @@ struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
 	if (!rt2x00dev->bcn)
 		return NULL;
 
-	if (queue == IEEE80211_TX_QUEUE_BEACON)
+	if (queue == RT2X00_BCN_QUEUE_BEACON)
 		return &rt2x00dev->bcn[0];
-	else if (queue == IEEE80211_TX_QUEUE_AFTER_BEACON && atim)
+	else if (queue == RT2X00_BCN_QUEUE_ATIM && atim)
 		return &rt2x00dev->bcn[1];
 
 	return NULL;
drivers/net/wireless/rt2x00/rt2x00queue.h +15 -0
index 75af48e..956e0be 100644
@@ -67,6 +67,21 @@ enum data_queue_qid {
 };
 
 /**
+ * enum rt2x00_bcn_queue: Beacon queue index
+ *
+ * Start counting with a high offset, this because this enumeration
+ * supplements &enum ieee80211_tx_queue and we should prevent value
+ * conflicts.
+ *
+ * @RT2X00_BCN_QUEUE_BEACON: Beacon queue
+ * @RT2X00_BCN_QUEUE_ATIM: Atim queue (sends frame after beacon)
+ */
+enum rt2x00_bcn_queue {
+	RT2X00_BCN_QUEUE_BEACON = 100,
+	RT2X00_BCN_QUEUE_ATIM = 101,
+};
+
+/**
  * struct skb_frame_desc: Descriptor information for the skb buffer
  *
  * This structure is placed over the skb->cb array, this means that
drivers/net/wireless/rt2x00/rt61pci.c +6 -6
index 199c5b7..9fd2dd8 100644
@@ -1546,11 +1546,11 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-				  unsigned int queue)
+				  const unsigned int queue)
 {
 	u32 reg;
 
-	if (queue == IEEE80211_TX_QUEUE_BEACON) {
+	if (queue == RT2X00_BCN_QUEUE_BEACON) {
 		/*
 		 * For Wi-Fi faily generated beacons between participating
 		 * stations. Set TBTT phase adaptive adjustment step to 8us.
@@ -2411,11 +2411,11 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
 	skbdesc->entry = intf->beacon;
 
 	/*
-	 * Just in case the ieee80211 doesn't set this,
-	 * but we need this queue set for the descriptor
-	 * initialization.
+	 * mac80211 doesn't provide the control->queue variable
+	 * for beacons. Set our own queue identification so
+	 * it can be used during descriptor initialization.
 	 */
-	control->queue = IEEE80211_TX_QUEUE_BEACON;
+	control->queue = RT2X00_BCN_QUEUE_BEACON;
 	rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
 
 	/*
drivers/net/wireless/rt2x00/rt73usb.c +6 -6
index e970e32..146135f 100644
@@ -1290,11 +1290,11 @@ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
  * TX data initialization
  */
 static void rt73usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
-				  unsigned int queue)
+				  const unsigned int queue)
 {
 	u32 reg;
 
-	if (queue != IEEE80211_TX_QUEUE_BEACON)
+	if (queue != RT2X00_BCN_QUEUE_BEACON)
 		return;
 
 	/*
@@ -2011,11 +2011,11 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
 	skbdesc->entry = intf->beacon;
 
 	/*
-	 * Just in case the ieee80211 doesn't set this,
-	 * but we need this queue set for the descriptor
-	 * initialization.
+	 * mac80211 doesn't provide the control->queue variable
+	 * for beacons. Set our own queue identification so
+	 * it can be used during descriptor initialization.
 	 */
-	control->queue = IEEE80211_TX_QUEUE_BEACON;
+	control->queue = RT2X00_BCN_QUEUE_BEACON;
 	rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
 
 	/*
Signature · 1 line
1.5.3.8
#18 lore raw

PATCH 18/19 rt2x00: Fix queue index handling

In reply to Ivo van Doorn

When Q_INDEX is increased, the queue->length should be increased, only when Q_INDEX_DONE is increased should queue_length be descreased.

---
 drivers/net/wireless/rt2x00/rt2x00queue.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +6 -2
index 52bb57d..fde64ea 100644
@@ -84,8 +84,12 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
 	if (queue->index[index] >= queue->limit)
 		queue->index[index] = 0;
 
-	queue->length--;
-	queue->count += (index == Q_INDEX_DONE);
+	if (index == Q_INDEX) {
+		queue->length++;
+	} else if (index == Q_INDEX_DONE) {
+		queue->length--;
+		queue->count ++;
+	}
 
 	spin_unlock(&queue->lock);
 }
Signature · 1 line
1.5.3.8
#19 lore raw

PATCH 19/19 rt2x00: Release rt2x00 2.1.0

In reply to Ivo van Doorn
---
 drivers/net/wireless/rt2x00/rt2x00.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +1 -1
index 76270e9..f6ec9fe 100644
@@ -44,7 +44,7 @@
 /*
  * Module information.
  */
-#define DRV_VERSION	"2.0.14"
+#define DRV_VERSION	"2.1.0"
 #define DRV_PROJECT	"http://rt2x00.serialmonkey.com"
 
 /*
Signature · 1 line
1.5.3.8