1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52#include <linux/module.h>
53#include <linux/kernel.h>
54#include <linux/sched.h>
55#include <linux/types.h>
56#include <linux/skbuff.h>
57#include <linux/slab.h>
58#include <linux/proc_fs.h>
59#include <linux/interrupt.h>
60#include <linux/netdevice.h>
61#include <linux/kmod.h>
62#include <linux/if_arp.h>
63#include <linux/wireless.h>
64#include <linux/sockios.h>
65#include <linux/etherdevice.h>
66#include <linux/if_ether.h>
67#include <linux/byteorder/generic.h>
68#include <linux/bitops.h>
69#include <linux/uaccess.h>
70#include <asm/byteorder.h>
71
72#ifdef SIOCETHTOOL
73#include <linux/ethtool.h>
74#endif
75
76#include <net/iw_handler.h>
77#include <net/net_namespace.h>
78#include <net/cfg80211.h>
79
80#include "p80211types.h"
81#include "p80211hdr.h"
82#include "p80211conv.h"
83#include "p80211mgmt.h"
84#include "p80211msg.h"
85#include "p80211netdev.h"
86#include "p80211ioctl.h"
87#include "p80211req.h"
88#include "p80211metastruct.h"
89#include "p80211metadef.h"
90
91#include "cfg80211.c"
92
93
94static int p80211knetdev_init(struct net_device *netdev);
95static int p80211knetdev_open(struct net_device *netdev);
96static int p80211knetdev_stop(struct net_device *netdev);
97static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
98 struct net_device *netdev);
99static void p80211knetdev_set_multicast_list(struct net_device *dev);
100static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr,
101 int cmd);
102static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr);
103static void p80211knetdev_tx_timeout(struct net_device *netdev);
104static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc);
105
106int wlan_watchdog = 5000;
107module_param(wlan_watchdog, int, 0644);
108MODULE_PARM_DESC(wlan_watchdog, "transmit timeout in milliseconds");
109
110int wlan_wext_write = 1;
111module_param(wlan_wext_write, int, 0644);
112MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions");
113
114
115
116
117
118
119
120
121
122
123
124
125
126static int p80211knetdev_init(struct net_device *netdev)
127{
128
129
130
131
132 return 0;
133}
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149static int p80211knetdev_open(struct net_device *netdev)
150{
151 int result = 0;
152 struct wlandevice *wlandev = netdev->ml_priv;
153
154
155 if (wlandev->msdstate != WLAN_MSD_RUNNING)
156 return -ENODEV;
157
158
159 if (wlandev->open) {
160 result = wlandev->open(wlandev);
161 if (result == 0) {
162 netif_start_queue(wlandev->netdev);
163 wlandev->state = WLAN_DEVICE_OPEN;
164 }
165 } else {
166 result = -EAGAIN;
167 }
168
169 return result;
170}
171
172
173
174
175
176
177
178
179
180
181
182
183
184static int p80211knetdev_stop(struct net_device *netdev)
185{
186 int result = 0;
187 struct wlandevice *wlandev = netdev->ml_priv;
188
189 if (wlandev->close)
190 result = wlandev->close(wlandev);
191
192 netif_stop_queue(wlandev->netdev);
193 wlandev->state = WLAN_DEVICE_CLOSED;
194
195 return result;
196}
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211void p80211netdev_rx(struct wlandevice *wlandev, struct sk_buff *skb)
212{
213
214 skb_queue_tail(&wlandev->nsd_rxq, skb);
215 tasklet_schedule(&wlandev->rx_bh);
216}
217
218#define CONV_TO_ETHER_SKIPPED 0x01
219#define CONV_TO_ETHER_FAILED 0x02
220
221
222
223
224
225
226
227
228
229
230static int p80211_convert_to_ether(struct wlandevice *wlandev, struct sk_buff *skb)
231{
232 struct p80211_hdr_a3 *hdr;
233
234 hdr = (struct p80211_hdr_a3 *)skb->data;
235 if (p80211_rx_typedrop(wlandev, hdr->fc))
236 return CONV_TO_ETHER_SKIPPED;
237
238
239
240
241 if (wlandev->netdev->flags & IFF_ALLMULTI) {
242 if (!ether_addr_equal_unaligned(wlandev->netdev->dev_addr,
243 hdr->a1)) {
244 if (!is_multicast_ether_addr(hdr->a1))
245 return CONV_TO_ETHER_SKIPPED;
246 }
247 }
248
249 if (skb_p80211_to_ether(wlandev, wlandev->ethconv, skb) == 0) {
250 skb->dev->last_rx = jiffies;
251 wlandev->netdev->stats.rx_packets++;
252 wlandev->netdev->stats.rx_bytes += skb->len;
253 netif_rx_ni(skb);
254 return 0;
255 }
256
257 netdev_dbg(wlandev->netdev, "p80211_convert_to_ether failed.\n");
258 return CONV_TO_ETHER_FAILED;
259}
260
261
262
263
264
265
266static void p80211netdev_rx_bh(unsigned long arg)
267{
268 struct wlandevice *wlandev = (struct wlandevice *)arg;
269 struct sk_buff *skb = NULL;
270 struct net_device *dev = wlandev->netdev;
271
272
273 while ((skb = skb_dequeue(&wlandev->nsd_rxq))) {
274 if (wlandev->state == WLAN_DEVICE_OPEN) {
275
276 if (dev->type != ARPHRD_ETHER) {
277
278
279
280
281 skb->dev = dev;
282 skb_reset_mac_header(skb);
283 skb->ip_summed = CHECKSUM_NONE;
284 skb->pkt_type = PACKET_OTHERHOST;
285 skb->protocol = htons(ETH_P_80211_RAW);
286 dev->last_rx = jiffies;
287
288 dev->stats.rx_packets++;
289 dev->stats.rx_bytes += skb->len;
290 netif_rx_ni(skb);
291 continue;
292 } else {
293 if (!p80211_convert_to_ether(wlandev, skb))
294 continue;
295 }
296 }
297 dev_kfree_skb(skb);
298 }
299}
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
321 struct net_device *netdev)
322{
323 int result = 0;
324 int txresult = -1;
325 struct wlandevice *wlandev = netdev->ml_priv;
326 union p80211_hdr p80211_hdr;
327 struct p80211_metawep p80211_wep;
328
329 p80211_wep.data = NULL;
330
331 if (!skb)
332 return NETDEV_TX_OK;
333
334 if (wlandev->state != WLAN_DEVICE_OPEN) {
335 result = 1;
336 goto failed;
337 }
338
339 memset(&p80211_hdr, 0, sizeof(union p80211_hdr));
340 memset(&p80211_wep, 0, sizeof(struct p80211_metawep));
341
342 if (netif_queue_stopped(netdev)) {
343 netdev_dbg(netdev, "called when queue stopped.\n");
344 result = 1;
345 goto failed;
346 }
347
348 netif_stop_queue(netdev);
349
350
351 switch (wlandev->macmode) {
352 case WLAN_MACMODE_IBSS_STA:
353 case WLAN_MACMODE_ESS_STA:
354 case WLAN_MACMODE_ESS_AP:
355 break;
356 default:
357
358
359
360
361 if (be16_to_cpu(skb->protocol) != ETH_P_80211_RAW) {
362 netif_start_queue(wlandev->netdev);
363 netdev_notice(netdev, "Tx attempt prior to association, frame dropped.\n");
364 netdev->stats.tx_dropped++;
365 result = 0;
366 goto failed;
367 }
368 break;
369 }
370
371
372 if (be16_to_cpu(skb->protocol) == ETH_P_80211_RAW) {
373 if (!capable(CAP_NET_ADMIN)) {
374 result = 1;
375 goto failed;
376 }
377
378 memcpy(&p80211_hdr, skb->data, sizeof(union p80211_hdr));
379 skb_pull(skb, sizeof(union p80211_hdr));
380 } else {
381 if (skb_ether_to_p80211
382 (wlandev, wlandev->ethconv, skb, &p80211_hdr,
383 &p80211_wep) != 0) {
384
385 netdev_dbg(netdev, "ether_to_80211(%d) failed.\n",
386 wlandev->ethconv);
387 result = 1;
388 goto failed;
389 }
390 }
391 if (!wlandev->txframe) {
392 result = 1;
393 goto failed;
394 }
395
396 netif_trans_update(netdev);
397
398 netdev->stats.tx_packets++;
399
400 netdev->stats.tx_bytes += skb->len;
401
402 txresult = wlandev->txframe(wlandev, skb, &p80211_hdr, &p80211_wep);
403
404 if (txresult == 0) {
405
406
407 netif_wake_queue(wlandev->netdev);
408 result = NETDEV_TX_OK;
409 } else if (txresult == 1) {
410
411 netdev_dbg(netdev, "txframe success, no more bufs\n");
412
413
414 result = NETDEV_TX_OK;
415 } else if (txresult == 2) {
416
417 netdev_dbg(netdev, "txframe returned alloc_fail\n");
418 result = NETDEV_TX_BUSY;
419 } else {
420
421 netdev_dbg(netdev, "txframe returned full or busy\n");
422 result = NETDEV_TX_BUSY;
423 }
424
425failed:
426
427 if ((p80211_wep.data) && (p80211_wep.data != skb->data))
428 kzfree(p80211_wep.data);
429
430
431 if (!result)
432 dev_kfree_skb(skb);
433
434 return result;
435}
436
437
438
439
440
441
442
443
444
445
446
447
448
449static void p80211knetdev_set_multicast_list(struct net_device *dev)
450{
451 struct wlandevice *wlandev = dev->ml_priv;
452
453
454
455 if (wlandev->set_multicast_list)
456 wlandev->set_multicast_list(wlandev, dev);
457
458}
459
460#ifdef SIOCETHTOOL
461
462static int p80211netdev_ethtool(struct wlandevice *wlandev, void __user *useraddr)
463{
464 u32 ethcmd;
465 struct ethtool_drvinfo info;
466 struct ethtool_value edata;
467
468 memset(&info, 0, sizeof(info));
469 memset(&edata, 0, sizeof(edata));
470
471 if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd)))
472 return -EFAULT;
473
474 switch (ethcmd) {
475 case ETHTOOL_GDRVINFO:
476 info.cmd = ethcmd;
477 snprintf(info.driver, sizeof(info.driver), "p80211_%s",
478 wlandev->nsdname);
479 snprintf(info.version, sizeof(info.version), "%s",
480 WLAN_RELEASE);
481
482 if (copy_to_user(useraddr, &info, sizeof(info)))
483 return -EFAULT;
484 return 0;
485#ifdef ETHTOOL_GLINK
486 case ETHTOOL_GLINK:
487 edata.cmd = ethcmd;
488
489 if (wlandev->linkstatus &&
490 (wlandev->macmode != WLAN_MACMODE_NONE)) {
491 edata.data = 1;
492 } else {
493 edata.data = 0;
494 }
495
496 if (copy_to_user(useraddr, &edata, sizeof(edata)))
497 return -EFAULT;
498 return 0;
499#endif
500 }
501
502 return -EOPNOTSUPP;
503}
504
505#endif
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534static int p80211knetdev_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
535{
536 int result = 0;
537 struct p80211ioctl_req *req = (struct p80211ioctl_req *)ifr;
538 struct wlandevice *wlandev = dev->ml_priv;
539 u8 *msgbuf;
540
541 netdev_dbg(dev, "rx'd ioctl, cmd=%d, len=%d\n", cmd, req->len);
542
543#ifdef SIOCETHTOOL
544 if (cmd == SIOCETHTOOL) {
545 result =
546 p80211netdev_ethtool(wlandev, (void __user *)ifr->ifr_data);
547 goto bail;
548 }
549#endif
550
551
552 if (req->magic != P80211_IOCTL_MAGIC) {
553 result = -ENOSYS;
554 goto bail;
555 }
556
557 if (cmd == P80211_IFTEST) {
558 result = 0;
559 goto bail;
560 } else if (cmd != P80211_IFREQ) {
561 result = -ENOSYS;
562 goto bail;
563 }
564
565
566 msgbuf = kmalloc(req->len, GFP_KERNEL);
567 if (msgbuf) {
568 if (copy_from_user(msgbuf, (void __user *)req->data, req->len))
569 result = -EFAULT;
570 else
571 result = p80211req_dorequest(wlandev, msgbuf);
572
573 if (result == 0) {
574 if (copy_to_user
575 ((void __user *)req->data, msgbuf, req->len)) {
576 result = -EFAULT;
577 }
578 }
579 kfree(msgbuf);
580 } else {
581 result = -ENOMEM;
582 }
583bail:
584
585 return result;
586}
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr)
614{
615 struct sockaddr *new_addr = addr;
616 struct p80211msg_dot11req_mibset dot11req;
617 struct p80211item_unk392 *mibattr;
618 struct p80211item_pstr6 *macaddr;
619 struct p80211item_uint32 *resultcode;
620 int result;
621
622
623 if (netif_running(dev))
624 return -EBUSY;
625
626
627 mibattr = &dot11req.mibattribute;
628 macaddr = (struct p80211item_pstr6 *)&mibattr->data;
629 resultcode = &dot11req.resultcode;
630
631
632 memset(&dot11req, 0, sizeof(struct p80211msg_dot11req_mibset));
633 dot11req.msgcode = DIDmsg_dot11req_mibset;
634 dot11req.msglen = sizeof(struct p80211msg_dot11req_mibset);
635 memcpy(dot11req.devname,
636 ((struct wlandevice *)dev->ml_priv)->name, WLAN_DEVNAMELEN_MAX - 1);
637
638
639 mibattr->did = DIDmsg_dot11req_mibset_mibattribute;
640 mibattr->status = P80211ENUM_msgitem_status_data_ok;
641 mibattr->len = sizeof(mibattr->data);
642
643 macaddr->did = DIDmib_dot11mac_dot11OperationTable_dot11MACAddress;
644 macaddr->status = P80211ENUM_msgitem_status_data_ok;
645 macaddr->len = sizeof(macaddr->data);
646 macaddr->data.len = ETH_ALEN;
647 memcpy(&macaddr->data.data, new_addr->sa_data, ETH_ALEN);
648
649
650 resultcode->did = DIDmsg_dot11req_mibset_resultcode;
651 resultcode->status = P80211ENUM_msgitem_status_no_value;
652 resultcode->len = sizeof(resultcode->data);
653 resultcode->data = 0;
654
655
656 result = p80211req_dorequest(dev->ml_priv, (u8 *)&dot11req);
657
658
659
660
661 if (result != 0 || resultcode->data != P80211ENUM_resultcode_success) {
662 netdev_err(dev, "Low-level driver failed dot11req_mibset(dot11MACAddress).\n");
663 result = -EADDRNOTAVAIL;
664 } else {
665
666 memcpy(dev->dev_addr, new_addr->sa_data, dev->addr_len);
667 }
668
669 return result;
670}
671
672static int wlan_change_mtu(struct net_device *dev, int new_mtu)
673{
674
675
676 if ((new_mtu < 68) || (new_mtu > (2312 - 20 - 8)))
677 return -EINVAL;
678
679 dev->mtu = new_mtu;
680
681 return 0;
682}
683
684static const struct net_device_ops p80211_netdev_ops = {
685 .ndo_init = p80211knetdev_init,
686 .ndo_open = p80211knetdev_open,
687 .ndo_stop = p80211knetdev_stop,
688 .ndo_start_xmit = p80211knetdev_hard_start_xmit,
689 .ndo_set_rx_mode = p80211knetdev_set_multicast_list,
690 .ndo_do_ioctl = p80211knetdev_do_ioctl,
691 .ndo_set_mac_address = p80211knetdev_set_mac_address,
692 .ndo_tx_timeout = p80211knetdev_tx_timeout,
693 .ndo_change_mtu = wlan_change_mtu,
694 .ndo_validate_addr = eth_validate_addr,
695};
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720int wlan_setup(struct wlandevice *wlandev, struct device *physdev)
721{
722 int result = 0;
723 struct net_device *netdev;
724 struct wiphy *wiphy;
725 struct wireless_dev *wdev;
726
727
728 wlandev->state = WLAN_DEVICE_CLOSED;
729 wlandev->ethconv = WLAN_ETHCONV_8021h;
730 wlandev->macmode = WLAN_MACMODE_NONE;
731
732
733 skb_queue_head_init(&wlandev->nsd_rxq);
734 tasklet_init(&wlandev->rx_bh,
735 p80211netdev_rx_bh, (unsigned long)wlandev);
736
737
738 wiphy = wlan_create_wiphy(physdev, wlandev);
739 if (!wiphy) {
740 dev_err(physdev, "Failed to alloc wiphy.\n");
741 return 1;
742 }
743
744
745 netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d",
746 NET_NAME_UNKNOWN, ether_setup);
747 if (!netdev) {
748 dev_err(physdev, "Failed to alloc netdev.\n");
749 wlan_free_wiphy(wiphy);
750 result = 1;
751 } else {
752 wlandev->netdev = netdev;
753 netdev->ml_priv = wlandev;
754 netdev->netdev_ops = &p80211_netdev_ops;
755 wdev = netdev_priv(netdev);
756 wdev->wiphy = wiphy;
757 wdev->iftype = NL80211_IFTYPE_STATION;
758 netdev->ieee80211_ptr = wdev;
759
760 netif_stop_queue(netdev);
761 netif_carrier_off(netdev);
762 }
763
764 return result;
765}
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786void wlan_unsetup(struct wlandevice *wlandev)
787{
788 struct wireless_dev *wdev;
789
790 tasklet_kill(&wlandev->rx_bh);
791
792 if (wlandev->netdev) {
793 wdev = netdev_priv(wlandev->netdev);
794 if (wdev->wiphy)
795 wlan_free_wiphy(wdev->wiphy);
796 free_netdev(wlandev->netdev);
797 wlandev->netdev = NULL;
798 }
799}
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820int register_wlandev(struct wlandevice *wlandev)
821{
822 return register_netdev(wlandev->netdev);
823}
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842int unregister_wlandev(struct wlandevice *wlandev)
843{
844 struct sk_buff *skb;
845
846 unregister_netdev(wlandev->netdev);
847
848
849 while ((skb = skb_dequeue(&wlandev->nsd_rxq)))
850 dev_kfree_skb(skb);
851
852 return 0;
853}
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885void p80211netdev_hwremoved(struct wlandevice *wlandev)
886{
887 wlandev->hwremoved = 1;
888 if (wlandev->state == WLAN_DEVICE_OPEN)
889 netif_stop_queue(wlandev->netdev);
890
891 netif_device_detach(wlandev->netdev);
892}
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915static int p80211_rx_typedrop(struct wlandevice *wlandev, u16 fc)
916{
917 u16 ftype;
918 u16 fstype;
919 int drop = 0;
920
921 ftype = WLAN_GET_FC_FTYPE(fc);
922 fstype = WLAN_GET_FC_FSTYPE(fc);
923#if 0
924 netdev_dbg(wlandev->netdev, "rx_typedrop : ftype=%d fstype=%d.\n",
925 ftype, fstype);
926#endif
927 switch (ftype) {
928 case WLAN_FTYPE_MGMT:
929 if ((wlandev->netdev->flags & IFF_PROMISC) ||
930 (wlandev->netdev->flags & IFF_ALLMULTI)) {
931 drop = 1;
932 break;
933 }
934 netdev_dbg(wlandev->netdev, "rx'd mgmt:\n");
935 wlandev->rx.mgmt++;
936 switch (fstype) {
937 case WLAN_FSTYPE_ASSOCREQ:
938
939 wlandev->rx.assocreq++;
940 break;
941 case WLAN_FSTYPE_ASSOCRESP:
942
943 wlandev->rx.assocresp++;
944 break;
945 case WLAN_FSTYPE_REASSOCREQ:
946
947 wlandev->rx.reassocreq++;
948 break;
949 case WLAN_FSTYPE_REASSOCRESP:
950
951 wlandev->rx.reassocresp++;
952 break;
953 case WLAN_FSTYPE_PROBEREQ:
954
955 wlandev->rx.probereq++;
956 break;
957 case WLAN_FSTYPE_PROBERESP:
958
959 wlandev->rx.proberesp++;
960 break;
961 case WLAN_FSTYPE_BEACON:
962
963 wlandev->rx.beacon++;
964 break;
965 case WLAN_FSTYPE_ATIM:
966
967 wlandev->rx.atim++;
968 break;
969 case WLAN_FSTYPE_DISASSOC:
970
971 wlandev->rx.disassoc++;
972 break;
973 case WLAN_FSTYPE_AUTHEN:
974
975 wlandev->rx.authen++;
976 break;
977 case WLAN_FSTYPE_DEAUTHEN:
978
979 wlandev->rx.deauthen++;
980 break;
981 default:
982
983 wlandev->rx.mgmt_unknown++;
984 break;
985 }
986
987 drop = 2;
988 break;
989
990 case WLAN_FTYPE_CTL:
991 if ((wlandev->netdev->flags & IFF_PROMISC) ||
992 (wlandev->netdev->flags & IFF_ALLMULTI)) {
993 drop = 1;
994 break;
995 }
996 netdev_dbg(wlandev->netdev, "rx'd ctl:\n");
997 wlandev->rx.ctl++;
998 switch (fstype) {
999 case WLAN_FSTYPE_PSPOLL:
1000
1001 wlandev->rx.pspoll++;
1002 break;
1003 case WLAN_FSTYPE_RTS:
1004
1005 wlandev->rx.rts++;
1006 break;
1007 case WLAN_FSTYPE_CTS:
1008
1009 wlandev->rx.cts++;
1010 break;
1011 case WLAN_FSTYPE_ACK:
1012
1013 wlandev->rx.ack++;
1014 break;
1015 case WLAN_FSTYPE_CFEND:
1016
1017 wlandev->rx.cfend++;
1018 break;
1019 case WLAN_FSTYPE_CFENDCFACK:
1020
1021 wlandev->rx.cfendcfack++;
1022 break;
1023 default:
1024
1025 wlandev->rx.ctl_unknown++;
1026 break;
1027 }
1028
1029 drop = 2;
1030 break;
1031
1032 case WLAN_FTYPE_DATA:
1033 wlandev->rx.data++;
1034 switch (fstype) {
1035 case WLAN_FSTYPE_DATAONLY:
1036 wlandev->rx.dataonly++;
1037 break;
1038 case WLAN_FSTYPE_DATA_CFACK:
1039 wlandev->rx.data_cfack++;
1040 break;
1041 case WLAN_FSTYPE_DATA_CFPOLL:
1042 wlandev->rx.data_cfpoll++;
1043 break;
1044 case WLAN_FSTYPE_DATA_CFACK_CFPOLL:
1045 wlandev->rx.data__cfack_cfpoll++;
1046 break;
1047 case WLAN_FSTYPE_NULL:
1048 netdev_dbg(wlandev->netdev, "rx'd data:null\n");
1049 wlandev->rx.null++;
1050 break;
1051 case WLAN_FSTYPE_CFACK:
1052 netdev_dbg(wlandev->netdev, "rx'd data:cfack\n");
1053 wlandev->rx.cfack++;
1054 break;
1055 case WLAN_FSTYPE_CFPOLL:
1056 netdev_dbg(wlandev->netdev, "rx'd data:cfpoll\n");
1057 wlandev->rx.cfpoll++;
1058 break;
1059 case WLAN_FSTYPE_CFACK_CFPOLL:
1060 netdev_dbg(wlandev->netdev, "rx'd data:cfack_cfpoll\n");
1061 wlandev->rx.cfack_cfpoll++;
1062 break;
1063 default:
1064
1065 wlandev->rx.data_unknown++;
1066 break;
1067 }
1068
1069 break;
1070 }
1071 return drop;
1072}
1073
1074static void p80211knetdev_tx_timeout(struct net_device *netdev)
1075{
1076 struct wlandevice *wlandev = netdev->ml_priv;
1077
1078 if (wlandev->tx_timeout) {
1079 wlandev->tx_timeout(wlandev);
1080 } else {
1081 netdev_warn(netdev, "Implement tx_timeout for %s\n",
1082 wlandev->nsdname);
1083 netif_wake_queue(wlandev->netdev);
1084 }
1085}
1086