diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2013-06-11 09:49:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-11 12:48:10 -0400 |
commit | 8b3e7be437a6b62118d0485ad971e724afe23fdf (patch) | |
tree | 838f38708943931553d50eb2261586645a632d28 /drivers/net | |
parent | 19db577868e94c80dc9a569d937109f95c34d0f4 (diff) |
cw1200: Fix an assorted pile of checkpatch warnings.
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/cw1200/bh.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/cw1200.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/cw1200_sdio.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/cw1200_spi.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/hwio.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/sta.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/txrx.c | 43 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/wsm.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/cw1200/wsm.h | 55 |
9 files changed, 80 insertions, 75 deletions
diff --git a/drivers/net/wireless/cw1200/bh.c b/drivers/net/wireless/cw1200/bh.c index 324b57001da0..c1ec2a4dd8c0 100644 --- a/drivers/net/wireless/cw1200/bh.c +++ b/drivers/net/wireless/cw1200/bh.c | |||
@@ -31,7 +31,8 @@ static int cw1200_bh(void *arg); | |||
31 | 31 | ||
32 | #define DOWNLOAD_BLOCK_SIZE_WR (0x1000 - 4) | 32 | #define DOWNLOAD_BLOCK_SIZE_WR (0x1000 - 4) |
33 | /* an SPI message cannot be bigger than (2"12-1)*2 bytes | 33 | /* an SPI message cannot be bigger than (2"12-1)*2 bytes |
34 | * "*2" to cvt to bytes */ | 34 | * "*2" to cvt to bytes |
35 | */ | ||
35 | #define MAX_SZ_RD_WR_BUFFERS (DOWNLOAD_BLOCK_SIZE_WR*2) | 36 | #define MAX_SZ_RD_WR_BUFFERS (DOWNLOAD_BLOCK_SIZE_WR*2) |
36 | #define PIGGYBACK_CTRL_REG (2) | 37 | #define PIGGYBACK_CTRL_REG (2) |
37 | #define EFFECTIVE_BUF_SIZE (MAX_SZ_RD_WR_BUFFERS - PIGGYBACK_CTRL_REG) | 38 | #define EFFECTIVE_BUF_SIZE (MAX_SZ_RD_WR_BUFFERS - PIGGYBACK_CTRL_REG) |
@@ -217,7 +218,8 @@ static int cw1200_device_wakeup(struct cw1200_common *priv) | |||
217 | return ret; | 218 | return ret; |
218 | 219 | ||
219 | /* If the device returns WLAN_RDY as 1, the device is active and will | 220 | /* If the device returns WLAN_RDY as 1, the device is active and will |
220 | * remain active. */ | 221 | * remain active. |
222 | */ | ||
221 | if (ctrl_reg & ST90TDS_CONT_RDY_BIT) { | 223 | if (ctrl_reg & ST90TDS_CONT_RDY_BIT) { |
222 | pr_debug("[BH] Device awake.\n"); | 224 | pr_debug("[BH] Device awake.\n"); |
223 | return 1; | 225 | return 1; |
@@ -262,7 +264,8 @@ static int cw1200_bh_rx_helper(struct cw1200_common *priv, | |||
262 | } | 264 | } |
263 | 265 | ||
264 | /* Add SIZE of PIGGYBACK reg (CONTROL Reg) | 266 | /* Add SIZE of PIGGYBACK reg (CONTROL Reg) |
265 | * to the NEXT Message length + 2 Bytes for SKB */ | 267 | * to the NEXT Message length + 2 Bytes for SKB |
268 | */ | ||
266 | read_len = read_len + 2; | 269 | read_len = read_len + 2; |
267 | 270 | ||
268 | alloc_len = priv->hwbus_ops->align_size( | 271 | alloc_len = priv->hwbus_ops->align_size( |
diff --git a/drivers/net/wireless/cw1200/cw1200.h b/drivers/net/wireless/cw1200/cw1200.h index 91ff7f19c4f0..243e96353d13 100644 --- a/drivers/net/wireless/cw1200/cw1200.h +++ b/drivers/net/wireless/cw1200/cw1200.h | |||
@@ -207,7 +207,8 @@ struct cw1200_common { | |||
207 | /* Scan status */ | 207 | /* Scan status */ |
208 | struct cw1200_scan scan; | 208 | struct cw1200_scan scan; |
209 | /* Keep cw1200 awake (WUP = 1) 1 second after each scan to avoid | 209 | /* Keep cw1200 awake (WUP = 1) 1 second after each scan to avoid |
210 | * FW issue with sleeping/waking up. */ | 210 | * FW issue with sleeping/waking up. |
211 | */ | ||
211 | atomic_t recent_scan; | 212 | atomic_t recent_scan; |
212 | struct delayed_work clear_recent_scan_work; | 213 | struct delayed_work clear_recent_scan_work; |
213 | 214 | ||
diff --git a/drivers/net/wireless/cw1200/cw1200_sdio.c b/drivers/net/wireless/cw1200/cw1200_sdio.c index bb1f405315e4..ebdcdf44f155 100644 --- a/drivers/net/wireless/cw1200/cw1200_sdio.c +++ b/drivers/net/wireless/cw1200/cw1200_sdio.c | |||
@@ -323,7 +323,8 @@ static int cw1200_sdio_probe(struct sdio_func *func, | |||
323 | } | 323 | } |
324 | 324 | ||
325 | /* Disconnect Function to be called by SDIO stack when | 325 | /* Disconnect Function to be called by SDIO stack when |
326 | * device is disconnected */ | 326 | * device is disconnected |
327 | */ | ||
327 | static void cw1200_sdio_disconnect(struct sdio_func *func) | 328 | static void cw1200_sdio_disconnect(struct sdio_func *func) |
328 | { | 329 | { |
329 | struct hwbus_priv *self = sdio_get_drvdata(func); | 330 | struct hwbus_priv *self = sdio_get_drvdata(func); |
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index e58f0a5bafa9..953bd1904d3d 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
@@ -47,15 +47,13 @@ struct hwbus_priv { | |||
47 | #define SET_WRITE 0x7FFF /* usage: and operation */ | 47 | #define SET_WRITE 0x7FFF /* usage: and operation */ |
48 | #define SET_READ 0x8000 /* usage: or operation */ | 48 | #define SET_READ 0x8000 /* usage: or operation */ |
49 | 49 | ||
50 | /* | 50 | /* Notes on byte ordering: |
51 | Notes on byte ordering: | ||
52 | LE: B0 B1 B2 B3 | 51 | LE: B0 B1 B2 B3 |
53 | BE: B3 B2 B1 B0 | 52 | BE: B3 B2 B1 B0 |
54 | 53 | ||
55 | Hardware expects 32-bit data to be written as 16-bit BE words: | 54 | Hardware expects 32-bit data to be written as 16-bit BE words: |
56 | 55 | ||
57 | B1 B0 B3 B2 | 56 | B1 B0 B3 B2 |
58 | |||
59 | */ | 57 | */ |
60 | 58 | ||
61 | static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self, | 59 | static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self, |
diff --git a/drivers/net/wireless/cw1200/hwio.h b/drivers/net/wireless/cw1200/hwio.h index 7ee73fe32ccf..563329cfead6 100644 --- a/drivers/net/wireless/cw1200/hwio.h +++ b/drivers/net/wireless/cw1200/hwio.h | |||
@@ -97,9 +97,8 @@ struct download_cntl_t { | |||
97 | 97 | ||
98 | #define CW1200_APB(addr) (PAC_SHARED_MEMORY_SILICON + (addr)) | 98 | #define CW1200_APB(addr) (PAC_SHARED_MEMORY_SILICON + (addr)) |
99 | 99 | ||
100 | /* *************************************************************** | 100 | /* Device register definitions */ |
101 | *Device register definitions | 101 | |
102 | *************************************************************** */ | ||
103 | /* WBF - SPI Register Addresses */ | 102 | /* WBF - SPI Register Addresses */ |
104 | #define ST90TDS_ADDR_ID_BASE (0x0000) | 103 | #define ST90TDS_ADDR_ID_BASE (0x0000) |
105 | /* 16/32 bits */ | 104 | /* 16/32 bits */ |
diff --git a/drivers/net/wireless/cw1200/sta.c b/drivers/net/wireless/cw1200/sta.c index 679c55f15c67..4cd0352b508d 100644 --- a/drivers/net/wireless/cw1200/sta.c +++ b/drivers/net/wireless/cw1200/sta.c | |||
@@ -483,15 +483,14 @@ void cw1200_update_filtering(struct cw1200_common *priv) | |||
483 | bf_tbl.num = __cpu_to_le32(3); | 483 | bf_tbl.num = __cpu_to_le32(3); |
484 | } | 484 | } |
485 | 485 | ||
486 | /* | 486 | /* When acting as p2p client being connected to p2p GO, in order to |
487 | * When acting as p2p client being connected to p2p GO, in order to | 487 | * receive frames from a different p2p device, turn off bssid filter. |
488 | * receive frames from a different p2p device, turn off bssid filter. | 488 | * |
489 | * | 489 | * WARNING: FW dependency! |
490 | * WARNING: FW dependency! | 490 | * This can only be used with FW WSM371 and its successors. |
491 | * This can only be used with FW WSM371 and its successors. | 491 | * In that FW version even with bssid filter turned off, |
492 | * In that FW version even with bssid filter turned off, | 492 | * device will block most of the unwanted frames. |
493 | * device will block most of the unwanted frames. | 493 | */ |
494 | */ | ||
495 | if (is_p2p) | 494 | if (is_p2p) |
496 | bssid_filtering = false; | 495 | bssid_filtering = false; |
497 | 496 | ||
@@ -1015,17 +1014,17 @@ void cw1200_event_handler(struct work_struct *work) | |||
1015 | /* RSSI: signed Q8.0, RCPI: unsigned Q7.1 | 1014 | /* RSSI: signed Q8.0, RCPI: unsigned Q7.1 |
1016 | * RSSI = RCPI / 2 - 110 | 1015 | * RSSI = RCPI / 2 - 110 |
1017 | */ | 1016 | */ |
1018 | int rcpiRssi = (int)(event->evt.data & 0xFF); | 1017 | int rcpi_rssi = (int)(event->evt.data & 0xFF); |
1019 | int cqm_evt; | 1018 | int cqm_evt; |
1020 | if (priv->cqm_use_rssi) | 1019 | if (priv->cqm_use_rssi) |
1021 | rcpiRssi = (s8)rcpiRssi; | 1020 | rcpi_rssi = (s8)rcpi_rssi; |
1022 | else | 1021 | else |
1023 | rcpiRssi = rcpiRssi / 2 - 110; | 1022 | rcpi_rssi = rcpi_rssi / 2 - 110; |
1024 | 1023 | ||
1025 | cqm_evt = (rcpiRssi <= priv->cqm_rssi_thold) ? | 1024 | cqm_evt = (rcpi_rssi <= priv->cqm_rssi_thold) ? |
1026 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW : | 1025 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW : |
1027 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH; | 1026 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH; |
1028 | pr_debug("[CQM] RSSI event: %d.\n", rcpiRssi); | 1027 | pr_debug("[CQM] RSSI event: %d.\n", rcpi_rssi); |
1029 | ieee80211_cqm_rssi_notify(priv->vif, cqm_evt, | 1028 | ieee80211_cqm_rssi_notify(priv->vif, cqm_evt, |
1030 | GFP_KERNEL); | 1029 | GFP_KERNEL); |
1031 | break; | 1030 | break; |
@@ -1068,8 +1067,7 @@ void cw1200_bss_params_work(struct work_struct *work) | |||
1068 | /* ******************************************************************** */ | 1067 | /* ******************************************************************** */ |
1069 | /* Internal API */ | 1068 | /* Internal API */ |
1070 | 1069 | ||
1071 | /* | 1070 | /* This function is called to Parse the SDD file |
1072 | * This function is called to Parse the SDD file | ||
1073 | * to extract listen_interval and PTA related information | 1071 | * to extract listen_interval and PTA related information |
1074 | * sdd is a TLV: u8 id, u8 len, u8 data[] | 1072 | * sdd is a TLV: u8 id, u8 len, u8 data[] |
1075 | */ | 1073 | */ |
diff --git a/drivers/net/wireless/cw1200/txrx.c b/drivers/net/wireless/cw1200/txrx.c index 451d74625f90..44ca10cb0d39 100644 --- a/drivers/net/wireless/cw1200/txrx.c +++ b/drivers/net/wireless/cw1200/txrx.c | |||
@@ -75,9 +75,6 @@ static void tx_policy_build(const struct cw1200_common *priv, | |||
75 | BUG_ON(rates[0].idx < 0); | 75 | BUG_ON(rates[0].idx < 0); |
76 | memset(policy, 0, sizeof(*policy)); | 76 | memset(policy, 0, sizeof(*policy)); |
77 | 77 | ||
78 | /* minstrel is buggy a little bit, so distille | ||
79 | * incoming rates first. */ | ||
80 | |||
81 | /* Sort rates in descending order. */ | 78 | /* Sort rates in descending order. */ |
82 | for (i = 1; i < count; ++i) { | 79 | for (i = 1; i < count; ++i) { |
83 | if (rates[i].idx < 0) { | 80 | if (rates[i].idx < 0) { |
@@ -108,7 +105,8 @@ static void tx_policy_build(const struct cw1200_common *priv, | |||
108 | count = i + 1; | 105 | count = i + 1; |
109 | 106 | ||
110 | /* Re-fill policy trying to keep every requested rate and with | 107 | /* Re-fill policy trying to keep every requested rate and with |
111 | * respect to the global max tx retransmission count. */ | 108 | * respect to the global max tx retransmission count. |
109 | */ | ||
112 | if (limit < count) | 110 | if (limit < count) |
113 | limit = count; | 111 | limit = count; |
114 | if (total > limit) { | 112 | if (total > limit) { |
@@ -129,7 +127,6 @@ static void tx_policy_build(const struct cw1200_common *priv, | |||
129 | if (count == 2 && !(rates[0].flags & IEEE80211_TX_RC_MCS) && | 127 | if (count == 2 && !(rates[0].flags & IEEE80211_TX_RC_MCS) && |
130 | rates[0].idx > 4 && rates[0].count > 2 && | 128 | rates[0].idx > 4 && rates[0].count > 2 && |
131 | rates[1].idx < 2) { | 129 | rates[1].idx < 2) { |
132 | /* ">> 1" is an equivalent of "/ 2", but faster */ | ||
133 | int mid_rate = (rates[0].idx + 4) >> 1; | 130 | int mid_rate = (rates[0].idx + 4) >> 1; |
134 | 131 | ||
135 | /* Decrease number of retries for the initial rate */ | 132 | /* Decrease number of retries for the initial rate */ |
@@ -151,7 +148,8 @@ static void tx_policy_build(const struct cw1200_common *priv, | |||
151 | /* Fallback to 1 Mbps is a really bad thing, | 148 | /* Fallback to 1 Mbps is a really bad thing, |
152 | * so let's try to increase probability of | 149 | * so let's try to increase probability of |
153 | * successful transmission on the lowest g rate | 150 | * successful transmission on the lowest g rate |
154 | * even more */ | 151 | * even more |
152 | */ | ||
155 | if (rates[0].count >= 3) { | 153 | if (rates[0].count >= 3) { |
156 | --rates[0].count; | 154 | --rates[0].count; |
157 | ++rates[2].count; | 155 | ++rates[2].count; |
@@ -220,7 +218,8 @@ static int tx_policy_find(struct tx_policy_cache *cache, | |||
220 | { | 218 | { |
221 | /* O(n) complexity. Not so good, but there's only 8 entries in | 219 | /* O(n) complexity. Not so good, but there's only 8 entries in |
222 | * the cache. | 220 | * the cache. |
223 | * Also lru helps to reduce search time. */ | 221 | * Also lru helps to reduce search time. |
222 | */ | ||
224 | struct tx_policy_cache_entry *it; | 223 | struct tx_policy_cache_entry *it; |
225 | /* First search for policy in "used" list */ | 224 | /* First search for policy in "used" list */ |
226 | list_for_each_entry(it, &cache->used, link) { | 225 | list_for_each_entry(it, &cache->used, link) { |
@@ -264,7 +263,8 @@ void tx_policy_clean(struct cw1200_common *priv) | |||
264 | for (idx = 0; idx < TX_POLICY_CACHE_SIZE; idx++) { | 263 | for (idx = 0; idx < TX_POLICY_CACHE_SIZE; idx++) { |
265 | entry = &cache->cache[idx]; | 264 | entry = &cache->cache[idx]; |
266 | /* Policy usage count should be 0 at this time as all queues | 265 | /* Policy usage count should be 0 at this time as all queues |
267 | should be empty */ | 266 | should be empty |
267 | */ | ||
268 | if (WARN_ON(entry->policy.usage_count)) { | 268 | if (WARN_ON(entry->policy.usage_count)) { |
269 | entry->policy.usage_count = 0; | 269 | entry->policy.usage_count = 0; |
270 | list_move(&entry->link, &cache->free); | 270 | list_move(&entry->link, &cache->free); |
@@ -319,7 +319,8 @@ static int tx_policy_get(struct cw1200_common *priv, | |||
319 | struct tx_policy_cache_entry *entry; | 319 | struct tx_policy_cache_entry *entry; |
320 | *renew = true; | 320 | *renew = true; |
321 | /* If policy is not found create a new one | 321 | /* If policy is not found create a new one |
322 | * using the oldest entry in "free" list */ | 322 | * using the oldest entry in "free" list |
323 | */ | ||
323 | entry = list_entry(cache->free.prev, | 324 | entry = list_entry(cache->free.prev, |
324 | struct tx_policy_cache_entry, link); | 325 | struct tx_policy_cache_entry, link); |
325 | entry->policy = wanted; | 326 | entry->policy = wanted; |
@@ -612,7 +613,8 @@ cw1200_tx_h_bt(struct cw1200_common *priv, | |||
612 | priv->listen_interval, | 613 | priv->listen_interval, |
613 | mgt_frame->u.assoc_req.listen_interval); | 614 | mgt_frame->u.assoc_req.listen_interval); |
614 | /* Replace listen interval derieved from | 615 | /* Replace listen interval derieved from |
615 | * the one read from SDD */ | 616 | * the one read from SDD |
617 | */ | ||
616 | mgt_frame->u.assoc_req.listen_interval = | 618 | mgt_frame->u.assoc_req.listen_interval = |
617 | priv->listen_interval; | 619 | priv->listen_interval; |
618 | } | 620 | } |
@@ -667,7 +669,8 @@ cw1200_tx_h_rate_policy(struct cw1200_common *priv, | |||
667 | pr_debug("[TX] TX policy renew.\n"); | 669 | pr_debug("[TX] TX policy renew.\n"); |
668 | /* It's not so optimal to stop TX queues every now and then. | 670 | /* It's not so optimal to stop TX queues every now and then. |
669 | * Better to reimplement task scheduling with | 671 | * Better to reimplement task scheduling with |
670 | * a counter. TODO. */ | 672 | * a counter. TODO. |
673 | */ | ||
671 | wsm_lock_tx_async(priv); | 674 | wsm_lock_tx_async(priv); |
672 | cw1200_tx_queues_lock(priv); | 675 | cw1200_tx_queues_lock(priv); |
673 | if (queue_work(priv->workqueue, | 676 | if (queue_work(priv->workqueue, |
@@ -832,8 +835,7 @@ static int cw1200_handle_pspoll(struct cw1200_common *priv, | |||
832 | priv->pspoll_mask |= pspoll_mask; | 835 | priv->pspoll_mask |= pspoll_mask; |
833 | drop = 0; | 836 | drop = 0; |
834 | 837 | ||
835 | /* Do not report pspols if data for given link id is | 838 | /* Do not report pspols if data for given link id is queued already. */ |
836 | * queued already. */ | ||
837 | for (i = 0; i < 4; ++i) { | 839 | for (i = 0; i < 4; ++i) { |
838 | if (cw1200_queue_get_num_queued(&priv->tx_queue[i], | 840 | if (cw1200_queue_get_num_queued(&priv->tx_queue[i], |
839 | pspoll_mask)) { | 841 | pspoll_mask)) { |
@@ -924,7 +926,8 @@ void cw1200_tx_confirm_cb(struct cw1200_common *priv, | |||
924 | cw1200_debug_txed(priv); | 926 | cw1200_debug_txed(priv); |
925 | if (arg->flags & WSM_TX_STATUS_AGGREGATION) { | 927 | if (arg->flags & WSM_TX_STATUS_AGGREGATION) { |
926 | /* Do not report aggregation to mac80211: | 928 | /* Do not report aggregation to mac80211: |
927 | * it confuses minstrel a lot. */ | 929 | * it confuses minstrel a lot. |
930 | */ | ||
928 | /* tx->flags |= IEEE80211_TX_STAT_AMPDU; */ | 931 | /* tx->flags |= IEEE80211_TX_STAT_AMPDU; */ |
929 | cw1200_debug_txed_agg(priv); | 932 | cw1200_debug_txed_agg(priv); |
930 | } | 933 | } |
@@ -1044,7 +1047,8 @@ void cw1200_rx_cb(struct cw1200_common *priv, | |||
1044 | ieee80211_is_action(frame->frame_control) && | 1047 | ieee80211_is_action(frame->frame_control) && |
1045 | (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)) { | 1048 | (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)) { |
1046 | /* Link ID already exists for the ACTION frame. | 1049 | /* Link ID already exists for the ACTION frame. |
1047 | * Reset and Remap */ | 1050 | * Reset and Remap |
1051 | */ | ||
1048 | WARN_ON(work_pending(&priv->linkid_reset_work)); | 1052 | WARN_ON(work_pending(&priv->linkid_reset_work)); |
1049 | memcpy(&priv->action_frame_sa[0], | 1053 | memcpy(&priv->action_frame_sa[0], |
1050 | ieee80211_get_SA(frame), ETH_ALEN); | 1054 | ieee80211_get_SA(frame), ETH_ALEN); |
@@ -1074,7 +1078,6 @@ void cw1200_rx_cb(struct cw1200_common *priv, | |||
1074 | if (cw1200_handle_pspoll(priv, skb)) | 1078 | if (cw1200_handle_pspoll(priv, skb)) |
1075 | goto drop; | 1079 | goto drop; |
1076 | 1080 | ||
1077 | hdr->mactime = 0; /* Not supported by WSM */ | ||
1078 | hdr->band = ((arg->channel_number & 0xff00) || | 1081 | hdr->band = ((arg->channel_number & 0xff00) || |
1079 | (arg->channel_number > 14)) ? | 1082 | (arg->channel_number > 14)) ? |
1080 | IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ; | 1083 | IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ; |
@@ -1102,7 +1105,8 @@ void cw1200_rx_cb(struct cw1200_common *priv, | |||
1102 | hdr->flag |= RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED; | 1105 | hdr->flag |= RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED; |
1103 | 1106 | ||
1104 | /* Oops... There is no fast way to ask mac80211 about | 1107 | /* Oops... There is no fast way to ask mac80211 about |
1105 | * IV/ICV lengths. Even defineas are not exposed.*/ | 1108 | * IV/ICV lengths. Even defineas are not exposed. |
1109 | */ | ||
1106 | switch (WSM_RX_STATUS_ENCRYPTION(arg->flags)) { | 1110 | switch (WSM_RX_STATUS_ENCRYPTION(arg->flags)) { |
1107 | case WSM_RX_STATUS_WEP: | 1111 | case WSM_RX_STATUS_WEP: |
1108 | iv_len = 4 /* WEP_IV_LEN */; | 1112 | iv_len = 4 /* WEP_IV_LEN */; |
@@ -1149,6 +1153,8 @@ void cw1200_rx_cb(struct cw1200_common *priv, | |||
1149 | hdr->mactime = le64_to_cpu(hdr->mactime); | 1153 | hdr->mactime = le64_to_cpu(hdr->mactime); |
1150 | if (skb->len >= 8) | 1154 | if (skb->len >= 8) |
1151 | skb_trim(skb, skb->len - 8); | 1155 | skb_trim(skb, skb->len - 8); |
1156 | } else { | ||
1157 | hdr->mactime = 0; | ||
1152 | } | 1158 | } |
1153 | 1159 | ||
1154 | cw1200_debug_rxed(priv); | 1160 | cw1200_debug_rxed(priv); |
@@ -1192,7 +1198,8 @@ void cw1200_rx_cb(struct cw1200_common *priv, | |||
1192 | 1198 | ||
1193 | /* Stay awake after frame is received to give | 1199 | /* Stay awake after frame is received to give |
1194 | * userspace chance to react and acquire appropriate | 1200 | * userspace chance to react and acquire appropriate |
1195 | * wakelock. */ | 1201 | * wakelock. |
1202 | */ | ||
1196 | if (ieee80211_is_auth(frame->frame_control)) | 1203 | if (ieee80211_is_auth(frame->frame_control)) |
1197 | grace_period = 5 * HZ; | 1204 | grace_period = 5 * HZ; |
1198 | else if (ieee80211_is_deauth(frame->frame_control)) | 1205 | else if (ieee80211_is_deauth(frame->frame_control)) |
diff --git a/drivers/net/wireless/cw1200/wsm.c b/drivers/net/wireless/cw1200/wsm.c index d185f29efb7e..d95094fdcc50 100644 --- a/drivers/net/wireless/cw1200/wsm.c +++ b/drivers/net/wireless/cw1200/wsm.c | |||
@@ -1106,8 +1106,7 @@ static int wsm_cmd_send(struct cw1200_common *priv, | |||
1106 | else | 1106 | else |
1107 | pr_debug("[WSM] >>> 0x%.4X (%zu)\n", cmd, buf_len); | 1107 | pr_debug("[WSM] >>> 0x%.4X (%zu)\n", cmd, buf_len); |
1108 | 1108 | ||
1109 | /* | 1109 | /* Due to buggy SPI on CW1200, we need to |
1110 | * Due to buggy SPI on CW1200, we need to | ||
1111 | * pad the message by a few bytes to ensure | 1110 | * pad the message by a few bytes to ensure |
1112 | * that it's completely received. | 1111 | * that it's completely received. |
1113 | */ | 1112 | */ |
diff --git a/drivers/net/wireless/cw1200/wsm.h b/drivers/net/wireless/cw1200/wsm.h index 4689dffa3d89..2816171f7a1d 100644 --- a/drivers/net/wireless/cw1200/wsm.h +++ b/drivers/net/wireless/cw1200/wsm.h | |||
@@ -314,13 +314,16 @@ struct cw1200_common; | |||
314 | #define WSM_JOIN_FLAGS_P2P_GO BIT(1) | 314 | #define WSM_JOIN_FLAGS_P2P_GO BIT(1) |
315 | /* Force to join BSS with the BSSID and the | 315 | /* Force to join BSS with the BSSID and the |
316 | * SSID specified without waiting for beacons. The | 316 | * SSID specified without waiting for beacons. The |
317 | * ProbeForJoin parameter is ignored. */ | 317 | * ProbeForJoin parameter is ignored. |
318 | */ | ||
318 | #define WSM_JOIN_FLAGS_FORCE BIT(2) | 319 | #define WSM_JOIN_FLAGS_FORCE BIT(2) |
319 | /* Give probe request/response higher | 320 | /* Give probe request/response higher |
320 | * priority over the BT traffic */ | 321 | * priority over the BT traffic |
322 | */ | ||
321 | #define WSM_JOIN_FLAGS_PRIO BIT(3) | 323 | #define WSM_JOIN_FLAGS_PRIO BIT(3) |
322 | /* Issue immediate join confirmation and use | 324 | /* Issue immediate join confirmation and use |
323 | * join complete to notify about completion */ | 325 | * join complete to notify about completion |
326 | */ | ||
324 | #define WSM_JOIN_FLAGS_FORCE_WITH_COMPLETE_IND BIT(5) | 327 | #define WSM_JOIN_FLAGS_FORCE_WITH_COMPLETE_IND BIT(5) |
325 | 328 | ||
326 | /* Key types */ | 329 | /* Key types */ |
@@ -1015,22 +1018,19 @@ struct wsm_add_key { | |||
1015 | u16 reserved; | 1018 | u16 reserved; |
1016 | union { | 1019 | union { |
1017 | struct { | 1020 | struct { |
1018 | u8 peer[6]; /* MAC address of the | 1021 | u8 peer[6]; /* MAC address of the peer station */ |
1019 | * peer station */ | ||
1020 | u8 reserved; | 1022 | u8 reserved; |
1021 | u8 keylen; /* Key length in bytes */ | 1023 | u8 keylen; /* Key length in bytes */ |
1022 | u8 keydata[16]; /* Key data */ | 1024 | u8 keydata[16]; /* Key data */ |
1023 | } __packed wep_pairwise; | 1025 | } __packed wep_pairwise; |
1024 | struct { | 1026 | struct { |
1025 | u8 keyid; /* Unique per key identifier | 1027 | u8 keyid; /* Unique per key identifier (0..3) */ |
1026 | * (0..3) */ | ||
1027 | u8 keylen; /* Key length in bytes */ | 1028 | u8 keylen; /* Key length in bytes */ |
1028 | u16 reserved; | 1029 | u16 reserved; |
1029 | u8 keydata[16]; /* Key data */ | 1030 | u8 keydata[16]; /* Key data */ |
1030 | } __packed wep_group; | 1031 | } __packed wep_group; |
1031 | struct { | 1032 | struct { |
1032 | u8 peer[6]; /* MAC address of the | 1033 | u8 peer[6]; /* MAC address of the peer station */ |
1033 | * peer station */ | ||
1034 | u16 reserved; | 1034 | u16 reserved; |
1035 | u8 keydata[16]; /* TKIP key data */ | 1035 | u8 keydata[16]; /* TKIP key data */ |
1036 | u8 rx_mic_key[8]; /* Rx MIC key */ | 1036 | u8 rx_mic_key[8]; /* Rx MIC key */ |
@@ -1044,8 +1044,7 @@ struct wsm_add_key { | |||
1044 | u8 rx_seqnum[8]; /* Receive Sequence Counter */ | 1044 | u8 rx_seqnum[8]; /* Receive Sequence Counter */ |
1045 | } __packed tkip_group; | 1045 | } __packed tkip_group; |
1046 | struct { | 1046 | struct { |
1047 | u8 peer[6]; /* MAC address of the | 1047 | u8 peer[6]; /* MAC address of the peer station */ |
1048 | * peer station */ | ||
1049 | u16 reserved; | 1048 | u16 reserved; |
1050 | u8 keydata[16]; /* AES key data */ | 1049 | u8 keydata[16]; /* AES key data */ |
1051 | } __packed aes_pairwise; | 1050 | } __packed aes_pairwise; |
@@ -1056,8 +1055,7 @@ struct wsm_add_key { | |||
1056 | u8 rx_seqnum[8]; /* Receive Sequence Counter */ | 1055 | u8 rx_seqnum[8]; /* Receive Sequence Counter */ |
1057 | } __packed aes_group; | 1056 | } __packed aes_group; |
1058 | struct { | 1057 | struct { |
1059 | u8 peer[6]; /* MAC address of the | 1058 | u8 peer[6]; /* MAC address of the peer station */ |
1060 | * peer station */ | ||
1061 | u8 keyid; /* Key ID */ | 1059 | u8 keyid; /* Key ID */ |
1062 | u8 reserved; | 1060 | u8 reserved; |
1063 | u8 keydata[16]; /* WAPI key data */ | 1061 | u8 keydata[16]; /* WAPI key data */ |
@@ -1550,7 +1548,8 @@ struct wsm_tx_rate_retry_policy { | |||
1550 | * finishes. | 1548 | * finishes. |
1551 | * BIT(3) - Count initial frame transmission as part of | 1549 | * BIT(3) - Count initial frame transmission as part of |
1552 | * rate retry counting but not as a retry | 1550 | * rate retry counting but not as a retry |
1553 | * attempt */ | 1551 | * attempt |
1552 | */ | ||
1554 | u8 flags; | 1553 | u8 flags; |
1555 | u8 rate_recoveries; | 1554 | u8 rate_recoveries; |
1556 | u8 reserved[3]; | 1555 | u8 reserved[3]; |
@@ -1618,24 +1617,24 @@ static inline int wsm_set_udp_port_filter(struct cw1200_common *priv, | |||
1618 | #define D11_MAX_SSID_LEN (32) | 1617 | #define D11_MAX_SSID_LEN (32) |
1619 | 1618 | ||
1620 | struct wsm_p2p_device_type { | 1619 | struct wsm_p2p_device_type { |
1621 | __le16 categoryId; | 1620 | __le16 category_id; |
1622 | u8 oui[4]; | 1621 | u8 oui[4]; |
1623 | __le16 subCategoryId; | 1622 | __le16 subcategory_id; |
1624 | } __packed; | 1623 | } __packed; |
1625 | 1624 | ||
1626 | struct wsm_p2p_device_info { | 1625 | struct wsm_p2p_device_info { |
1627 | struct wsm_p2p_device_type primaryDevice; | 1626 | struct wsm_p2p_device_type primaryDevice; |
1628 | u8 reserved1[3]; | 1627 | u8 reserved1[3]; |
1629 | u8 devNameSize; | 1628 | u8 devname_size; |
1630 | u8 localDevName[D11_MAX_SSID_LEN]; | 1629 | u8 local_devname[D11_MAX_SSID_LEN]; |
1631 | u8 reserved2[3]; | 1630 | u8 reserved2[3]; |
1632 | u8 numSecDevSupported; | 1631 | u8 num_secdev_supported; |
1633 | struct wsm_p2p_device_type secondaryDevices[0]; | 1632 | struct wsm_p2p_device_type secdevs[0]; |
1634 | } __packed; | 1633 | } __packed; |
1635 | 1634 | ||
1636 | /* 4.36 SetWCDMABand - WO */ | 1635 | /* 4.36 SetWCDMABand - WO */ |
1637 | struct wsm_cdma_band { | 1636 | struct wsm_cdma_band { |
1638 | u8 WCDMA_Band; | 1637 | u8 wcdma_band; |
1639 | u8 reserved[3]; | 1638 | u8 reserved[3]; |
1640 | } __packed; | 1639 | } __packed; |
1641 | 1640 | ||
@@ -1668,19 +1667,19 @@ struct wsm_ht_protection { | |||
1668 | #define WSM_GPIO_ALL_PINS 0xFF | 1667 | #define WSM_GPIO_ALL_PINS 0xFF |
1669 | 1668 | ||
1670 | struct wsm_gpio_command { | 1669 | struct wsm_gpio_command { |
1671 | u8 GPIO_Command; | 1670 | u8 command; |
1672 | u8 pin; | 1671 | u8 pin; |
1673 | __le16 config; | 1672 | __le16 config; |
1674 | } __packed; | 1673 | } __packed; |
1675 | 1674 | ||
1676 | /* 4.41 TSFCounter - RO */ | 1675 | /* 4.41 TSFCounter - RO */ |
1677 | struct wsm_tsf_counter { | 1676 | struct wsm_tsf_counter { |
1678 | __le64 TSF_Counter; | 1677 | __le64 tsf_counter; |
1679 | } __packed; | 1678 | } __packed; |
1680 | 1679 | ||
1681 | /* 4.43 Keep alive period */ | 1680 | /* 4.43 Keep alive period */ |
1682 | struct wsm_keep_alive_period { | 1681 | struct wsm_keep_alive_period { |
1683 | __le16 keepAlivePeriod; | 1682 | __le16 period; |
1684 | u8 reserved[2]; | 1683 | u8 reserved[2]; |
1685 | } __packed; | 1684 | } __packed; |
1686 | 1685 | ||
@@ -1688,7 +1687,7 @@ static inline int wsm_keep_alive_period(struct cw1200_common *priv, | |||
1688 | int period) | 1687 | int period) |
1689 | { | 1688 | { |
1690 | struct wsm_keep_alive_period arg = { | 1689 | struct wsm_keep_alive_period arg = { |
1691 | .keepAlivePeriod = __cpu_to_le16(period), | 1690 | .period = __cpu_to_le16(period), |
1692 | }; | 1691 | }; |
1693 | return wsm_write_mib(priv, WSM_MIB_ID_KEEP_ALIVE_PERIOD, | 1692 | return wsm_write_mib(priv, WSM_MIB_ID_KEEP_ALIVE_PERIOD, |
1694 | &arg, sizeof(arg)); | 1693 | &arg, sizeof(arg)); |
@@ -1739,13 +1738,13 @@ static inline int wsm_set_arp_ipv4_filter(struct cw1200_common *priv, | |||
1739 | 1738 | ||
1740 | /* P2P Power Save Mode Info - 4.31 */ | 1739 | /* P2P Power Save Mode Info - 4.31 */ |
1741 | struct wsm_p2p_ps_modeinfo { | 1740 | struct wsm_p2p_ps_modeinfo { |
1742 | u8 oppPsCTWindow; | 1741 | u8 opp_ps_ct_window; |
1743 | u8 count; | 1742 | u8 count; |
1744 | u8 reserved; | 1743 | u8 reserved; |
1745 | u8 dtimCount; | 1744 | u8 dtim_count; |
1746 | __le32 duration; | 1745 | __le32 duration; |
1747 | __le32 interval; | 1746 | __le32 interval; |
1748 | __le32 startTime; | 1747 | __le32 start_time; |
1749 | } __packed; | 1748 | } __packed; |
1750 | 1749 | ||
1751 | static inline int wsm_set_p2p_ps_modeinfo(struct cw1200_common *priv, | 1750 | static inline int wsm_set_p2p_ps_modeinfo(struct cw1200_common *priv, |