aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ps3_gelic_wireless.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ps3_gelic_wireless.c')
-rw-r--r--drivers/net/ps3_gelic_wireless.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index a834b52a6a2c..ec2314246682 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -30,10 +30,11 @@
30#include <linux/ip.h> 30#include <linux/ip.h>
31#include <linux/tcp.h> 31#include <linux/tcp.h>
32#include <linux/wireless.h> 32#include <linux/wireless.h>
33#include <linux/ieee80211.h>
34#include <linux/if_arp.h>
33#include <linux/ctype.h> 35#include <linux/ctype.h>
34#include <linux/string.h> 36#include <linux/string.h>
35#include <net/iw_handler.h> 37#include <net/iw_handler.h>
36#include <net/ieee80211.h>
37 38
38#include <linux/dma-mapping.h> 39#include <linux/dma-mapping.h>
39#include <net/checksum.h> 40#include <net/checksum.h>
@@ -449,9 +450,9 @@ static size_t gelic_wl_synthesize_ie(u8 *buf,
449 450
450 /* element id */ 451 /* element id */
451 if (rsn) 452 if (rsn)
452 *buf++ = MFIE_TYPE_RSN; 453 *buf++ = WLAN_EID_RSN;
453 else 454 else
454 *buf++ = MFIE_TYPE_GENERIC; 455 *buf++ = WLAN_EID_GENERIC;
455 456
456 /* length filed; set later */ 457 /* length filed; set later */
457 buf++; 458 buf++;
@@ -539,7 +540,7 @@ static void gelic_wl_parse_ie(u8 *data, size_t len,
539 break; 540 break;
540 541
541 switch (item_id) { 542 switch (item_id) {
542 case MFIE_TYPE_GENERIC: 543 case WLAN_EID_GENERIC:
543 if ((OUI_LEN + 1 <= item_len) && 544 if ((OUI_LEN + 1 <= item_len) &&
544 !memcmp(pos, wpa_oui, OUI_LEN) && 545 !memcmp(pos, wpa_oui, OUI_LEN) &&
545 pos[OUI_LEN] == 0x01) { 546 pos[OUI_LEN] == 0x01) {
@@ -547,7 +548,7 @@ static void gelic_wl_parse_ie(u8 *data, size_t len,
547 ie_info->wpa.len = item_len + 2; 548 ie_info->wpa.len = item_len + 2;
548 } 549 }
549 break; 550 break;
550 case MFIE_TYPE_RSN: 551 case WLAN_EID_RSN:
551 ie_info->rsn.data = pos - 2; 552 ie_info->rsn.data = pos - 2;
552 /* length includes the header */ 553 /* length includes the header */
553 ie_info->rsn.len = item_len + 2; 554 ie_info->rsn.len = item_len + 2;
@@ -581,7 +582,7 @@ static char *gelic_wl_translate_scan(struct net_device *netdev,
581 char *tmp; 582 char *tmp;
582 u8 rate; 583 u8 rate;
583 unsigned int i, j, len; 584 unsigned int i, j, len;
584 u8 buf[MAX_WPA_IE_LEN]; 585 u8 buf[64]; /* arbitrary size large enough */
585 586
586 pr_debug("%s: <-\n", __func__); 587 pr_debug("%s: <-\n", __func__);
587 588
@@ -763,7 +764,6 @@ static void scan_list_dump(struct gelic_wl_info *wl)
763{ 764{
764 struct gelic_wl_scan_info *scan_info; 765 struct gelic_wl_scan_info *scan_info;
765 int i; 766 int i;
766 DECLARE_MAC_BUF(mac);
767 767
768 i = 0; 768 i = 0;
769 list_for_each_entry(scan_info, &wl->network_list, list) { 769 list_for_each_entry(scan_info, &wl->network_list, list) {
@@ -775,8 +775,7 @@ static void scan_list_dump(struct gelic_wl_info *wl)
775 scan_info->rate_len, scan_info->rate_ext_len, 775 scan_info->rate_len, scan_info->rate_ext_len,
776 scan_info->essid_len); 776 scan_info->essid_len);
777 /* -- */ 777 /* -- */
778 pr_debug("bssid=%s\n", 778 pr_debug("bssid=%pM\n", &scan_info->hwinfo->bssid[2]);
779 print_mac(mac, &scan_info->hwinfo->bssid[2]));
780 pr_debug("essid=%s\n", scan_info->hwinfo->essid); 779 pr_debug("essid=%s\n", scan_info->hwinfo->essid);
781 } 780 }
782} 781}
@@ -1167,11 +1166,7 @@ static int gelic_wl_set_ap(struct net_device *netdev,
1167 ETH_ALEN); 1166 ETH_ALEN);
1168 set_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat); 1167 set_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat);
1169 set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat); 1168 set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat);
1170 pr_debug("%s: bss=%02x:%02x:%02x:%02x:%02x:%02x\n", 1169 pr_debug("%s: bss=%pM\n", __func__, wl->bssid);
1171 __func__,
1172 wl->bssid[0], wl->bssid[1],
1173 wl->bssid[2], wl->bssid[3],
1174 wl->bssid[4], wl->bssid[5]);
1175 } else { 1170 } else {
1176 pr_debug("%s: clear bssid\n", __func__); 1171 pr_debug("%s: clear bssid\n", __func__);
1177 clear_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat); 1172 clear_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat);
@@ -1632,7 +1627,6 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
1632 unsigned long this_time = jiffies; 1627 unsigned long this_time = jiffies;
1633 unsigned int data_len, i, found, r; 1628 unsigned int data_len, i, found, r;
1634 void *buf; 1629 void *buf;
1635 DECLARE_MAC_BUF(mac);
1636 1630
1637 pr_debug("%s:start\n", __func__); 1631 pr_debug("%s:start\n", __func__);
1638 mutex_lock(&wl->scan_lock); 1632 mutex_lock(&wl->scan_lock);
@@ -1684,9 +1678,9 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
1684 scan_info_size < data_len; 1678 scan_info_size < data_len;
1685 i++, scan_info_size += be16_to_cpu(scan_info->size), 1679 i++, scan_info_size += be16_to_cpu(scan_info->size),
1686 scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) { 1680 scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) {
1687 pr_debug("%s:size=%d bssid=%s scan_info=%p\n", __func__, 1681 pr_debug("%s:size=%d bssid=%pM scan_info=%p\n", __func__,
1688 be16_to_cpu(scan_info->size), 1682 be16_to_cpu(scan_info->size),
1689 print_mac(mac, &scan_info->bssid[2]), scan_info); 1683 &scan_info->bssid[2], scan_info);
1690 1684
1691 /* 1685 /*
1692 * The wireless firmware may return invalid channel 0 and/or 1686 * The wireless firmware may return invalid channel 0 and/or
@@ -1741,14 +1735,14 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
1741 target->essid_len = strnlen(scan_info->essid, 1735 target->essid_len = strnlen(scan_info->essid,
1742 sizeof(scan_info->essid)); 1736 sizeof(scan_info->essid));
1743 target->rate_len = 0; 1737 target->rate_len = 0;
1744 for (r = 0; r < MAX_RATES_LENGTH; r++) 1738 for (r = 0; r < 12; r++)
1745 if (scan_info->rate[r]) 1739 if (scan_info->rate[r])
1746 target->rate_len++; 1740 target->rate_len++;
1747 if (8 < target->rate_len) 1741 if (8 < target->rate_len)
1748 pr_info("%s: AP returns %d rates\n", __func__, 1742 pr_info("%s: AP returns %d rates\n", __func__,
1749 target->rate_len); 1743 target->rate_len);
1750 target->rate_ext_len = 0; 1744 target->rate_ext_len = 0;
1751 for (r = 0; r < MAX_RATES_EX_LENGTH; r++) 1745 for (r = 0; r < 16; r++)
1752 if (scan_info->ext_rate[r]) 1746 if (scan_info->ext_rate[r])
1753 target->rate_ext_len++; 1747 target->rate_ext_len++;
1754 list_move_tail(&target->list, &wl->network_list); 1748 list_move_tail(&target->list, &wl->network_list);
@@ -1787,7 +1781,6 @@ struct gelic_wl_scan_info *gelic_wl_find_best_bss(struct gelic_wl_info *wl)
1787 struct gelic_wl_scan_info *best_bss; 1781 struct gelic_wl_scan_info *best_bss;
1788 int weight, best_weight; 1782 int weight, best_weight;
1789 u16 security; 1783 u16 security;
1790 DECLARE_MAC_BUF(mac);
1791 1784
1792 pr_debug("%s: <-\n", __func__); 1785 pr_debug("%s: <-\n", __func__);
1793 1786
@@ -1857,8 +1850,8 @@ struct gelic_wl_scan_info *gelic_wl_find_best_bss(struct gelic_wl_info *wl)
1857#ifdef DEBUG 1850#ifdef DEBUG
1858 pr_debug("%s: -> bss=%p\n", __func__, best_bss); 1851 pr_debug("%s: -> bss=%p\n", __func__, best_bss);
1859 if (best_bss) { 1852 if (best_bss) {
1860 pr_debug("%s:addr=%s\n", __func__, 1853 pr_debug("%s:addr=%pM\n", __func__,
1861 print_mac(mac, &best_bss->hwinfo->bssid[2])); 1854 &best_bss->hwinfo->bssid[2]);
1862 } 1855 }
1863#endif 1856#endif
1864 return best_bss; 1857 return best_bss;