diff options
Diffstat (limited to 'drivers/net/wireless/at76c50x-usb.c')
-rw-r--r-- | drivers/net/wireless/at76c50x-usb.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c index 0a917e44b22c..be2e5962319b 100644 --- a/drivers/net/wireless/at76c50x-usb.c +++ b/drivers/net/wireless/at76c50x-usb.c | |||
@@ -532,20 +532,6 @@ static char *hex2str(void *buf, int len) | |||
532 | return ret; | 532 | return ret; |
533 | } | 533 | } |
534 | 534 | ||
535 | #define MAC2STR_BUFFERS 4 | ||
536 | |||
537 | static inline char *mac2str(u8 *mac) | ||
538 | { | ||
539 | static atomic_t a = ATOMIC_INIT(0); | ||
540 | static char bufs[MAC2STR_BUFFERS][6 * 3]; | ||
541 | char *str; | ||
542 | |||
543 | str = bufs[atomic_inc_return(&a) & (MAC2STR_BUFFERS - 1)]; | ||
544 | sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x", | ||
545 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); | ||
546 | return str; | ||
547 | } | ||
548 | |||
549 | /* LED trigger */ | 535 | /* LED trigger */ |
550 | static int tx_activity; | 536 | static int tx_activity; |
551 | static void at76_ledtrig_tx_timerfunc(unsigned long data); | 537 | static void at76_ledtrig_tx_timerfunc(unsigned long data); |
@@ -981,13 +967,13 @@ static void at76_dump_mib_mac_addr(struct at76_priv *priv) | |||
981 | goto exit; | 967 | goto exit; |
982 | } | 968 | } |
983 | 969 | ||
984 | at76_dbg(DBG_MIB, "%s: MIB MAC_ADDR: mac_addr %s res 0x%x 0x%x", | 970 | at76_dbg(DBG_MIB, "%s: MIB MAC_ADDR: mac_addr %pM res 0x%x 0x%x", |
985 | wiphy_name(priv->hw->wiphy), | 971 | wiphy_name(priv->hw->wiphy), |
986 | mac2str(m->mac_addr), m->res[0], m->res[1]); | 972 | m->mac_addr, m->res[0], m->res[1]); |
987 | for (i = 0; i < ARRAY_SIZE(m->group_addr); i++) | 973 | for (i = 0; i < ARRAY_SIZE(m->group_addr); i++) |
988 | at76_dbg(DBG_MIB, "%s: MIB MAC_ADDR: group addr %d: %s, " | 974 | at76_dbg(DBG_MIB, "%s: MIB MAC_ADDR: group addr %d: %pM, " |
989 | "status %d", wiphy_name(priv->hw->wiphy), i, | 975 | "status %d", wiphy_name(priv->hw->wiphy), i, |
990 | mac2str(m->group_addr[i]), m->group_addr_status[i]); | 976 | m->group_addr[i], m->group_addr_status[i]); |
991 | exit: | 977 | exit: |
992 | kfree(m); | 978 | kfree(m); |
993 | } | 979 | } |
@@ -1050,7 +1036,7 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv) | |||
1050 | at76_dbg(DBG_MIB, "%s: MIB MAC_MGMT: beacon_period %d CFP_max_duration " | 1036 | at76_dbg(DBG_MIB, "%s: MIB MAC_MGMT: beacon_period %d CFP_max_duration " |
1051 | "%d medium_occupancy_limit %d station_id 0x%x ATIM_window %d " | 1037 | "%d medium_occupancy_limit %d station_id 0x%x ATIM_window %d " |
1052 | "CFP_mode %d privacy_opt_impl %d DTIM_period %d CFP_period %d " | 1038 | "CFP_mode %d privacy_opt_impl %d DTIM_period %d CFP_period %d " |
1053 | "current_bssid %s current_essid %s current_bss_type %d " | 1039 | "current_bssid %pM current_essid %s current_bss_type %d " |
1054 | "pm_mode %d ibss_change %d res %d " | 1040 | "pm_mode %d ibss_change %d res %d " |
1055 | "multi_domain_capability_implemented %d " | 1041 | "multi_domain_capability_implemented %d " |
1056 | "international_roaming %d country_string %.3s", | 1042 | "international_roaming %d country_string %.3s", |
@@ -1059,7 +1045,7 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv) | |||
1059 | le16_to_cpu(m->medium_occupancy_limit), | 1045 | le16_to_cpu(m->medium_occupancy_limit), |
1060 | le16_to_cpu(m->station_id), le16_to_cpu(m->ATIM_window), | 1046 | le16_to_cpu(m->station_id), le16_to_cpu(m->ATIM_window), |
1061 | m->CFP_mode, m->privacy_option_implemented, m->DTIM_period, | 1047 | m->CFP_mode, m->privacy_option_implemented, m->DTIM_period, |
1062 | m->CFP_period, mac2str(m->current_bssid), | 1048 | m->CFP_period, m->current_bssid, |
1063 | hex2str(m->current_essid, IW_ESSID_MAX_SIZE), | 1049 | hex2str(m->current_essid, IW_ESSID_MAX_SIZE), |
1064 | m->current_bss_type, m->power_mgmt_mode, m->ibss_change, | 1050 | m->current_bss_type, m->power_mgmt_mode, m->ibss_change, |
1065 | m->res, m->multi_domain_capability_implemented, | 1051 | m->res, m->multi_domain_capability_implemented, |
@@ -1088,7 +1074,7 @@ static void at76_dump_mib_mac(struct at76_priv *priv) | |||
1088 | "cwmin %d cwmax %d short_retry_time %d long_retry_time %d " | 1074 | "cwmin %d cwmax %d short_retry_time %d long_retry_time %d " |
1089 | "scan_type %d scan_channel %d probe_delay %u " | 1075 | "scan_type %d scan_channel %d probe_delay %u " |
1090 | "min_channel_time %d max_channel_time %d listen_int %d " | 1076 | "min_channel_time %d max_channel_time %d listen_int %d " |
1091 | "desired_ssid %s desired_bssid %s desired_bsstype %d", | 1077 | "desired_ssid %s desired_bssid %pM desired_bsstype %d", |
1092 | wiphy_name(priv->hw->wiphy), | 1078 | wiphy_name(priv->hw->wiphy), |
1093 | le32_to_cpu(m->max_tx_msdu_lifetime), | 1079 | le32_to_cpu(m->max_tx_msdu_lifetime), |
1094 | le32_to_cpu(m->max_rx_lifetime), | 1080 | le32_to_cpu(m->max_rx_lifetime), |
@@ -1100,7 +1086,7 @@ static void at76_dump_mib_mac(struct at76_priv *priv) | |||
1100 | le16_to_cpu(m->max_channel_time), | 1086 | le16_to_cpu(m->max_channel_time), |
1101 | le16_to_cpu(m->listen_interval), | 1087 | le16_to_cpu(m->listen_interval), |
1102 | hex2str(m->desired_ssid, IW_ESSID_MAX_SIZE), | 1088 | hex2str(m->desired_ssid, IW_ESSID_MAX_SIZE), |
1103 | mac2str(m->desired_bssid), m->desired_bsstype); | 1089 | m->desired_bssid, m->desired_bsstype); |
1104 | exit: | 1090 | exit: |
1105 | kfree(m); | 1091 | kfree(m); |
1106 | } | 1092 | } |
@@ -2292,9 +2278,9 @@ static int at76_init_new_device(struct at76_priv *priv, | |||
2292 | 2278 | ||
2293 | priv->mac80211_registered = 1; | 2279 | priv->mac80211_registered = 1; |
2294 | 2280 | ||
2295 | printk(KERN_INFO "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n", | 2281 | printk(KERN_INFO "%s: USB %s, MAC %pM, firmware %d.%d.%d-%d\n", |
2296 | wiphy_name(priv->hw->wiphy), | 2282 | wiphy_name(priv->hw->wiphy), |
2297 | dev_name(&interface->dev), mac2str(priv->mac_addr), | 2283 | dev_name(&interface->dev), priv->mac_addr, |
2298 | priv->fw_version.major, priv->fw_version.minor, | 2284 | priv->fw_version.major, priv->fw_version.minor, |
2299 | priv->fw_version.patch, priv->fw_version.build); | 2285 | priv->fw_version.patch, priv->fw_version.build); |
2300 | printk(KERN_INFO "%s: regulatory domain 0x%02x: %s\n", | 2286 | printk(KERN_INFO "%s: regulatory domain 0x%02x: %s\n", |