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