aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/airo.c6
-rw-r--r--drivers/net/wireless/hostap/hostap.h3
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c3
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c5
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c47
-rw-r--r--drivers/net/wireless/hostap/hostap_wlan.h2
-rw-r--r--drivers/net/wireless/strip.c13
7 files changed, 46 insertions, 33 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index cd03a61359aa..074055e18c5c 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2696,9 +2696,13 @@ static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci)
2696 return rc; 2696 return rc;
2697} 2697}
2698 2698
2699static const struct header_ops airo_header_ops = {
2700 .parse = wll_header_parse,
2701};
2702
2699static void wifi_setup(struct net_device *dev) 2703static void wifi_setup(struct net_device *dev)
2700{ 2704{
2701 dev->hard_header_parse = wll_header_parse; 2705 dev->header_ops = &airo_header_ops;
2702 dev->hard_start_xmit = &airo_start_xmit11; 2706 dev->hard_start_xmit = &airo_start_xmit11;
2703 dev->get_stats = &airo_get_stats; 2707 dev->get_stats = &airo_get_stats;
2704 dev->set_mac_address = &airo_set_mac_address; 2708 dev->set_mac_address = &airo_set_mac_address;
diff --git a/drivers/net/wireless/hostap/hostap.h b/drivers/net/wireless/hostap/hostap.h
index ef37a75d550b..951df83702f9 100644
--- a/drivers/net/wireless/hostap/hostap.h
+++ b/drivers/net/wireless/hostap/hostap.h
@@ -30,8 +30,7 @@ void hostap_dump_rx_header(const char *name,
30 const struct hfa384x_rx_frame *rx); 30 const struct hfa384x_rx_frame *rx);
31void hostap_dump_tx_header(const char *name, 31void hostap_dump_tx_header(const char *name,
32 const struct hfa384x_tx_frame *tx); 32 const struct hfa384x_tx_frame *tx);
33int hostap_80211_header_parse(struct sk_buff *skb, unsigned char *haddr); 33extern const struct header_ops hostap_80211_ops;
34int hostap_80211_prism_header_parse(struct sk_buff *skb, unsigned char *haddr);
35int hostap_80211_get_hdrlen(u16 fc); 34int hostap_80211_get_hdrlen(u16 fc);
36struct net_device_stats *hostap_get_stats(struct net_device *dev); 35struct net_device_stats *hostap_get_stats(struct net_device *dev);
37void hostap_setup_dev(struct net_device *dev, local_info_t *local, 36void hostap_setup_dev(struct net_device *dev, local_info_t *local,
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 7fa7ab0a4b23..b20bb013d57e 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -3258,11 +3258,10 @@ while (0)
3258 INIT_LIST_HEAD(&local->bss_list); 3258 INIT_LIST_HEAD(&local->bss_list);
3259 3259
3260 hostap_setup_dev(dev, local, 1); 3260 hostap_setup_dev(dev, local, 1);
3261 local->saved_eth_header_parse = dev->hard_header_parse;
3262 3261
3263 dev->hard_start_xmit = hostap_master_start_xmit; 3262 dev->hard_start_xmit = hostap_master_start_xmit;
3264 dev->type = ARPHRD_IEEE80211; 3263 dev->type = ARPHRD_IEEE80211;
3265 dev->hard_header_parse = hostap_80211_header_parse; 3264 dev->header_ops = &hostap_80211_ops;
3266 3265
3267 rtnl_lock(); 3266 rtnl_lock();
3268 ret = dev_alloc_name(dev, "wifi%d"); 3267 ret = dev_alloc_name(dev, "wifi%d");
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 7036ecff5ec1..40f516d42c5e 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -897,11 +897,8 @@ static void hostap_monitor_set_type(local_info_t *local)
897 if (local->monitor_type == PRISM2_MONITOR_PRISM || 897 if (local->monitor_type == PRISM2_MONITOR_PRISM ||
898 local->monitor_type == PRISM2_MONITOR_CAPHDR) { 898 local->monitor_type == PRISM2_MONITOR_CAPHDR) {
899 dev->type = ARPHRD_IEEE80211_PRISM; 899 dev->type = ARPHRD_IEEE80211_PRISM;
900 dev->hard_header_parse =
901 hostap_80211_prism_header_parse;
902 } else { 900 } else {
903 dev->type = ARPHRD_IEEE80211; 901 dev->type = ARPHRD_IEEE80211;
904 dev->hard_header_parse = hostap_80211_header_parse;
905 } 902 }
906} 903}
907 904
@@ -1141,7 +1138,7 @@ static int hostap_monitor_mode_disable(local_info_t *local)
1141 1138
1142 printk(KERN_DEBUG "%s: Disabling monitor mode\n", dev->name); 1139 printk(KERN_DEBUG "%s: Disabling monitor mode\n", dev->name);
1143 dev->type = ARPHRD_ETHER; 1140 dev->type = ARPHRD_ETHER;
1144 dev->hard_header_parse = local->saved_eth_header_parse; 1141
1145 if (local->func->cmd(dev, HFA384X_CMDCODE_TEST | 1142 if (local->func->cmd(dev, HFA384X_CMDCODE_TEST |
1146 (HFA384X_TEST_STOP << 8), 1143 (HFA384X_TEST_STOP << 8),
1147 0, NULL, NULL)) 1144 0, NULL, NULL))
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 4cb09d81b404..b75cf9205ce0 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -594,24 +594,27 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
594} 594}
595 595
596 596
597int hostap_80211_header_parse(struct sk_buff *skb, unsigned char *haddr) 597int hostap_80211_header_parse(const struct sk_buff *skb, unsigned char *haddr)
598{ 598{
599 memcpy(haddr, skb_mac_header(skb) + 10, ETH_ALEN); /* addr2 */ 599 struct hostap_interface *iface = netdev_priv(skb->dev);
600 return ETH_ALEN; 600 local_info_t *local = iface->local;
601} 601
602 602 if (local->monitor_type == PRISM2_MONITOR_PRISM ||
603 local->monitor_type == PRISM2_MONITOR_CAPHDR) {
604 const unsigned char *mac = skb_mac_header(skb);
605
606 if (*(u32 *)mac == LWNG_CAP_DID_BASE) {
607 memcpy(haddr,
608 mac + sizeof(struct linux_wlan_ng_prism_hdr) + 10,
609 ETH_ALEN); /* addr2 */
610 } else { /* (*(u32 *)mac == htonl(LWNG_CAPHDR_VERSION)) */
611 memcpy(haddr,
612 mac + sizeof(struct linux_wlan_ng_cap_hdr) + 10,
613 ETH_ALEN); /* addr2 */
614 }
615 } else
616 memcpy(haddr, skb_mac_header(skb) + 10, ETH_ALEN); /* addr2 */
603 617
604int hostap_80211_prism_header_parse(struct sk_buff *skb, unsigned char *haddr)
605{
606 const unsigned char *mac = skb_mac_header(skb);
607
608 if (*(u32 *)mac == LWNG_CAP_DID_BASE) {
609 memcpy(haddr, mac + sizeof(struct linux_wlan_ng_prism_hdr) + 10,
610 ETH_ALEN); /* addr2 */
611 } else { /* (*(u32 *)mac == htonl(LWNG_CAPHDR_VERSION)) */
612 memcpy(haddr, mac + sizeof(struct linux_wlan_ng_cap_hdr) + 10,
613 ETH_ALEN); /* addr2 */
614 }
615 return ETH_ALEN; 618 return ETH_ALEN;
616} 619}
617 620
@@ -843,6 +846,15 @@ static void prism2_tx_timeout(struct net_device *dev)
843 local->func->schedule_reset(local); 846 local->func->schedule_reset(local);
844} 847}
845 848
849const struct header_ops hostap_80211_ops = {
850 .create = eth_header,
851 .rebuild = eth_rebuild_header,
852 .cache = eth_header_cache,
853 .cache_update = eth_header_cache_update,
854
855 .parse = hostap_80211_header_parse,
856};
857EXPORT_SYMBOL(hostap_80211_ops);
846 858
847void hostap_setup_dev(struct net_device *dev, local_info_t *local, 859void hostap_setup_dev(struct net_device *dev, local_info_t *local,
848 int main_dev) 860 int main_dev)
@@ -883,7 +895,6 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
883 netif_stop_queue(dev); 895 netif_stop_queue(dev);
884} 896}
885 897
886
887static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked) 898static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)
888{ 899{
889 struct net_device *dev = local->dev; 900 struct net_device *dev = local->dev;
@@ -901,7 +912,7 @@ static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)
901 912
902 local->apdev->hard_start_xmit = hostap_mgmt_start_xmit; 913 local->apdev->hard_start_xmit = hostap_mgmt_start_xmit;
903 local->apdev->type = ARPHRD_IEEE80211; 914 local->apdev->type = ARPHRD_IEEE80211;
904 local->apdev->hard_header_parse = hostap_80211_header_parse; 915 local->apdev->header_ops = &hostap_80211_ops;
905 916
906 return 0; 917 return 0;
907} 918}
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
index a42325c145b4..c27b2c1c06af 100644
--- a/drivers/net/wireless/hostap/hostap_wlan.h
+++ b/drivers/net/wireless/hostap/hostap_wlan.h
@@ -736,8 +736,6 @@ struct local_info {
736 PRISM2_MONITOR_80211 = 0, PRISM2_MONITOR_PRISM = 1, 736 PRISM2_MONITOR_80211 = 0, PRISM2_MONITOR_PRISM = 1,
737 PRISM2_MONITOR_CAPHDR = 2 737 PRISM2_MONITOR_CAPHDR = 2
738 } monitor_type; 738 } monitor_type;
739 int (*saved_eth_header_parse)(struct sk_buff *skb,
740 unsigned char *haddr);
741 int monitor_allow_fcserr; 739 int monitor_allow_fcserr;
742 740
743 int hostapd; /* whether user space daemon, hostapd, is used for AP 741 int hostapd; /* whether user space daemon, hostapd, is used for AP
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 404cd1512312..4bd14b331862 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -1631,8 +1631,8 @@ static void strip_IdleTask(unsigned long parameter)
1631 */ 1631 */
1632 1632
1633static int strip_header(struct sk_buff *skb, struct net_device *dev, 1633static int strip_header(struct sk_buff *skb, struct net_device *dev,
1634 unsigned short type, void *daddr, void *saddr, 1634 unsigned short type, const void *daddr,
1635 unsigned len) 1635 const void *saddr, unsigned len)
1636{ 1636{
1637 struct strip *strip_info = netdev_priv(dev); 1637 struct strip *strip_info = netdev_priv(dev);
1638 STRIP_Header *header = (STRIP_Header *) skb_push(skb, sizeof(STRIP_Header)); 1638 STRIP_Header *header = (STRIP_Header *) skb_push(skb, sizeof(STRIP_Header));
@@ -2497,6 +2497,11 @@ static int strip_close_low(struct net_device *dev)
2497 return 0; 2497 return 0;
2498} 2498}
2499 2499
2500static const struct header_ops strip_header_ops = {
2501 .create = strip_header,
2502 .rebuild = strip_rebuild_header,
2503};
2504
2500/* 2505/*
2501 * This routine is called by DDI when the 2506 * This routine is called by DDI when the
2502 * (dynamically assigned) device is registered 2507 * (dynamically assigned) device is registered
@@ -2531,8 +2536,8 @@ static void strip_dev_setup(struct net_device *dev)
2531 dev->open = strip_open_low; 2536 dev->open = strip_open_low;
2532 dev->stop = strip_close_low; 2537 dev->stop = strip_close_low;
2533 dev->hard_start_xmit = strip_xmit; 2538 dev->hard_start_xmit = strip_xmit;
2534 dev->hard_header = strip_header; 2539 dev->header_ops = &strip_header_ops;
2535 dev->rebuild_header = strip_rebuild_header; 2540
2536 dev->set_mac_address = strip_set_mac_address; 2541 dev->set_mac_address = strip_set_mac_address;
2537 dev->get_stats = strip_get_stats; 2542 dev->get_stats = strip_get_stats;
2538 dev->change_mtu = strip_change_mtu; 2543 dev->change_mtu = strip_change_mtu;