aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-05-18 00:46:40 -0400
committerLuciano Coelho <coelho@ti.com>2012-06-06 12:28:05 -0400
commita1c597f2b22cdc228de3c58784b00e80b9b53e03 (patch)
treeeac1d01f867fd3f8df77fae3b050dba94c95e5b9 /drivers/net/wireless/ti/wlcore
parent2c38849f4a247673c8203a569444042e32d82410 (diff)
wlcore/wl12xx/wl18xx: implement op_set_key per HW arch
The 12xx set_key just calls the common wlcore_set_key function, in order to program the keys into the FW. The 18xx variant changes the spare block count when a GEM or TKIP key is set. Also modify the get_spare_blocks HW op for 18xx to return the correct numbers of spare blocks, according to what is currently set in FW. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore')
-rw-r--r--drivers/net/wireless/ti/wlcore/hw_ops.h12
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c14
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.c3
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.h1
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h8
5 files changed, 36 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wlcore/hw_ops.h b/drivers/net/wireless/ti/wlcore/hw_ops.h
index 2cb35218ba47..34e0498727fc 100644
--- a/drivers/net/wireless/ti/wlcore/hw_ops.h
+++ b/drivers/net/wireless/ti/wlcore/hw_ops.h
@@ -176,4 +176,16 @@ wlcore_hw_get_spare_blocks(struct wl1271 *wl, bool is_gem)
176 return wl->ops->get_spare_blocks(wl, is_gem); 176 return wl->ops->get_spare_blocks(wl, is_gem);
177} 177}
178 178
179static inline int
180wlcore_hw_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
181 struct ieee80211_vif *vif,
182 struct ieee80211_sta *sta,
183 struct ieee80211_key_conf *key_conf)
184{
185 if (!wl->ops->set_key)
186 BUG_ON(1);
187
188 return wl->ops->set_key(wl, cmd, vif, sta, key_conf);
189}
190
179#endif 191#endif
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index d81c86cbbf71..7c4f78136bb1 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -2883,12 +2883,21 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2883 return 0; 2883 return 0;
2884} 2884}
2885 2885
2886static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, 2886static int wlcore_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2887 struct ieee80211_vif *vif, 2887 struct ieee80211_vif *vif,
2888 struct ieee80211_sta *sta, 2888 struct ieee80211_sta *sta,
2889 struct ieee80211_key_conf *key_conf) 2889 struct ieee80211_key_conf *key_conf)
2890{ 2890{
2891 struct wl1271 *wl = hw->priv; 2891 struct wl1271 *wl = hw->priv;
2892
2893 return wlcore_hw_set_key(wl, cmd, vif, sta, key_conf);
2894}
2895
2896int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
2897 struct ieee80211_vif *vif,
2898 struct ieee80211_sta *sta,
2899 struct ieee80211_key_conf *key_conf)
2900{
2892 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); 2901 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
2893 int ret; 2902 int ret;
2894 u32 tx_seq_32 = 0; 2903 u32 tx_seq_32 = 0;
@@ -2999,6 +3008,7 @@ out_unlock:
2999 3008
3000 return ret; 3009 return ret;
3001} 3010}
3011EXPORT_SYMBOL_GPL(wlcore_set_key);
3002 3012
3003static int wl1271_op_hw_scan(struct ieee80211_hw *hw, 3013static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
3004 struct ieee80211_vif *vif, 3014 struct ieee80211_vif *vif,
@@ -4643,7 +4653,7 @@ static const struct ieee80211_ops wl1271_ops = {
4643 .prepare_multicast = wl1271_op_prepare_multicast, 4653 .prepare_multicast = wl1271_op_prepare_multicast,
4644 .configure_filter = wl1271_op_configure_filter, 4654 .configure_filter = wl1271_op_configure_filter,
4645 .tx = wl1271_op_tx, 4655 .tx = wl1271_op_tx,
4646 .set_key = wl1271_op_set_key, 4656 .set_key = wlcore_op_set_key,
4647 .hw_scan = wl1271_op_hw_scan, 4657 .hw_scan = wl1271_op_hw_scan,
4648 .cancel_hw_scan = wl1271_op_cancel_hw_scan, 4658 .cancel_hw_scan = wl1271_op_cancel_hw_scan,
4649 .sched_scan_start = wl1271_op_sched_scan_start, 4659 .sched_scan_start = wl1271_op_sched_scan_start,
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index 78bf1b9208a9..da9a07d2cf4b 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -1055,6 +1055,7 @@ out:
1055 wlcore_wake_queues(wl, WLCORE_QUEUE_STOP_REASON_FLUSH); 1055 wlcore_wake_queues(wl, WLCORE_QUEUE_STOP_REASON_FLUSH);
1056 mutex_unlock(&wl->flush_mutex); 1056 mutex_unlock(&wl->flush_mutex);
1057} 1057}
1058EXPORT_SYMBOL_GPL(wl1271_tx_flush);
1058 1059
1059u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set) 1060u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set)
1060{ 1061{
@@ -1115,6 +1116,7 @@ void wlcore_stop_queues(struct wl1271 *wl,
1115 for (i = 0; i < NUM_TX_QUEUES; i++) 1116 for (i = 0; i < NUM_TX_QUEUES; i++)
1116 wlcore_stop_queue(wl, i, reason); 1117 wlcore_stop_queue(wl, i, reason);
1117} 1118}
1119EXPORT_SYMBOL_GPL(wlcore_stop_queues);
1118 1120
1119void wlcore_wake_queues(struct wl1271 *wl, 1121void wlcore_wake_queues(struct wl1271 *wl,
1120 enum wlcore_queue_stop_reason reason) 1122 enum wlcore_queue_stop_reason reason)
@@ -1124,6 +1126,7 @@ void wlcore_wake_queues(struct wl1271 *wl,
1124 for (i = 0; i < NUM_TX_QUEUES; i++) 1126 for (i = 0; i < NUM_TX_QUEUES; i++)
1125 wlcore_wake_queue(wl, i, reason); 1127 wlcore_wake_queue(wl, i, reason);
1126} 1128}
1129EXPORT_SYMBOL_GPL(wlcore_wake_queues);
1127 1130
1128void wlcore_reset_stopped_queues(struct wl1271 *wl) 1131void wlcore_reset_stopped_queues(struct wl1271 *wl)
1129{ 1132{
diff --git a/drivers/net/wireless/ti/wlcore/tx.h b/drivers/net/wireless/ti/wlcore/tx.h
index e058a55f533d..49e441f34839 100644
--- a/drivers/net/wireless/ti/wlcore/tx.h
+++ b/drivers/net/wireless/ti/wlcore/tx.h
@@ -188,6 +188,7 @@ enum wlcore_queue_stop_reason {
188 WLCORE_QUEUE_STOP_REASON_WATERMARK, 188 WLCORE_QUEUE_STOP_REASON_WATERMARK,
189 WLCORE_QUEUE_STOP_REASON_FW_RESTART, 189 WLCORE_QUEUE_STOP_REASON_FW_RESTART,
190 WLCORE_QUEUE_STOP_REASON_FLUSH, 190 WLCORE_QUEUE_STOP_REASON_FLUSH,
191 WLCORE_QUEUE_STOP_REASON_SPARE_BLK, /* 18xx specific */
191}; 192};
192 193
193static inline int wl1271_tx_get_queue(int queue) 194static inline int wl1271_tx_get_queue(int queue)
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 99a061950a3a..4ca968fac0eb 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -76,6 +76,10 @@ struct wlcore_ops {
76 int (*handle_static_data)(struct wl1271 *wl, 76 int (*handle_static_data)(struct wl1271 *wl,
77 struct wl1271_static_data *static_data); 77 struct wl1271_static_data *static_data);
78 int (*get_spare_blocks)(struct wl1271 *wl, bool is_gem); 78 int (*get_spare_blocks)(struct wl1271 *wl, bool is_gem);
79 int (*set_key)(struct wl1271 *wl, enum set_key_cmd cmd,
80 struct ieee80211_vif *vif,
81 struct ieee80211_sta *sta,
82 struct ieee80211_key_conf *key_conf);
79}; 83};
80 84
81enum wlcore_partitions { 85enum wlcore_partitions {
@@ -387,6 +391,10 @@ int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
387int __devexit wlcore_remove(struct platform_device *pdev); 391int __devexit wlcore_remove(struct platform_device *pdev);
388struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size); 392struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size);
389int wlcore_free_hw(struct wl1271 *wl); 393int wlcore_free_hw(struct wl1271 *wl);
394int wlcore_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
395 struct ieee80211_vif *vif,
396 struct ieee80211_sta *sta,
397 struct ieee80211_key_conf *key_conf);
390 398
391/* Firmware image load chunk size */ 399/* Firmware image load chunk size */
392#define CHUNK_SIZE 16384 400#define CHUNK_SIZE 16384