diff options
author | Arik Nemtsov <arik@wizery.com> | 2010-10-16 14:27:53 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-01-24 15:11:50 -0500 |
commit | c6c8a65de6d3aa8daa93beeac390f49a21d0be36 (patch) | |
tree | c5acea628c7de5c01a2d3db3cc5ab0a9c341f279 /drivers/net/wireless/wl12xx/tx.c | |
parent | f84f7d78bbfbbb17faa64bcca5799865074e1e7b (diff) |
wl12xx: AP mode - changes in TX path
When in AP mode set appropriate HLID and rate policy for each skb.
Respond to supported-rates related changes in op_tx only when acting
as STA.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/tx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/tx.c | 55 |
1 files changed, 46 insertions, 9 deletions
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index a93fc4702f35..3245c240cbdd 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/etherdevice.h> | ||
26 | 27 | ||
27 | #include "wl12xx.h" | 28 | #include "wl12xx.h" |
28 | #include "io.h" | 29 | #include "io.h" |
@@ -99,7 +100,7 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
99 | { | 100 | { |
100 | struct timespec ts; | 101 | struct timespec ts; |
101 | struct wl1271_tx_hw_descr *desc; | 102 | struct wl1271_tx_hw_descr *desc; |
102 | int pad, ac; | 103 | int pad, ac, rate_idx; |
103 | s64 hosttime; | 104 | s64 hosttime; |
104 | u16 tx_attr; | 105 | u16 tx_attr; |
105 | 106 | ||
@@ -117,7 +118,11 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
117 | getnstimeofday(&ts); | 118 | getnstimeofday(&ts); |
118 | hosttime = (timespec_to_ns(&ts) >> 10); | 119 | hosttime = (timespec_to_ns(&ts) >> 10); |
119 | desc->start_time = cpu_to_le32(hosttime - wl->time_offset); | 120 | desc->start_time = cpu_to_le32(hosttime - wl->time_offset); |
120 | desc->life_time = cpu_to_le16(TX_HW_MGMT_PKT_LIFETIME_TU); | 121 | |
122 | if (wl->bss_type != BSS_TYPE_AP_BSS) | ||
123 | desc->life_time = cpu_to_le16(TX_HW_MGMT_PKT_LIFETIME_TU); | ||
124 | else | ||
125 | desc->life_time = cpu_to_le16(TX_HW_AP_MODE_PKT_LIFETIME_TU); | ||
121 | 126 | ||
122 | /* configure the tx attributes */ | 127 | /* configure the tx attributes */ |
123 | tx_attr = wl->session_counter << TX_HW_ATTR_OFST_SESSION_COUNTER; | 128 | tx_attr = wl->session_counter << TX_HW_ATTR_OFST_SESSION_COUNTER; |
@@ -125,7 +130,41 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
125 | /* queue (we use same identifiers for tid's and ac's */ | 130 | /* queue (we use same identifiers for tid's and ac's */ |
126 | ac = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); | 131 | ac = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); |
127 | desc->tid = ac; | 132 | desc->tid = ac; |
128 | desc->aid = TX_HW_DEFAULT_AID; | 133 | |
134 | if (wl->bss_type != BSS_TYPE_AP_BSS) { | ||
135 | desc->aid = TX_HW_DEFAULT_AID; | ||
136 | |||
137 | /* if the packets are destined for AP (have a STA entry) | ||
138 | send them with AP rate policies, otherwise use default | ||
139 | basic rates */ | ||
140 | if (control->control.sta) | ||
141 | rate_idx = ACX_TX_AP_FULL_RATE; | ||
142 | else | ||
143 | rate_idx = ACX_TX_BASIC_RATE; | ||
144 | } else { | ||
145 | if (control->control.sta) { | ||
146 | struct wl1271_station *wl_sta; | ||
147 | |||
148 | wl_sta = (struct wl1271_station *) | ||
149 | control->control.sta->drv_priv; | ||
150 | desc->hlid = wl_sta->hlid; | ||
151 | rate_idx = ac; | ||
152 | } else { | ||
153 | struct ieee80211_hdr *hdr; | ||
154 | |||
155 | hdr = (struct ieee80211_hdr *) | ||
156 | (skb->data + sizeof(*desc)); | ||
157 | if (ieee80211_is_mgmt(hdr->frame_control)) { | ||
158 | desc->hlid = WL1271_AP_GLOBAL_HLID; | ||
159 | rate_idx = ACX_TX_AP_MODE_MGMT_RATE; | ||
160 | } else { | ||
161 | desc->hlid = WL1271_AP_BROADCAST_HLID; | ||
162 | rate_idx = ACX_TX_AP_MODE_BCST_RATE; | ||
163 | } | ||
164 | } | ||
165 | } | ||
166 | |||
167 | tx_attr |= rate_idx << TX_HW_ATTR_OFST_RATE_POLICY; | ||
129 | desc->reserved = 0; | 168 | desc->reserved = 0; |
130 | 169 | ||
131 | /* align the length (and store in terms of words) */ | 170 | /* align the length (and store in terms of words) */ |
@@ -136,14 +175,12 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
136 | pad = pad - skb->len; | 175 | pad = pad - skb->len; |
137 | tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD; | 176 | tx_attr |= pad << TX_HW_ATTR_OFST_LAST_WORD_PAD; |
138 | 177 | ||
139 | /* if the packets are destined for AP (have a STA entry) send them | ||
140 | with AP rate policies, otherwise use default basic rates */ | ||
141 | if (control->control.sta) | ||
142 | tx_attr |= ACX_TX_AP_FULL_RATE << TX_HW_ATTR_OFST_RATE_POLICY; | ||
143 | |||
144 | desc->tx_attr = cpu_to_le16(tx_attr); | 178 | desc->tx_attr = cpu_to_le16(tx_attr); |
145 | 179 | ||
146 | wl1271_debug(DEBUG_TX, "tx_fill_hdr: pad: %d", pad); | 180 | wl1271_debug(DEBUG_TX, "tx_fill_hdr: pad: %d hlid: %d " |
181 | "tx_attr: 0x%x len: %d life: %d mem: %d", pad, (int)desc->hlid, | ||
182 | (int)desc->tx_attr, (int)desc->length, (int)desc->life_time, | ||
183 | (int)desc->total_mem_blocks); | ||
147 | } | 184 | } |
148 | 185 | ||
149 | /* caller must hold wl->mutex */ | 186 | /* caller must hold wl->mutex */ |