rt2x00: Support hardware RTS and CTS-to-self frames
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/9 rt2x00: Support hardware RTS and CTS-to-self frames
If the driver has set the set_rts_threshold() callback function to mac80211 it is capable of generating RTS and CTS-to-self frames inside the hardware and rt2x00lib doesn't have to create them in software.
Only rt2800pci and rt2800usb support this feature.
--- drivers/net/wireless/rt2x00/rt2x00mac.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +6 -1
@@ -118,11 +118,16 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,* create and queue that frame first. But make sure we have * at least enough entries available to send this CTS/RTS * frame as well as the data frame. +* Note that when the driver has set the set_rts_threshold() +* callback function it doesn't need software generation of +* neither RTS or CTS-to-self frames and handles everything +* inside the hardware. */ frame_control =le16_to_cpu (ieee80211hdr->frame_control);if (!is_rts_frame (frame_control) && !is_cts_frame (frame_control) && (control->flags & (IEEE80211_TXCTL_USE_RTS_CTS | -IEEE80211_TXCTL_USE_CTS_PROTECT ))) { +IEEE80211_TXCTL_USE_CTS_PROTECT )) && + !rt2x00dev->ops->hw->set_rts_threshold) {if (rt2x00queue_available (queue) <=1 ) {ieee80211_stop_queue (rt2x00dev->hw, control->queue);return NETDEV_TX_BUSY ;
Signature · 1 line
1.5.4.5
PATCH 2/9 rt2x00: Remove DRIVER_SUPPORT_MIXED_INTERFACES
In reply to a message not in the archiveA lot more is needed to support mixed interfaces then just this flag, such things need new redesigns in rt2x00lib to actually make it happen. So far there doesn't exist a Ralink chipset that can handle it, so we might as well remove the flag for now and see what should be done whenever a device appears that can handle it.
--- drivers/net/wireless/rt2x00/rt2x00.h | 1 - drivers/net/wireless/rt2x00/rt2x00mac.c | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +0 -1
@@ -621,7 +621,6 @@ enum rt2x00_flags {/* * Driver features */ -DRIVER_SUPPORT_MIXED_INTERFACES ,DRIVER_REQUIRE_FIRMWARE ,DRIVER_REQUIRE_BEACON_GUARD , DRIVER_REQUIRE_ATIM_QUEUE,
drivers/net/wireless/rt2x00/rt2x00mac.c +5 -6
@@ -201,13 +201,12 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,return -ENODEV ;/* -* When we don't support mixed interfaces (a combination -* of sta and ap virtual interfaces) then we can only -* add this interface when the rival interface count is 0. +* We don't support mixed combinations of sta and ap virtual +* interfaces. We can only add this interface when the rival +* interface count is 0. */ -if (!test_bit (DRIVER_SUPPORT_MIXED_INTERFACES , &rt2x00dev->flags) && - ((conf->type ==IEEE80211_IF_TYPE_AP && rt2x00dev->intf_sta_count) || - (conf->type !=IEEE80211_IF_TYPE_AP && rt2x00dev->intf_ap_count))) +if ((conf->type ==IEEE80211_IF_TYPE_AP && rt2x00dev->intf_sta_count) || + (conf->type !=IEEE80211_IF_TYPE_AP && rt2x00dev->intf_ap_count))return -ENOBUFS ;/*
Signature · 1 line
1.5.4.5
PATCH 3/9 rt2x00: Don't enable short preamble for 1MBs
In reply to a message not in the archiveThe timing settings for 1MBs should exclude
the short preamble bit since that only applies
to 2MBs, 5.5MBs and 11MBs.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +1 -1
@@ -363,7 +363,7 @@ static void rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev,rt2x00pci_register_write (rt2x00dev,TXCSR1 , reg);rt2x00pci_register_read (rt2x00dev,ARCSR2 , ®); -rt2x00_set_field32 (®,ARCSR2_SIGNAL ,0x00 | preamble_mask); +rt2x00_set_field32 (®,ARCSR2_SIGNAL ,0x00 );rt2x00_set_field32 (®,ARCSR2_SERVICE ,0x04 );rt2x00_set_field32 (®,ARCSR2_LENGTH ,get_duration (ACK_SIZE ,10 ));rt2x00pci_register_write (rt2x00dev,ARCSR2 , reg);
drivers/net/wireless/rt2x00/rt2500pci.c +1 -1
@@ -370,7 +370,7 @@ static void rt2500pci_config_erp(struct rt2x00_dev *rt2x00dev,rt2x00pci_register_write (rt2x00dev,TXCSR1 , reg);rt2x00pci_register_read (rt2x00dev,ARCSR2 , ®); -rt2x00_set_field32 (®,ARCSR2_SIGNAL ,0x00 | preamble_mask); +rt2x00_set_field32 (®,ARCSR2_SIGNAL ,0x00 );rt2x00_set_field32 (®,ARCSR2_SERVICE ,0x04 );rt2x00_set_field32 (®,ARCSR2_LENGTH ,get_duration (ACK_SIZE ,10 ));rt2x00pci_register_write (rt2x00dev,ARCSR2 , reg);
Signature · 1 line
1.5.4.5
PATCH 4/9 rt2x00: Use rt2x00 queue numbering
In reply to a message not in the archiveUse the rt2x00 queue enumeration as much as possible, removing the usage of the mac80211 queue numbering wherever it is possible.
This makes it easier for mac80211 to change it queue identification scheme without having to deal with big changes in the rt2x00 code.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 32 ++++++++--------------- drivers/net/wireless/rt2x00/rt2500pci.c | 35 ++++++++---------------- drivers/net/wireless/rt2x00/rt2500usb.c | 12 ++------ drivers/net/wireless/rt2x00/rt2x00.h | 9 +++--- drivers/net/wireless/rt2x00/rt2x00dev.c | 3 +- drivers/net/wireless/rt2x00/rt2x00mac.c | 13 ++++----- drivers/net/wireless/rt2x00/rt2x00pci.c | 2 +- drivers/net/wireless/rt2x00/rt2x00queue.c | 6 ++-- drivers/net/wireless/rt2x00/rt2x00queue.h | 40 ++++++++++++++++++---------- drivers/net/wireless/rt2x00/rt2x00usb.c | 2 +- drivers/net/wireless/rt2x00/rt61pci.c | 27 ++++++------------- drivers/net/wireless/rt2x00/rt73usb.c | 15 +++-------- 12 files changed, 80 insertions(+), 116 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +11 -21
@@ -1055,11 +1055,11 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,* TX data initialization */ static void rt2400pci_kick_tx_queue (struct rt2x00_dev *rt2x00dev, -const unsigned int queue) +const enum data_queue_qid queue) {u32 reg; -if (queue ==RT2X00_BCN_QUEUE_BEACON ) { +if (queue ==QID_BEACON ) {rt2x00pci_register_read (rt2x00dev,CSR14 , ®);if (!rt2x00_get_field32 (reg,CSR14_BEACON_GEN )) {rt2x00_set_field32 (®,CSR14_TSF_COUNT ,1 );
@@ -1071,12 +1071,9 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, }rt2x00pci_register_read (rt2x00dev,TXCSR0 , ®); -rt2x00_set_field32 (®,TXCSR0_KICK_PRIO , - (queue ==IEEE80211_TX_QUEUE_DATA0 )); -rt2x00_set_field32 (®,TXCSR0_KICK_TX , - (queue ==IEEE80211_TX_QUEUE_DATA1 )); -rt2x00_set_field32 (®,TXCSR0_KICK_ATIM , - (queue ==RT2X00_BCN_QUEUE_ATIM )); +rt2x00_set_field32 (®,TXCSR0_KICK_PRIO , (queue ==QID_AC_BE )); +rt2x00_set_field32 (®,TXCSR0_KICK_TX , (queue ==QID_AC_BK )); +rt2x00_set_field32 (®,TXCSR0_KICK_ATIM , (queue ==QID_ATIM ));rt2x00pci_register_write (rt2x00dev,TXCSR0 , reg); }
@@ -1120,7 +1117,7 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry,* Interrupt functions. */ static void rt2400pci_txdone (struct rt2x00_dev *rt2x00dev, -const enum ieee80211_tx_queue queue_idx) +const enum data_queue_qid queue_idx) {struct data_queue *queue =rt2x00queue_get_queue (rt2x00dev, queue_idx);struct queue_entry_priv_pci_tx *priv_tx;
@@ -1187,19 +1184,19 @@ 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,RT2X00_BCN_QUEUE_ATIM ); +rt2400pci_txdone (rt2x00dev,QID_ATIM );/* * 4 - Priority ring transmit done interrupt. */ if (rt2x00_get_field32 (reg,CSR7_TXDONE_PRIORING )) -rt2400pci_txdone (rt2x00dev,IEEE80211_TX_QUEUE_DATA0 ); +rt2400pci_txdone (rt2x00dev,QID_AC_BE );/* * 5 - Tx ring transmit done interrupt. */ if (rt2x00_get_field32 (reg,CSR7_TXDONE_TXRING )) -rt2400pci_txdone (rt2x00dev,IEEE80211_TX_QUEUE_DATA1 ); +rt2400pci_txdone (rt2x00dev,QID_AC_BK );return IRQ_HANDLED ; }
@@ -1521,20 +1518,13 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,rt2x00pci_register_write (rt2x00dev,CSR14 , reg);/* -* 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. */ +rt2x00lib_write_tx_desc (rt2x00dev, skb, control);memcpy (priv_tx->data, skb->data, skb->len); - rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev, control->queue); + rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev,QID_BEACON );return 0 ; }
drivers/net/wireless/rt2x00/rt2500pci.c +12 -23
@@ -317,8 +317,7 @@ static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00intf_conf *conf, const unsigned int flags) { -struct data_queue *queue = -rt2x00queue_get_queue (rt2x00dev,RT2X00_BCN_QUEUE_BEACON ); +struct data_queue *queue =rt2x00queue_get_queue (rt2x00dev,QID_BEACON );unsigned int bcn_preload;u32 reg;
@@ -1210,11 +1209,11 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,* TX data initialization */ static void rt2500pci_kick_tx_queue (struct rt2x00_dev *rt2x00dev, -const unsigned int queue) +const enum data_queue_qid queue) {u32 reg; -if (queue ==RT2X00_BCN_QUEUE_BEACON ) { +if (queue ==QID_BEACON ) {rt2x00pci_register_read (rt2x00dev,CSR14 , ®);if (!rt2x00_get_field32 (reg,CSR14_BEACON_GEN )) {rt2x00_set_field32 (®,CSR14_TSF_COUNT ,1 );
@@ -1226,12 +1225,9 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, }rt2x00pci_register_read (rt2x00dev,TXCSR0 , ®); -rt2x00_set_field32 (®,TXCSR0_KICK_PRIO , - (queue ==IEEE80211_TX_QUEUE_DATA0 )); -rt2x00_set_field32 (®,TXCSR0_KICK_TX , - (queue ==IEEE80211_TX_QUEUE_DATA1 )); -rt2x00_set_field32 (®,TXCSR0_KICK_ATIM , - (queue ==RT2X00_BCN_QUEUE_ATIM )); +rt2x00_set_field32 (®,TXCSR0_KICK_PRIO , (queue ==QID_AC_BE )); +rt2x00_set_field32 (®,TXCSR0_KICK_TX , (queue ==QID_AC_BK )); +rt2x00_set_field32 (®,TXCSR0_KICK_ATIM , (queue ==QID_ATIM ));rt2x00pci_register_write (rt2x00dev,TXCSR0 , reg); }
@@ -1276,7 +1272,7 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry,* Interrupt functions. */ static void rt2500pci_txdone (struct rt2x00_dev *rt2x00dev, -const enum ieee80211_tx_queue queue_idx) +const enum data_queue_qid queue_idx) {struct data_queue *queue =rt2x00queue_get_queue (rt2x00dev, queue_idx);struct queue_entry_priv_pci_tx *priv_tx;
@@ -1343,19 +1339,19 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)* 3 - Atim ring transmit done interrupt. */ if (rt2x00_get_field32 (reg,CSR7_TXDONE_ATIMRING )) -rt2500pci_txdone (rt2x00dev,RT2X00_BCN_QUEUE_ATIM ); +rt2500pci_txdone (rt2x00dev,QID_ATIM );/* * 4 - Priority ring transmit done interrupt. */ if (rt2x00_get_field32 (reg,CSR7_TXDONE_PRIORING )) -rt2500pci_txdone (rt2x00dev,IEEE80211_TX_QUEUE_DATA0 ); +rt2500pci_txdone (rt2x00dev,QID_AC_BE );/* * 5 - Tx ring transmit done interrupt. */ if (rt2x00_get_field32 (reg,CSR7_TXDONE_TXRING )) -rt2500pci_txdone (rt2x00dev,IEEE80211_TX_QUEUE_DATA1 ); +rt2500pci_txdone (rt2x00dev,QID_AC_BK );return IRQ_HANDLED ; }
@@ -1834,20 +1830,13 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,rt2x00pci_register_write (rt2x00dev,CSR14 , reg);/* -* 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. */ +rt2x00lib_write_tx_desc (rt2x00dev, skb, control);memcpy (priv_tx->data, skb->data, skb->len); - rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev, control->queue); + rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev,QID_BEACON );return 0 ; }
drivers/net/wireless/rt2x00/rt2500usb.c +3 -9
@@ -1094,11 +1094,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, -const unsigned int queue) +const enum data_queue_qid queue) {u16 reg; -if (queue !=RT2X00_BCN_QUEUE_BEACON ) +if (queue !=QID_BEACON )return ;rt2500usb_register_read (rt2x00dev,TXRX_CSR19 , ®);
@@ -1720,12 +1720,6 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,rt2x00_set_field16 (®,TXRX_CSR19_BEACON_GEN ,0 );rt2500usb_register_write (rt2x00dev,TXRX_CSR19 , reg); -/* -* 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);/*
@@ -1757,7 +1751,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,/* * Enable beacon generation. */ -rt2500usb_kick_tx_queue (rt2x00dev, control->queue); +rt2500usb_kick_tx_queue (rt2x00dev,QID_BEACON );return 0 ; }
drivers/net/wireless/rt2x00/rt2x00.h +4 -5
@@ -548,7 +548,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, -const unsigned int queue); +const enum data_queue_qid queue);/* * RX control handlers
@@ -927,13 +927,12 @@ static inline u16 get_duration_res(const unsigned int size, const u8 rate) }/** -* rt2x00queue_get_queue - Convert mac80211 queue index to rt2x00 queue +* rt2x00queue_get_queue - Convert queue index to queue pointer * @rt2x00dev: Pointer to &struct rt2x00_dev. -* @queue: mac80211/rt2x00 queue index -* (see &enum ieee80211_tx_queue and &enum rt2x00_bcn_queue). +* @queue: rt2x00 queue index (see &enum data_queue_qid). */ struct data_queue *rt2x00queue_get_queue (struct rt2x00_dev *rt2x00dev, -const unsigned int queue); +const enum data_queue_qid queue);/** * rt2x00queue_get_entry - Get queue entry where the given index points to.
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -2
@@ -685,8 +685,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 ==RT2X00_BCN_QUEUE_BEACON || -is_probe_resp (frame_control)) +if (txdesc.queue ==QID_BEACON ||is_probe_resp (frame_control))__set_bit (ENTRY_TXD_REQ_TIMESTAMP , &txdesc.flags);/*
drivers/net/wireless/rt2x00/rt2x00mac.c +6 -7
@@ -81,6 +81,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, {struct rt2x00_dev *rt2x00dev = hw->priv;struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data; +enum data_queue_qid qid =mac80211_queue_to_qid (control->queue);struct data_queue *queue;struct skb_frame_desc *skbdesc;u16 frame_control;
@@ -101,14 +102,13 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,*/ if (control->flags &IEEE80211_TXCTL_SEND_AFTER_DTIM &&test_bit (DRIVER_REQUIRE_ATIM_QUEUE , &rt2x00dev->flags)) - queue =rt2x00queue_get_queue (rt2x00dev,RT2X00_BCN_QUEUE_ATIM ); + queue =rt2x00queue_get_queue (rt2x00dev,QID_ATIM );else - queue =rt2x00queue_get_queue (rt2x00dev, control->queue); + queue =rt2x00queue_get_queue (rt2x00dev, qid);if (unlikely (!queue)) {ERROR (rt2x00dev,"Attempt to send packet over invalid queue %d.\n" -"Please file bug report to %s.\n" , - control->queue,DRV_PROJECT ); +"Please file bug report to %s.\n" , qid,DRV_PROJECT );dev_kfree_skb_any (skb);return NETDEV_TX_OK ; }
@@ -154,7 +154,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,ieee80211_stop_queue (rt2x00dev->hw, control->queue);if (rt2x00dev->ops->lib->kick_tx_queue) - rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev, control->queue); + rt2x00dev->ops->lib->kick_tx_queue (rt2x00dev, qid);return NETDEV_TX_OK ; }
@@ -187,8 +187,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,RT2X00_BCN_QUEUE_BEACON ); +struct data_queue *queue =rt2x00queue_get_queue (rt2x00dev,QID_BEACON );struct queue_entry *entry =NULL ;unsigned int i;
drivers/net/wireless/rt2x00/rt2x00pci.c +1 -1
@@ -53,7 +53,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,ERROR (rt2x00dev,"Arrived at non-free entry in the non-full queue %d.\n" "Please file bug report to %s.\n" , - control->queue,DRV_PROJECT ); + entry->queue->qid,DRV_PROJECT );return -EINVAL ; }
drivers/net/wireless/rt2x00/rt2x00queue.c +3 -3
@@ -30,7 +30,7 @@#include "rt2x00lib.h" struct data_queue *rt2x00queue_get_queue (struct rt2x00_dev *rt2x00dev, -const unsigned int queue) +const enum data_queue_qid 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 ==RT2X00_BCN_QUEUE_BEACON ) +if (queue ==QID_BEACON )return &rt2x00dev->bcn[0 ]; -else if (queue ==RT2X00_BCN_QUEUE_ATIM && atim) +else if (queue ==QID_ATIM && atim)return &rt2x00dev->bcn[1 ];return NULL ;
drivers/net/wireless/rt2x00/rt2x00queue.h +26 -14
@@ -54,6 +54,17 @@/** * enum data_queue_qid: Queue identification +* +* @QID_AC_BE: AC BE queue +* @QID_AC_BK: AC BK queue +* @QID_AC_VI: AC VI queue +* @QID_AC_VO: AC VO queue +* @QID_HCCA: HCCA queue +* @QID_MGMT: MGMT queue (prio queue) +* @QID_RX: RX queue +* @QID_OTHER: None of the above (don't use, only present for completeness) +* @QID_BEACON: Beacon queue (value unspecified, don't send it to device) +* @QID_ATIM: Atim queue (value unspeficied, don't send it to device) */ enum data_queue_qid {QID_AC_BE =0 ,
@@ -64,22 +75,25 @@ enum data_queue_qid {QID_MGMT =13 ,QID_RX =14 ,QID_OTHER =15 , +QID_BEACON , + QID_ATIM, };/** -* 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) +* mac80211_queue_to_qid - Convert mac80211 queue to rt2x00 qid +* @queue: mac80211 queue. */ -enum rt2x00_bcn_queue { -RT2X00_BCN_QUEUE_BEACON =100 , -RT2X00_BCN_QUEUE_ATIM =101 , -}; +static inline enum data_queue_qid mac80211_queue_to_qid (unsigned int queue) +{ +/* Regular TX queues are mapped directly */ +if (queue <NUM_TX_DATA_QUEUES ) +return queue; +else if (queue ==IEEE80211_TX_QUEUE_BEACON ) +return QID_BEACON ; +else if (queue ==IEEE80211_TX_QUEUE_AFTER_BEACON ) +return QID_ATIM ; +return QID_OTHER ; +}/** * enum skb_frame_desc_flags: Flags for &struct skb_frame_desc
@@ -105,7 +119,6 @@ enum skb_frame_desc_flags {* of the scope of the skb->data pointer. * @data_len: Length of the frame data. * @desc_len: Length of the frame descriptor. -* @entry: The entry to which this sk buffer belongs. */ struct skb_frame_desc {
@@ -240,7 +253,6 @@ struct txentry_desc {* encryption or decryption. The entry should only be touched after * the device has signaled it is done with it. */ -enum queue_entry_flags {ENTRY_BCN_ASSIGNED ,ENTRY_OWNER_DEVICE_DATA ,
drivers/net/wireless/rt2x00/rt2x00usb.c +1 -1
@@ -186,7 +186,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,ERROR (rt2x00dev,"Arrived at non-free entry in the non-full queue %d.\n" "Please file bug report to %s.\n" , - control->queue,DRV_PROJECT ); + entry->queue->qid,DRV_PROJECT );return -EINVAL ; }
drivers/net/wireless/rt2x00/rt61pci.c +8 -19
@@ -1591,11 +1591,11 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,* TX data initialization */ static void rt61pci_kick_tx_queue (struct rt2x00_dev *rt2x00dev, -const unsigned int queue) +const enum data_queue_qid queue) {u32 reg; -if (queue ==RT2X00_BCN_QUEUE_BEACON ) { +if (queue ==QID_BEACON ) {/* * For Wi-Fi faily generated beacons between participating * stations. Set TBTT phase adaptive adjustment step to 8us.
@@ -1613,14 +1613,10 @@ static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, }rt2x00pci_register_read (rt2x00dev,TX_CNTL_CSR , ®); -rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC0 , - (queue ==IEEE80211_TX_QUEUE_DATA0 )); -rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC1 , - (queue ==IEEE80211_TX_QUEUE_DATA1 )); -rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC2 , - (queue ==IEEE80211_TX_QUEUE_DATA2 )); -rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC3 , - (queue ==IEEE80211_TX_QUEUE_DATA3 )); +rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC0 , (queue ==QID_AC_BE )); +rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC1 , (queue ==QID_AC_BK )); +rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC2 , (queue ==QID_AC_VI )); +rt2x00_set_field32 (®,TX_CNTL_CSR_KICK_TX_AC3 , (queue ==QID_AC_VO ));rt2x00pci_register_write (rt2x00dev,TX_CNTL_CSR , reg); }
@@ -2412,21 +2408,14 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,rt2x00pci_register_write (rt2x00dev,TXRX_CSR9 , reg);/* -* 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); - -/* * Write entire beacon with descriptor to register, * and kick the beacon generator. */ +rt2x00lib_write_tx_desc (rt2x00dev, skb, control); beacon_base =HW_BEACON_OFFSET (intf->beacon->entry_idx);rt2x00pci_register_multiwrite (rt2x00dev, beacon_base, skb->data, skb->len); -rt61pci_kick_tx_queue (rt2x00dev, control->queue); +rt61pci_kick_tx_queue (rt2x00dev,QID_BEACON );return 0 ; }
drivers/net/wireless/rt2x00/rt73usb.c +4 -11
@@ -1331,11 +1331,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, -const unsigned int queue) +const enum data_queue_qid queue) {u32 reg; -if (queue !=RT2X00_BCN_QUEUE_BEACON ) +if (queue !=QID_BEACON )return ;/*
@@ -2001,23 +2001,16 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,rt73usb_register_write (rt2x00dev,TXRX_CSR9 , reg);/* -* 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); - -/* * Write entire beacon with descriptor to register, * and kick the beacon generator. */ +rt2x00lib_write_tx_desc (rt2x00dev, skb, control); beacon_base =HW_BEACON_OFFSET (intf->beacon->entry_idx); timeout =REGISTER_TIMEOUT * (skb->len /sizeof (u32));rt2x00usb_vendor_request (rt2x00dev,USB_MULTI_WRITE ,USB_VENDOR_REQUEST_OUT , beacon_base,0 , skb->data, skb->len, timeout); -rt73usb_kick_tx_queue (rt2x00dev, control->queue); +rt73usb_kick_tx_queue (rt2x00dev,QID_BEACON );return 0 ; }
Signature · 1 line
1.5.4.5
Johannes Berg
maintainerRe: [PATCH 4/9] rt2x00: Use rt2x00 queue numbering
Hi Ivo,
Quoted 7 lines · Ivo van Doorn
Use the rt2x00 queue enumeration as much as possible, removing the usage of the mac80211 queue numbering wherever it is possible.
This makes it easier for mac80211 to change it queue identification scheme without having to deal with big changes in the rt2x00 code.
Cool, thanks a lot. One small note:
drivers/net/wireless/rt2x00/rt2x00queue.h enum data_queue_qid { · line 95
Quoted 10 lines
drivers/net/wireless/rt2x00/rt2x00queue.h +10
-0+static inline enum data_queue_qid mac80211_queue_to_qid (unsigned int queue) +{ +/* Regular TX queues are mapped directly */ +if (queue <NUM_TX_DATA_QUEUES ) +return queue; +else if (queue ==IEEE80211_TX_QUEUE_BEACON ) +return QID_BEACON ; +else if (queue ==IEEE80211_TX_QUEUE_AFTER_BEACON ) +return QID_ATIM ; +return QID_OTHER ;
Are you actually using TX_QUEUE_AFTER_BEACON? That queue number is a historical accident (imho) and not used, we actually use the IEEE80211_TXCTL_SEND_AFTER_DTIM tx control flag.
Also, with the QoS patch, those queue numbers should finally go away and mac80211 will not pass anything but the data queues, hence, this small inline would probably be reduced to "return queue;" by the patch.
johannes
Re: [PATCH 4/9] rt2x00: Use rt2x00 queue numbering
Quoted 13 lines · Johannes Berg
Hi Ivo,
Quoted 7 lines · Ivo van Doorn
Use the rt2x00 queue enumeration as much as possible, removing the usage of the mac80211 queue numbering wherever it is possible.
This makes it easier for mac80211 to change it queue identification scheme without having to deal with big changes in the rt2x00 code.
Cool, thanks a lot. One small note:
Quoted 14 lines
drivers/net/wireless/rt2x00/rt2x00queue.h enum data_queue_qid { · line 95
Quoted 10 lines
drivers/net/wireless/rt2x00/rt2x00queue.h +10
-0+static inline enum data_queue_qid mac80211_queue_to_qid (unsigned int queue) +{ +/* Regular TX queues are mapped directly */ +if (queue <NUM_TX_DATA_QUEUES ) +return queue; +else if (queue ==IEEE80211_TX_QUEUE_BEACON ) +return QID_BEACON ; +else if (queue ==IEEE80211_TX_QUEUE_AFTER_BEACON ) +return QID_ATIM ; +return QID_OTHER ;Are you actually using
TX_QUEUE_AFTER_BEACON? That queue number is a historical accident (imho) and not used, we actually use theIEEE80211_TXCTL_SEND_AFTER_DTIMtx control flag.
Actually both the checks for IEEE80211_TX_QUEUE_BEACON and IEEE80211_TX_QUEUE_AFTER_BEACON are fake and only present for completeness.
rt2x00 does check for IEEE80211_TXCTL_SEND_AFTER_DTIM and will resolve it to QID_ATIM
if that queue is supported by the hardware (rt2400pci and rt2500pci) and resolves it to the control->queue in all other cases.
Quoted 3 lines
Also, with the QoS patch, those queue numbers should finally go away and mac80211 will not pass anything but the data queues, hence, this small inline would probably be reduced to "return queue;" by the patch.
This function only exists to move the translation in a single location. When the translation isn't needed anymore because skb_get_queue_mapping(skb) or something else is used, then this function can be removed completely. :)
Ivo
Re: [PATCH 4/9] rt2x00: Use rt2x00 queue numbering
Quoted 35 lines · Ivo van Doorn
Quoted 13 lines · Johannes Berg
Hi Ivo,
Quoted 7 lines · Ivo van Doorn
Use the rt2x00 queue enumeration as much as possible, removing the usage of the mac80211 queue numbering wherever it is possible.
This makes it easier for mac80211 to change it queue identification scheme without having to deal with big changes in the rt2x00 code.
Cool, thanks a lot. One small note:
Quoted 14 lines
drivers/net/wireless/rt2x00/rt2x00queue.h enum data_queue_qid { · line 95
Quoted 10 lines
drivers/net/wireless/rt2x00/rt2x00queue.h +10
-0+static inline enum data_queue_qid mac80211_queue_to_qid (unsigned int queue) +{ +/* Regular TX queues are mapped directly */ +if (queue <NUM_TX_DATA_QUEUES ) +return queue; +else if (queue ==IEEE80211_TX_QUEUE_BEACON ) +return QID_BEACON ; +else if (queue ==IEEE80211_TX_QUEUE_AFTER_BEACON ) +return QID_ATIM ; +return QID_OTHER ;Are you actually using
TX_QUEUE_AFTER_BEACON? That queue number is a historical accident (imho) and not used, we actually use theIEEE80211_TXCTL_SEND_AFTER_DTIMtx control flag.Actually both the checks for
IEEE80211_TX_QUEUE_BEACONandIEEE80211_TX_QUEUE_AFTER_BEACONare fake and only present for completeness.
rt2x00 does check forIEEE80211_TXCTL_SEND_AFTER_DTIMand will resolve it toQID_ATIM
if that queue is supported by the hardware (rt2400pci and rt2500pci) and resolves it to thecontrol->queuein all other cases.
Quoted 7 lines
Quoted 3 lines
Also, with the QoS patch, those queue numbers should finally go away and mac80211 will not pass anything but the data queues, hence, this small inline would probably be reduced to "return queue;" by the patch.
This function only exists to move the translation in a single location. When the translation isn't needed anymore because
skb_get_queue_mapping(skb)or something else is used, then this function can be removed completely. :)
Ps. Can I assume that skb_get_queue_mapping(skb) or whatever replacement for control->queue will make sure the given queue will not exceed the max number of supported queues as configured by the driver (through hw->queues)?
Or should the driver drop such packets or resolve it to the highest queue available?
Ivo
Johannes Berg
maintainerRe: [PATCH 4/9] rt2x00: Use rt2x00 queue numbering
Quoted 10 lines
Quoted 4 lines
This function only exists to move the translation in a single location. When the translation isn't needed anymore because
skb_get_queue_mapping(skb)or something else is used, then this function can be removed completely. :)Ps. Can I assume that
skb_get_queue_mapping(skb)or whatever replacement forcontrol->queuewill make sure the given queue will not exceed the max number of supported queues as configured by the driver (throughhw->queues)?Or should the driver drop such packets or resolve it to the highest queue available?
Well there are two cases.
(1) MQ is not configured -> it always returns 0
(2) MQ is configured, mac80211 will create a device with hw->queues queues, so it'll be in the range [0 .. hw->queues-1]
johannes
Re: [PATCH 4/9] rt2x00: Use rt2x00 queue numbering
Quoted 9 lines · Johannes Berg
Quoted 9 lines
Quoted 4 lines
This function only exists to move the translation in a single location. When the translation isn't needed anymore because
skb_get_queue_mapping(skb)or something else is used, then this function can be removed completely. :)Ps. Can I assume that
skb_get_queue_mapping(skb)or whatever replacement forcontrol->queuewill make sure the given queue will not exceed the max number of supported queues as configured by the driver (throughhw->queues)?
Quoted 7 lines
Quoted 1 line
Or should the driver drop such packets or resolve it to the highest queue available?
Well there are two cases.
(1) MQ is not configured -> it always returns 0
(2) MQ is configured, mac80211 will create a device withhw->queuesqueues, so it'll be in the range [0 .. hw->queues-1]
Excellent.
That means the same assumptions can be made about the queue parameter as with the old solution. :)
Ivo
PATCH 5/9 rt2x00: Fix quality/activity led handling
In reply to a message not in the archiveThere was an obvious typo in LED structure initialization which caused the radio and quality/activity leds to be incorrectly initialized which resulted in the leds not being enabled.
Additionally add the rt2x00led_led_activity() handler that will enable TX/RX activity leds when the radio is being enabled.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500usb.c | 2 +- drivers/net/wireless/rt2x00/rt2x00dev.c | 2 ++ drivers/net/wireless/rt2x00/rt2x00leds.c | 15 +++++++++++++++ drivers/net/wireless/rt2x00/rt2x00lib.h | 6 ++++++ drivers/net/wireless/rt2x00/rt61pci.c | 2 +- drivers/net/wireless/rt2x00/rt73usb.c | 2 +- 8 files changed, 28 insertions(+), 5 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +1 -1
@@ -1305,7 +1305,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)if (value ==LED_MODE_TXRX_ACTIVITY ) { rt2x00dev->led_qual.rt2x00dev = rt2x00dev; - rt2x00dev->led_radio.type =LED_TYPE_ACTIVITY ; + rt2x00dev->led_qual.type =LED_TYPE_ACTIVITY ; rt2x00dev->led_qual.led_dev.brightness_set = rt2400pci_brightness_set; rt2x00dev->led_qual.led_dev.blink_set =
drivers/net/wireless/rt2x00/rt2500pci.c +1 -1
@@ -1481,7 +1481,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)if (value ==LED_MODE_TXRX_ACTIVITY ) { rt2x00dev->led_qual.rt2x00dev = rt2x00dev; - rt2x00dev->led_radio.type =LED_TYPE_ACTIVITY ; + rt2x00dev->led_qual.type =LED_TYPE_ACTIVITY ; rt2x00dev->led_qual.led_dev.brightness_set = rt2500pci_brightness_set; rt2x00dev->led_qual.led_dev.blink_set =
drivers/net/wireless/rt2x00/rt2500usb.c +1 -1
@@ -1394,7 +1394,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)if (value ==LED_MODE_TXRX_ACTIVITY ) { rt2x00dev->led_qual.rt2x00dev = rt2x00dev; - rt2x00dev->led_radio.type =LED_TYPE_ACTIVITY ; + rt2x00dev->led_qual.type =LED_TYPE_ACTIVITY ; rt2x00dev->led_qual.led_dev.brightness_set = rt2500usb_brightness_set; rt2x00dev->led_qual.led_dev.blink_set =
drivers/net/wireless/rt2x00/rt2x00dev.c +2 -0
@@ -114,6 +114,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)return status;rt2x00leds_led_radio (rt2x00dev, true); +rt2x00led_led_activity (rt2x00dev, true);__set_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags);
@@ -157,6 +158,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)* Disable radio. */ rt2x00dev->ops->lib->set_device_state (rt2x00dev,STATE_RADIO_OFF ); +rt2x00led_led_activity (rt2x00dev, false);rt2x00leds_led_radio (rt2x00dev, false); }
drivers/net/wireless/rt2x00/rt2x00leds.c +15 -0
@@ -72,6 +72,21 @@ void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi) } } +void rt2x00led_led_activity (struct rt2x00_dev *rt2x00dev,bool enabled) +{ +struct rt2x00_led *led = &rt2x00dev->led_qual; +unsigned int brightness; + +if ((led->type !=LED_TYPE_ACTIVITY ) || !(led->flags &LED_REGISTERED )) +return ; + + brightness = enabled ?LED_FULL :LED_OFF ; +if (brightness != led->led_dev.brightness) { + led->led_dev.brightness_set (&led->led_dev, brightness); + led->led_dev.brightness = brightness; + } +} +void rt2x00leds_led_assoc (struct rt2x00_dev *rt2x00dev,bool enabled) {struct rt2x00_led *led = &rt2x00dev->led_assoc;
drivers/net/wireless/rt2x00/rt2x00lib.h +6 -0
@@ -185,6 +185,7 @@ static inline void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev)*/ #ifdef CONFIG_RT2X00_LIB_LEDS void rt2x00leds_led_quality (struct rt2x00_dev *rt2x00dev,int rssi); +void rt2x00led_led_activity (struct rt2x00_dev *rt2x00dev,bool enabled);void rt2x00leds_led_assoc (struct rt2x00_dev *rt2x00dev,bool enabled);void rt2x00leds_led_radio (struct rt2x00_dev *rt2x00dev,bool enabled);void rt2x00leds_register (struct rt2x00_dev *rt2x00dev);
@@ -197,6 +198,11 @@ static inline void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, { } +static inline void rt2x00led_led_activity (struct rt2x00_dev *rt2x00dev, +bool enabled) +{ +} +static inline void rt2x00leds_led_assoc (struct rt2x00_dev *rt2x00dev,bool enabled) {
drivers/net/wireless/rt2x00/rt61pci.c +1 -1
@@ -2083,7 +2083,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)if (value ==LED_MODE_SIGNAL_STRENGTH ) { rt2x00dev->led_qual.rt2x00dev = rt2x00dev; - rt2x00dev->led_radio.type =LED_TYPE_QUALITY ; + rt2x00dev->led_qual.type =LED_TYPE_QUALITY ; rt2x00dev->led_qual.led_dev.brightness_set = rt61pci_brightness_set; rt2x00dev->led_qual.led_dev.blink_set =
drivers/net/wireless/rt2x00/rt73usb.c +1 -1
@@ -1647,7 +1647,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)if (value ==LED_MODE_SIGNAL_STRENGTH ) { rt2x00dev->led_qual.rt2x00dev = rt2x00dev; - rt2x00dev->led_radio.type =LED_TYPE_QUALITY ; + rt2x00dev->led_qual.type =LED_TYPE_QUALITY ; rt2x00dev->led_qual.led_dev.brightness_set = rt73usb_brightness_set; rt2x00dev->led_qual.led_dev.blink_set =
Signature · 1 line
1.5.4.5
PATCH 6/9 rt2x00: Clarify supported chipsets in Kconfig
In reply to a message not in the archiveAs reported by Filipus Klutiero <[email protected]>, the rt2x00 Kconfig entries should be updated with specific chipset notifications.
This cleans up Kconfig by explicitly mentioning the supported chipsets for each drivers, and uses the same chipset family names as mentioned on the Ralink website.
--- drivers/net/wireless/rt2x00/Kconfig | 55 ++++++++++++++++++++-------------- 1 files changed, 32 insertions(+), 23 deletions(-)
drivers/net/wireless/rt2x00/Kconfig +32 -23
@@ -5,12 +5,16 @@ config RT2X00 This will enable the experimental support for the Ralink drivers, developed in the rt2x00 project <http://rt2x00.serialmonkey.com>. - These drivers will make use of the mac80211 stack. + These drivers make use of the mac80211 stack. When building one of the individual drivers, the rt2x00 library will also be created. That library (when the driver is built as a module) will be called "rt2x00lib.ko". + Additionally PCI and USB libraries will also be build depending + on the types of drivers being selected, these libraries will be + called "rt2x00pci.ko" and "rt2x00usb.ko". + if RT2X00 config RT2X00_LIB
@@ -40,114 +44,119 @@ config RT2X00_LIB_LEDS depends on RT2X00_LIB config RT2400PCI - tristate "Ralink rt2400 pci/pcmcia support" + tristate "Ralink rt2400 (PCI/PCMCIA) support" depends on PCI select RT2X00_LIB_PCI select EEPROM_93CX6 ---help--- - This is an experimental driver for the Ralink rt2400 wireless chip. + This adds support for rt2400 wireless chipset family. + Supported chips: RT2460. When compiled as a module, this driver will be called "rt2400pci.ko". config RT2400PCI_RFKILL - bool "RT2400 rfkill support" + bool "Ralink rt2400 rfkill support" depends on RT2400PCI select RT2X00_LIB_RFKILL ---help--- - This adds support for integrated rt2400 devices that feature a + This adds support for integrated rt2400 hardware that features a hardware button to control the radio state. This feature depends on the RF switch subsystem rfkill. config RT2400PCI_LEDS - bool "RT2400 leds support" + bool "Ralink rt2400 leds support" depends on RT2400PCI && LEDS_CLASS select RT2X00_LIB_LEDS ---help--- This adds support for led triggers provided my mac80211. config RT2500PCI - tristate "Ralink rt2500 pci/pcmcia support" + tristate "Ralink rt2500 (PCI/PCMCIA) support" depends on PCI select RT2X00_LIB_PCI select EEPROM_93CX6 ---help--- - This is an experimental driver for the Ralink rt2500 wireless chip. + This adds support for rt2500 wireless chipset family. + Supported chips: RT2560. When compiled as a module, this driver will be called "rt2500pci.ko". config RT2500PCI_RFKILL - bool "RT2500 rfkill support" + bool "Ralink rt2500 rfkill support" depends on RT2500PCI select RT2X00_LIB_RFKILL ---help--- - This adds support for integrated rt2500 devices that feature a + This adds support for integrated rt2500 hardware that features a hardware button to control the radio state. This feature depends on the RF switch subsystem rfkill. config RT2500PCI_LEDS - bool "RT2500 leds support" + bool "Ralink rt2500 leds support" depends on RT2500PCI && LEDS_CLASS select RT2X00_LIB_LEDS ---help--- This adds support for led triggers provided my mac80211. config RT61PCI - tristate "Ralink rt61 pci/pcmcia support" + tristate "Ralink rt2501/rt61 (PCI/PCMCIA) support" depends on PCI select RT2X00_LIB_PCI select RT2X00_LIB_FIRMWARE select CRC_ITU_T select EEPROM_93CX6 ---help--- - This is an experimental driver for the Ralink rt61 wireless chip. + This adds support for rt2501 wireless chipset family. + Supported chips: RT2561, RT2561S & RT2661. When compiled as a module, this driver will be called "rt61pci.ko". config RT61PCI_RFKILL - bool "RT61 rfkill support" + bool "Ralink rt2501/rt61 rfkill support" depends on RT61PCI select RT2X00_LIB_RFKILL ---help--- - This adds support for integrated rt61 devices that feature a + This adds support for integrated rt61 hardware that features a hardware button to control the radio state. This feature depends on the RF switch subsystem rfkill. config RT61PCI_LEDS - bool "RT61 leds support" + bool "Ralink rt2501/rt61 leds support" depends on RT61PCI && LEDS_CLASS select RT2X00_LIB_LEDS ---help--- This adds support for led triggers provided my mac80211. config RT2500USB - tristate "Ralink rt2500 usb support" + tristate "Ralink rt2500 (USB) support" depends on USB select RT2X00_LIB_USB ---help--- - This is an experimental driver for the Ralink rt2500 wireless chip. + This adds support for rt2500 wireless chipset family. + Supported chips: RT2571 & RT2572. When compiled as a module, this driver will be called "rt2500usb.ko". config RT2500USB_LEDS - bool "RT2500 leds support" + bool "Ralink rt2500 leds support" depends on RT2500USB && LEDS_CLASS select RT2X00_LIB_LEDS ---help--- This adds support for led triggers provided my mac80211. config RT73USB - tristate "Ralink rt73 usb support" + tristate "Ralink rt2501/rt73 (USB) support" depends on USB select RT2X00_LIB_USB select RT2X00_LIB_FIRMWARE select CRC_ITU_T ---help--- - This is an experimental driver for the Ralink rt73 wireless chip. + This adds support for rt2501 wireless chipset family. + Supported chips: RT2571W, RT2573 & RT2671. When compiled as a module, this driver will be called "rt73usb.ko". config RT73USB_LEDS - bool "RT73 leds support" + bool "Ralink rt2501/rt73 leds support" depends on RT73USB && LEDS_CLASS select RT2X00_LIB_LEDS ---help---
@@ -159,7 +168,7 @@ config RT2X00_LIB_DEBUGFS ---help--- Enable creation of debugfs files for the rt2x00 drivers. These debugfs files support both reading and writing of the - most important register types of the rt2x00 devices. + most important register types of the rt2x00 hardware. config RT2X00_DEBUG bool "Ralink debug output"
Signature · 1 line
1.5.4.5
PATCH 7/9 rt2x00: Add helper macros
In reply to a message not in the archiveAdd some helper macro's to help determining the
the timeout for USB register access.
--- drivers/net/wireless/rt2x00/rt2500usb.c | 8 ++++---- drivers/net/wireless/rt2x00/rt2x00usb.c | 2 +- drivers/net/wireless/rt2x00/rt2x00usb.h | 19 ++++++++++++++++--- drivers/net/wireless/rt2x00/rt73usb.c | 18 ++++++++---------- 4 files changed, 29 insertions(+), 18 deletions(-)
drivers/net/wireless/rt2x00/rt2500usb.c +4 -4
@@ -76,10 +76,10 @@ static inline void rt2500usb_register_multiread(struct rt2x00_dev *rt2x00dev,const unsigned int offset, void *value, const u16 length) { - int timeout = REGISTER_TIMEOUT * (length / sizeof(u16));rt2x00usb_vendor_request_buff (rt2x00dev ,USB_MULTI_READ ,USB_VENDOR_REQUEST_IN ,offset , - value, length, timeout); +value ,length , +REGISTER_TIMEOUT16 (length )); } static inline void rt2500usb_register_write(struct rt2x00_dev *rt2x00dev,
@@ -106,10 +106,10 @@ static inline void rt2500usb_register_multiwrite(struct rt2x00_dev *rt2x00dev,const unsigned int offset, void *value, const u16 length) { - int timeout = REGISTER_TIMEOUT * (length / sizeof(u16));rt2x00usb_vendor_request_buff (rt2x00dev ,USB_MULTI_WRITE ,USB_VENDOR_REQUEST_OUT ,offset , - value, length, timeout); +value ,length , +REGISTER_TIMEOUT16 (length )); }static u16 rt2500usb_bbp_check (struct rt2x00_dev *rt2x00dev)
drivers/net/wireless/rt2x00/rt2x00usb.c +1 -1
@@ -344,7 +344,7 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)struct data_queue *queue;unsigned int i; -rt2x00usb_vendor_request_sw (rt2x00dev,USB_RX_CONTROL ,0x0000 ,0x0000 , +rt2x00usb_vendor_request_sw (rt2x00dev,USB_RX_CONTROL ,0 ,0 ,REGISTER_TIMEOUT );/*
drivers/net/wireless/rt2x00/rt2x00usb.h +16 -3
@@ -47,6 +47,20 @@#define REGISTER_TIMEOUT 500#define REGISTER_TIMEOUT_FIRMWARE 1000 +/** +* REGISTER_TIMEOUT16 - Determine the timeout for 16bit register access +* @__datalen: Data length +*/ +#define REGISTER_TIMEOUT16 (__datalen) \ + ( REGISTER_TIMEOUT * ((__datalen) / sizeof(u16)) ) + +/** +* REGISTER_TIMEOUT32 - Determine the timeout for 32bit register access +* @__datalen: Data length +*/ +#define REGISTER_TIMEOUT32 (__datalen) \ + ( REGISTER_TIMEOUT * ((__datalen) / sizeof(u32)) ) +/* * Cache size */
@@ -187,11 +201,10 @@ static inline int rt2x00usb_vendor_request_sw(struct rt2x00_dev *rt2x00dev,static inline int rt2x00usb_eeprom_read (struct rt2x00_dev *rt2x00dev,__le16 *eeprom,const u16 lenght) { -int timeout =REGISTER_TIMEOUT * (lenght /sizeof (u16)); -return rt2x00usb_vendor_request (rt2x00dev,USB_EEPROM_READ ,USB_VENDOR_REQUEST_IN ,0 ,0 , - eeprom, lenght, timeout); + eeprom, lenght, +REGISTER_TIMEOUT16 (lenght)); }/*
drivers/net/wireless/rt2x00/rt73usb.c +8 -10
@@ -74,10 +74,10 @@ static inline void rt73usb_register_multiread(struct rt2x00_dev *rt2x00dev,const unsigned int offset, void *value, const u32 length) { - int timeout = REGISTER_TIMEOUT * (length / sizeof(u32));rt2x00usb_vendor_request_buff (rt2x00dev ,USB_MULTI_READ ,USB_VENDOR_REQUEST_IN ,offset , - value, length, timeout); +value ,length , +REGISTER_TIMEOUT32 (length )); } static inline void rt73usb_register_write(struct rt2x00_dev *rt2x00dev,
@@ -102,10 +102,10 @@ static inline void rt73usb_register_multiwrite(struct rt2x00_dev *rt2x00dev,const unsigned int offset, void *value, const u32 length) { - int timeout = REGISTER_TIMEOUT * (length / sizeof(u32));rt2x00usb_vendor_request_buff (rt2x00dev ,USB_MULTI_WRITE ,USB_VENDOR_REQUEST_OUT ,offset , - value, length, timeout); +value ,length , +REGISTER_TIMEOUT32 (length )); }static u32 rt73usb_bbp_check (struct rt2x00_dev *rt2x00dev)
@@ -876,7 +876,6 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, void *data,char *ptr = data;char *cache;int buflen; -int timeout;/* * Wait for stable hardware.
@@ -907,14 +906,14 @@ static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, void *data,for (i =0 ; i < len; i +=CSR_CACHE_SIZE_FIRMWARE ) { buflen =min_t (int, len - i,CSR_CACHE_SIZE_FIRMWARE ); - timeout =REGISTER_TIMEOUT * (buflen /sizeof (u32));memcpy (cache, ptr, buflen);rt2x00usb_vendor_request (rt2x00dev,USB_MULTI_WRITE ,USB_VENDOR_REQUEST_OUT ,FIRMWARE_IMAGE_BASE + i,0 , - cache, buflen, timeout); + cache, buflen, +REGISTER_TIMEOUT32 (buflen)); ptr += buflen; }
@@ -1966,7 +1965,6 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,struct rt2x00_intf *intf =vif_to_intf (control->vif);struct skb_frame_desc *skbdesc;unsigned int beacon_base; -unsigned int timeout;u32 reg;if (unlikely (!intf->beacon))
@@ -2006,10 +2004,10 @@ static int rt73usb_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,*/ rt2x00lib_write_tx_desc (rt2x00dev, skb, control); beacon_base =HW_BEACON_OFFSET (intf->beacon->entry_idx); - timeout =REGISTER_TIMEOUT * (skb->len /sizeof (u32));rt2x00usb_vendor_request (rt2x00dev,USB_MULTI_WRITE ,USB_VENDOR_REQUEST_OUT , beacon_base,0 , - skb->data, skb->len, timeout); + skb->data, skb->len, +REGISTER_TIMEOUT32 (skb->len));rt73usb_kick_tx_queue (rt2x00dev,QID_BEACON );return 0 ;
Signature · 1 line
1.5.4.5
PATCH 8/9 rt2x00: Fix kernel-doc
In reply to a message not in the archiveAdd missing kernel-doc variables for structures/functions.
--- drivers/net/wireless/rt2x00/rt2x00.h | 6 +++--- drivers/net/wireless/rt2x00/rt2x00pci.h | 6 ++++-- drivers/net/wireless/rt2x00/rt2x00usb.h | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +3 -3
@@ -404,7 +404,7 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)* @supported_rates: Rate types which are supported (CCK, OFDM). * @num_channels: Number of supported channels. This is used as array size * for @tx_power_a, @tx_power_bg and @channels. -* channels: Device/chipset specific channel values (See &struct rf_channel). +* @channels: Device/chipset specific channel values (See &struct rf_channel). * @tx_power_a: TX power values for all 5.2GHz channels (may be NULL). * @tx_power_bg: TX power values for all 2.4GHz channels (may be NULL). * @tx_power_default: Default TX power value to use when either
@@ -936,7 +936,7 @@ struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,/** * rt2x00queue_get_entry - Get queue entry where the given index points to. -* @rt2x00dev: Pointer to &struct rt2x00_dev. +* @queue: Pointer to &struct data_queue from where we obtain the entry. * @index: Index identifier for obtaining the correct index. */ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
@@ -945,7 +945,7 @@ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,/** * rt2x00queue_index_inc - Index incrementation function * @queue: Queue (&struct data_queue) to perform the action on. -* @action: Index type (&enum queue_index) to perform the action on. +* @index: Index type (&enum queue_index) to perform the action on. * * This function will increase the requested index on the queue, * it will grab the appropriate locks and handle queue overflow events by
drivers/net/wireless/rt2x00/rt2x00pci.h +4 -2
@@ -98,8 +98,9 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,* struct queue_entry_priv_pci_rx: Per RX entry PCI specific information * * @desc: Pointer to device descriptor. +* @desc_dma: DMA pointer to @desc. * @data: Pointer to device's entry memory. -* @dma: DMA pointer to &data. +* @data_dma: DMA pointer to &data. */ struct queue_entry_priv_pci_rx {__le32 *desc;
@@ -113,8 +114,9 @@ struct queue_entry_priv_pci_rx {* struct queue_entry_priv_pci_tx: Per TX entry PCI specific information * * @desc: Pointer to device descriptor +* @desc_dma: DMA pointer to @desc. * @data: Pointer to device's entry memory. -* @dma: DMA pointer to &data. +* @data_dma: DMA pointer to &data. * @control: mac80211 control structure used to transmit data. */ struct queue_entry_priv_pci_tx {
drivers/net/wireless/rt2x00/rt2x00usb.h +3 -3
@@ -199,12 +199,12 @@ static inline int rt2x00usb_vendor_request_sw(struct rt2x00_dev *rt2x00dev,* kmalloc for correct handling inside the kernel USB layer. */ static inline int rt2x00usb_eeprom_read (struct rt2x00_dev *rt2x00dev, -__le16 *eeprom,const u16 lenght) +__le16 *eeprom,const u16 length) {return rt2x00usb_vendor_request (rt2x00dev,USB_EEPROM_READ ,USB_VENDOR_REQUEST_IN ,0 ,0 , - eeprom, lenght, -REGISTER_TIMEOUT16 (lenght)); + eeprom, length, +REGISTER_TIMEOUT16 (length)); }/*
Signature · 1 line
1.5.4.5
PATCH 9/9 rt2x00: Release rt2x00 2.1.5
In reply to a message not in the archive--- drivers/net/wireless/rt2x00/rt2x00.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +1 -1
@@ -44,7 +44,7 @@/* * Module information. */ -#define DRV_VERSION "2.1.4" +#define DRV_VERSION "2.1.5"#define DRV_PROJECT "http://rt2x00.serialmonkey.com"/*
Signature · 1 line
1.5.4.5