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