aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00pci.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-02-03 09:49:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:28 -0500
commit6bb40dd13b458beb55f5c60dba1cb28e814bd640 (patch)
tree9b2aaa0de4a4d72a7afc3550b08572083b111c57 /drivers/net/wireless/rt2x00/rt2x00pci.c
parent9404ef34e4747228717d6e22ce3827ed366ccf41 (diff)
rt2x00: Add per-interface structure
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. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 63cfe33e95d..764147dd5ae 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -38,20 +38,14 @@ int rt2x00pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
38 struct ieee80211_tx_control *control) 38 struct ieee80211_tx_control *control)
39{ 39{
40 struct rt2x00_dev *rt2x00dev = hw->priv; 40 struct rt2x00_dev *rt2x00dev = hw->priv;
41 struct rt2x00_intf *intf = vif_to_intf(control->vif);
41 struct queue_entry_priv_pci_tx *priv_tx; 42 struct queue_entry_priv_pci_tx *priv_tx;
42 struct skb_frame_desc *skbdesc; 43 struct skb_frame_desc *skbdesc;
43 struct data_queue *queue;
44 struct queue_entry *entry;
45 44
46 /* 45 if (unlikely(!intf->beacon))
47 * Just in case mac80211 doesn't set this correctly, 46 return -ENOBUFS;
48 * but we need this queue set for the descriptor 47
49 * initialization. 48 priv_tx = intf->beacon->priv_data;
50 */
51 control->queue = IEEE80211_TX_QUEUE_BEACON;
52 queue = rt2x00queue_get_queue(rt2x00dev, control->queue);
53 entry = rt2x00queue_get_entry(queue, Q_INDEX);
54 priv_tx = entry->priv_data;
55 49
56 /* 50 /*
57 * Fill in skb descriptor 51 * Fill in skb descriptor
@@ -59,17 +53,25 @@ int rt2x00pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
59 skbdesc = get_skb_frame_desc(skb); 53 skbdesc = get_skb_frame_desc(skb);
60 memset(skbdesc, 0, sizeof(*skbdesc)); 54 memset(skbdesc, 0, sizeof(*skbdesc));
61 skbdesc->data = skb->data; 55 skbdesc->data = skb->data;
62 skbdesc->data_len = queue->data_size; 56 skbdesc->data_len = skb->len;
63 skbdesc->desc = priv_tx->desc; 57 skbdesc->desc = priv_tx->desc;
64 skbdesc->desc_len = queue->desc_size; 58 skbdesc->desc_len = intf->beacon->queue->desc_size;
65 skbdesc->entry = entry; 59 skbdesc->entry = intf->beacon;
66 60
67 memcpy(priv_tx->data, skb->data, skb->len); 61 /*
62 * Just in case mac80211 doesn't set this correctly,
63 * but we need this queue set for the descriptor
64 * initialization.
65 */
66 control->queue = IEEE80211_TX_QUEUE_BEACON;
68 rt2x00lib_write_tx_desc(rt2x00dev, skb, control); 67 rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
69 68
70 /* 69 /*
71 * Enable beacon generation. 70 * Enable beacon generation.
71 * Write entire beacon with descriptor to register,
72 * and kick the beacon generator.
72 */ 73 */
74 memcpy(priv_tx->data, skb->data, skb->len);
73 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue); 75 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);
74 76
75 return 0; 77 return 0;