aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/at76c50x-usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/at76c50x-usb.c')
-rw-r--r--drivers/net/wireless/at76c50x-usb.c58
1 files changed, 15 insertions, 43 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 88b8d64c90f1..99b9ddf21273 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -498,36 +498,6 @@ exit:
498 return ret; 498 return ret;
499} 499}
500 500
501#define HEX2STR_BUFFERS 4
502#define HEX2STR_MAX_LEN 64
503
504/* Convert binary data into hex string */
505static char *hex2str(void *buf, size_t len)
506{
507 static atomic_t a = ATOMIC_INIT(0);
508 static char bufs[HEX2STR_BUFFERS][3 * HEX2STR_MAX_LEN + 1];
509 char *ret = bufs[atomic_inc_return(&a) & (HEX2STR_BUFFERS - 1)];
510 char *obuf = ret;
511 u8 *ibuf = buf;
512
513 if (len > HEX2STR_MAX_LEN)
514 len = HEX2STR_MAX_LEN;
515
516 if (len == 0)
517 goto exit;
518
519 while (len--) {
520 obuf = hex_byte_pack(obuf, *ibuf++);
521 *obuf++ = '-';
522 }
523 obuf--;
524
525exit:
526 *obuf = '\0';
527
528 return ret;
529}
530
531/* LED trigger */ 501/* LED trigger */
532static int tx_activity; 502static int tx_activity;
533static void at76_ledtrig_tx_timerfunc(unsigned long data); 503static void at76_ledtrig_tx_timerfunc(unsigned long data);
@@ -1004,9 +974,9 @@ static void at76_dump_mib_mac_wep(struct at76_priv *priv)
1004 WEP_SMALL_KEY_LEN : WEP_LARGE_KEY_LEN; 974 WEP_SMALL_KEY_LEN : WEP_LARGE_KEY_LEN;
1005 975
1006 for (i = 0; i < WEP_KEYS; i++) 976 for (i = 0; i < WEP_KEYS; i++)
1007 at76_dbg(DBG_MIB, "%s: MIB MAC_WEP: key %d: %s", 977 at76_dbg(DBG_MIB, "%s: MIB MAC_WEP: key %d: %*phD",
1008 wiphy_name(priv->hw->wiphy), i, 978 wiphy_name(priv->hw->wiphy), i,
1009 hex2str(m->wep_default_keyvalue[i], key_len)); 979 key_len, m->wep_default_keyvalue[i]);
1010exit: 980exit:
1011 kfree(m); 981 kfree(m);
1012} 982}
@@ -1031,7 +1001,7 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv)
1031 at76_dbg(DBG_MIB, "%s: MIB MAC_MGMT: beacon_period %d CFP_max_duration " 1001 at76_dbg(DBG_MIB, "%s: MIB MAC_MGMT: beacon_period %d CFP_max_duration "
1032 "%d medium_occupancy_limit %d station_id 0x%x ATIM_window %d " 1002 "%d medium_occupancy_limit %d station_id 0x%x ATIM_window %d "
1033 "CFP_mode %d privacy_opt_impl %d DTIM_period %d CFP_period %d " 1003 "CFP_mode %d privacy_opt_impl %d DTIM_period %d CFP_period %d "
1034 "current_bssid %pM current_essid %s current_bss_type %d " 1004 "current_bssid %pM current_essid %*phD current_bss_type %d "
1035 "pm_mode %d ibss_change %d res %d " 1005 "pm_mode %d ibss_change %d res %d "
1036 "multi_domain_capability_implemented %d " 1006 "multi_domain_capability_implemented %d "
1037 "international_roaming %d country_string %.3s", 1007 "international_roaming %d country_string %.3s",
@@ -1041,7 +1011,7 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv)
1041 le16_to_cpu(m->station_id), le16_to_cpu(m->ATIM_window), 1011 le16_to_cpu(m->station_id), le16_to_cpu(m->ATIM_window),
1042 m->CFP_mode, m->privacy_option_implemented, m->DTIM_period, 1012 m->CFP_mode, m->privacy_option_implemented, m->DTIM_period,
1043 m->CFP_period, m->current_bssid, 1013 m->CFP_period, m->current_bssid,
1044 hex2str(m->current_essid, IW_ESSID_MAX_SIZE), 1014 IW_ESSID_MAX_SIZE, m->current_essid,
1045 m->current_bss_type, m->power_mgmt_mode, m->ibss_change, 1015 m->current_bss_type, m->power_mgmt_mode, m->ibss_change,
1046 m->res, m->multi_domain_capability_implemented, 1016 m->res, m->multi_domain_capability_implemented,
1047 m->multi_domain_capability_enabled, m->country_string); 1017 m->multi_domain_capability_enabled, m->country_string);
@@ -1069,7 +1039,7 @@ static void at76_dump_mib_mac(struct at76_priv *priv)
1069 "cwmin %d cwmax %d short_retry_time %d long_retry_time %d " 1039 "cwmin %d cwmax %d short_retry_time %d long_retry_time %d "
1070 "scan_type %d scan_channel %d probe_delay %u " 1040 "scan_type %d scan_channel %d probe_delay %u "
1071 "min_channel_time %d max_channel_time %d listen_int %d " 1041 "min_channel_time %d max_channel_time %d listen_int %d "
1072 "desired_ssid %s desired_bssid %pM desired_bsstype %d", 1042 "desired_ssid %*phD desired_bssid %pM desired_bsstype %d",
1073 wiphy_name(priv->hw->wiphy), 1043 wiphy_name(priv->hw->wiphy),
1074 le32_to_cpu(m->max_tx_msdu_lifetime), 1044 le32_to_cpu(m->max_tx_msdu_lifetime),
1075 le32_to_cpu(m->max_rx_lifetime), 1045 le32_to_cpu(m->max_rx_lifetime),
@@ -1080,7 +1050,7 @@ static void at76_dump_mib_mac(struct at76_priv *priv)
1080 le16_to_cpu(m->min_channel_time), 1050 le16_to_cpu(m->min_channel_time),
1081 le16_to_cpu(m->max_channel_time), 1051 le16_to_cpu(m->max_channel_time),
1082 le16_to_cpu(m->listen_interval), 1052 le16_to_cpu(m->listen_interval),
1083 hex2str(m->desired_ssid, IW_ESSID_MAX_SIZE), 1053 IW_ESSID_MAX_SIZE, m->desired_ssid,
1084 m->desired_bssid, m->desired_bsstype); 1054 m->desired_bssid, m->desired_bsstype);
1085exit: 1055exit:
1086 kfree(m); 1056 kfree(m);
@@ -1160,13 +1130,13 @@ static void at76_dump_mib_mdomain(struct at76_priv *priv)
1160 goto exit; 1130 goto exit;
1161 } 1131 }
1162 1132
1163 at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: channel_list %s", 1133 at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: channel_list %*phD",
1164 wiphy_name(priv->hw->wiphy), 1134 wiphy_name(priv->hw->wiphy),
1165 hex2str(m->channel_list, sizeof(m->channel_list))); 1135 (int)sizeof(m->channel_list), m->channel_list);
1166 1136
1167 at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: tx_powerlevel %s", 1137 at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: tx_powerlevel %*phD",
1168 wiphy_name(priv->hw->wiphy), 1138 wiphy_name(priv->hw->wiphy),
1169 hex2str(m->tx_powerlevel, sizeof(m->tx_powerlevel))); 1139 (int)sizeof(m->tx_powerlevel), m->tx_powerlevel);
1170exit: 1140exit:
1171 kfree(m); 1141 kfree(m);
1172} 1142}
@@ -1369,9 +1339,9 @@ static int at76_startup_device(struct at76_priv *priv)
1369 int ret; 1339 int ret;
1370 1340
1371 at76_dbg(DBG_PARAMS, 1341 at76_dbg(DBG_PARAMS,
1372 "%s param: ssid %.*s (%s) mode %s ch %d wep %s key %d " 1342 "%s param: ssid %.*s (%*phD) mode %s ch %d wep %s key %d "
1373 "keylen %d", wiphy_name(priv->hw->wiphy), priv->essid_size, 1343 "keylen %d", wiphy_name(priv->hw->wiphy), priv->essid_size,
1374 priv->essid, hex2str(priv->essid, IW_ESSID_MAX_SIZE), 1344 priv->essid, IW_ESSID_MAX_SIZE, priv->essid,
1375 priv->iw_mode == IW_MODE_ADHOC ? "adhoc" : "infra", 1345 priv->iw_mode == IW_MODE_ADHOC ? "adhoc" : "infra",
1376 priv->channel, priv->wep_enabled ? "enabled" : "disabled", 1346 priv->channel, priv->wep_enabled ? "enabled" : "disabled",
1377 priv->wep_key_id, priv->wep_keys_len[priv->wep_key_id]); 1347 priv->wep_key_id, priv->wep_keys_len[priv->wep_key_id]);
@@ -1726,7 +1696,9 @@ static void at76_mac80211_tx_callback(struct urb *urb)
1726 ieee80211_wake_queues(priv->hw); 1696 ieee80211_wake_queues(priv->hw);
1727} 1697}
1728 1698
1729static void at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1699static void at76_mac80211_tx(struct ieee80211_hw *hw,
1700 struct ieee80211_tx_control *control,
1701 struct sk_buff *skb)
1730{ 1702{
1731 struct at76_priv *priv = hw->priv; 1703 struct at76_priv *priv = hw->priv;
1732 struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer; 1704 struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer;