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
54
55
56
57#include <linux/module.h>
58#include <linux/moduleparam.h>
59#include <linux/kernel.h>
60#include <linux/types.h>
61#include <linux/init.h>
62#include <linux/skbuff.h>
63#include <linux/netdevice.h>
64#include <linux/slab.h>
65#include <linux/rtnetlink.h>
66#include <linux/usb.h>
67#include <linux/firmware.h>
68
69#include "irda-usb.h"
70
71
72
73static int qos_mtt_bits = 0;
74
75
76static struct usb_device_id dongles[] = {
77
78 { USB_DEVICE(0x9c4, 0x011), .driver_info = IUC_SPEED_BUG | IUC_NO_WINDOW },
79
80 { USB_DEVICE(0x4428, 0x012), .driver_info = IUC_SPEED_BUG | IUC_NO_WINDOW },
81
82 { USB_DEVICE(0x50f, 0x180), .driver_info = IUC_SPEED_BUG | IUC_NO_WINDOW },
83
84 { USB_DEVICE(0x8e9, 0x100), .driver_info = IUC_SPEED_BUG | IUC_NO_WINDOW },
85
86 { USB_DEVICE(0x66f, 0x4210), .driver_info = IUC_STIR421X | IUC_SPEED_BUG },
87 { USB_DEVICE(0x66f, 0x4220), .driver_info = IUC_STIR421X | IUC_SPEED_BUG },
88 { USB_DEVICE(0x66f, 0x4116), .driver_info = IUC_STIR421X | IUC_SPEED_BUG },
89 { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS |
90 USB_DEVICE_ID_MATCH_INT_SUBCLASS,
91 .bInterfaceClass = USB_CLASS_APP_SPEC,
92 .bInterfaceSubClass = USB_CLASS_IRDA,
93 .driver_info = IUC_DEFAULT, },
94 { },
95};
96
97
98
99
100
101
102
103
104
105
106MODULE_DEVICE_TABLE(usb, dongles);
107
108
109
110static void irda_usb_init_qos(struct irda_usb_cb *self) ;
111static struct irda_class_desc *irda_usb_find_class_desc(struct usb_interface *intf);
112static void irda_usb_disconnect(struct usb_interface *intf);
113static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self);
114static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *dev);
115static int irda_usb_open(struct irda_usb_cb *self);
116static void irda_usb_close(struct irda_usb_cb *self);
117static void speed_bulk_callback(struct urb *urb);
118static void write_bulk_callback(struct urb *urb);
119static void irda_usb_receive(struct urb *urb);
120static void irda_usb_rx_defer_expired(unsigned long data);
121static int irda_usb_net_open(struct net_device *dev);
122static int irda_usb_net_close(struct net_device *dev);
123static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
124static void irda_usb_net_timeout(struct net_device *dev);
125static struct net_device_stats *irda_usb_net_get_stats(struct net_device *dev);
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149static void irda_usb_build_header(struct irda_usb_cb *self,
150 __u8 *header,
151 int force)
152{
153
154
155
156
157 if (self->capability & IUC_STIR421X &&
158 ((self->new_speed != -1) || (self->new_xbofs != -1))) {
159
160
161
162
163 if (self->new_speed == -1)
164 self->new_speed = self->speed ;
165
166 if (self->new_xbofs == -1)
167 self->new_xbofs = self->xbofs ;
168 }
169
170
171 if (self->new_speed != -1) {
172
173
174
175
176 if ((self->capability & IUC_SPEED_BUG) &&
177 (!force) && (self->speed != -1)) {
178
179
180 IRDA_DEBUG(2, "%s(), not changing speed yet\n", __func__);
181 *header = 0;
182 return;
183 }
184
185 IRDA_DEBUG(2, "%s(), changing speed to %d\n", __func__, self->new_speed);
186 self->speed = self->new_speed;
187
188
189
190 switch (self->speed) {
191 case 2400:
192 *header = SPEED_2400;
193 break;
194 default:
195 case 9600:
196 *header = SPEED_9600;
197 break;
198 case 19200:
199 *header = SPEED_19200;
200 break;
201 case 38400:
202 *header = SPEED_38400;
203 break;
204 case 57600:
205 *header = SPEED_57600;
206 break;
207 case 115200:
208 *header = SPEED_115200;
209 break;
210 case 576000:
211 *header = SPEED_576000;
212 break;
213 case 1152000:
214 *header = SPEED_1152000;
215 break;
216 case 4000000:
217 *header = SPEED_4000000;
218 self->new_xbofs = 0;
219 break;
220 case 16000000:
221 *header = SPEED_16000000;
222 self->new_xbofs = 0;
223 break;
224 }
225 } else
226
227 *header = 0;
228
229
230 if (self->new_xbofs != -1) {
231 IRDA_DEBUG(2, "%s(), changing xbofs to %d\n", __func__, self->new_xbofs);
232 self->xbofs = self->new_xbofs;
233
234
235
236 switch (self->xbofs) {
237 case 48:
238 *header |= 0x10;
239 break;
240 case 28:
241 case 24:
242 *header |= 0x20;
243 break;
244 default:
245 case 12:
246 *header |= 0x30;
247 break;
248 case 5:
249 case 6:
250 *header |= 0x40;
251 break;
252 case 3:
253 *header |= 0x50;
254 break;
255 case 2:
256 *header |= 0x60;
257 break;
258 case 1:
259 *header |= 0x70;
260 break;
261 case 0:
262 *header |= 0x80;
263 break;
264 }
265 }
266}
267
268
269
270
271static __u8 get_turnaround_time(struct sk_buff *skb)
272{
273 int turnaround_time = irda_get_mtt(skb);
274
275 if ( turnaround_time == 0 )
276 return 0;
277 else if ( turnaround_time <= 10 )
278 return 1;
279 else if ( turnaround_time <= 50 )
280 return 2;
281 else if ( turnaround_time <= 100 )
282 return 3;
283 else if ( turnaround_time <= 500 )
284 return 4;
285 else if ( turnaround_time <= 1000 )
286 return 5;
287 else if ( turnaround_time <= 5000 )
288 return 6;
289 else
290 return 7;
291}
292
293
294
295
296
297
298
299static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
300{
301 __u8 *frame;
302 struct urb *urb;
303 int ret;
304
305 IRDA_DEBUG(2, "%s(), speed=%d, xbofs=%d\n", __func__,
306 self->new_speed, self->new_xbofs);
307
308
309 urb = self->speed_urb;
310 if (urb->status != 0) {
311 IRDA_WARNING("%s(), URB still in use!\n", __func__);
312 return;
313 }
314
315
316 frame = self->speed_buff;
317
318
319 irda_usb_build_header(self, frame, 1);
320
321 if (self->capability & IUC_STIR421X) {
322 if (frame[0] == 0) return ;
323 frame[1] = 0;
324 frame[2] = 0;
325 }
326
327
328 usb_fill_bulk_urb(urb, self->usbdev,
329 usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
330 frame, IRDA_USB_SPEED_MTU,
331 speed_bulk_callback, self);
332 urb->transfer_buffer_length = self->header_length;
333 urb->transfer_flags = 0;
334
335
336 if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) {
337 IRDA_WARNING("%s(), failed Speed URB\n", __func__);
338 }
339}
340
341
342
343
344
345
346static void speed_bulk_callback(struct urb *urb)
347{
348 struct irda_usb_cb *self = urb->context;
349
350 IRDA_DEBUG(2, "%s()\n", __func__);
351
352
353 IRDA_ASSERT(self != NULL, return;);
354
355 IRDA_ASSERT(urb == self->speed_urb, return;);
356
357
358 if (urb->status != 0) {
359
360 IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __func__, urb->status, urb->transfer_flags);
361
362
363
364
365
366
367 return;
368 }
369
370
371
372
373
374 self->new_speed = -1;
375 self->new_xbofs = -1;
376
377
378 netif_wake_queue(self->netdev);
379}
380
381
382
383
384
385static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
386{
387 struct irda_usb_cb *self = netdev->priv;
388 struct urb *urb = self->tx_urb;
389 unsigned long flags;
390 s32 speed;
391 s16 xbofs;
392 int res, mtt;
393 int err = 1;
394
395 IRDA_DEBUG(4, "%s() on %s\n", __func__, netdev->name);
396
397 netif_stop_queue(netdev);
398
399
400 spin_lock_irqsave(&self->lock, flags);
401
402
403
404
405 if (!self->present) {
406 IRDA_DEBUG(0, "%s(), Device is gone...\n", __func__);
407 goto drop;
408 }
409
410
411 xbofs = irda_get_next_xbofs(skb);
412 if ((xbofs != self->xbofs) && (xbofs != -1)) {
413 self->new_xbofs = xbofs;
414 }
415
416
417 speed = irda_get_next_speed(skb);
418 if ((speed != self->speed) && (speed != -1)) {
419
420 self->new_speed = speed;
421
422
423 if (!skb->len) {
424
425
426
427
428
429
430
431 irda_usb_change_speed_xbofs(self);
432 netdev->trans_start = jiffies;
433
434 err = 0;
435 goto drop;
436 }
437 }
438
439 if (urb->status != 0) {
440 IRDA_WARNING("%s(), URB still in use!\n", __func__);
441 goto drop;
442 }
443
444 skb_copy_from_linear_data(skb, self->tx_buff + self->header_length, skb->len);
445
446
447 if (self->capability & IUC_STIR421X) {
448 __u8 turnaround_time;
449 __u8* frame = self->tx_buff;
450 turnaround_time = get_turnaround_time( skb );
451 irda_usb_build_header(self, frame, 0);
452 frame[2] = turnaround_time;
453 if ((skb->len != 0) &&
454 ((skb->len % 128) == 0) &&
455 ((skb->len % 512) != 0)) {
456
457 frame[1] = 1;
458 skb_put(skb, 1);
459 } else {
460 frame[1] = 0;
461 }
462 } else {
463 irda_usb_build_header(self, self->tx_buff, 0);
464 }
465
466
467 ((struct irda_skb_cb *)skb->cb)->context = self;
468
469 usb_fill_bulk_urb(urb, self->usbdev,
470 usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
471 self->tx_buff, skb->len + self->header_length,
472 write_bulk_callback, skb);
473
474
475
476
477
478
479 urb->transfer_flags = URB_ZERO_PACKET;
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495 if (self->capability & IUC_NO_TURN) {
496 mtt = irda_get_mtt(skb);
497 if (mtt) {
498 int diff;
499 do_gettimeofday(&self->now);
500 diff = self->now.tv_usec - self->stamp.tv_usec;
501#ifdef IU_USB_MIN_RTT
502
503
504 diff += IU_USB_MIN_RTT;
505#endif
506
507
508
509 if (diff < 0)
510 diff += 1000000;
511
512
513
514
515 if (mtt > diff) {
516 mtt -= diff;
517 if (mtt > 1000)
518 mdelay(mtt/1000);
519 else
520 udelay(mtt);
521 }
522 }
523 }
524
525
526 if ((res = usb_submit_urb(urb, GFP_ATOMIC))) {
527 IRDA_WARNING("%s(), failed Tx URB\n", __func__);
528 self->stats.tx_errors++;
529
530
531 } else {
532
533 self->stats.tx_packets++;
534 self->stats.tx_bytes += skb->len;
535
536 netdev->trans_start = jiffies;
537 }
538 spin_unlock_irqrestore(&self->lock, flags);
539
540 return 0;
541
542drop:
543
544 dev_kfree_skb(skb);
545 spin_unlock_irqrestore(&self->lock, flags);
546 return err;
547}
548
549
550
551
552
553static void write_bulk_callback(struct urb *urb)
554{
555 unsigned long flags;
556 struct sk_buff *skb = urb->context;
557 struct irda_usb_cb *self = ((struct irda_skb_cb *) skb->cb)->context;
558
559 IRDA_DEBUG(2, "%s()\n", __func__);
560
561
562 IRDA_ASSERT(self != NULL, return;);
563
564 IRDA_ASSERT(urb == self->tx_urb, return;);
565
566
567 dev_kfree_skb_any(skb);
568 urb->context = NULL;
569
570
571 if (urb->status != 0) {
572
573 IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __func__, urb->status, urb->transfer_flags);
574
575
576
577
578
579
580
581 return;
582 }
583
584
585
586
587
588 spin_lock_irqsave(&self->lock, flags);
589
590
591 if ((!self->netopen) || (!self->present)) {
592 IRDA_DEBUG(0, "%s(), Network is gone...\n", __func__);
593 spin_unlock_irqrestore(&self->lock, flags);
594 return;
595 }
596
597
598 if ((self->new_speed != -1) || (self->new_xbofs != -1)) {
599 if ((self->new_speed != self->speed) ||
600 (self->new_xbofs != self->xbofs)) {
601
602
603 IRDA_DEBUG(1, "%s(), Changing speed now...\n", __func__);
604 irda_usb_change_speed_xbofs(self);
605 } else {
606
607 self->new_speed = -1;
608 self->new_xbofs = -1;
609
610 netif_wake_queue(self->netdev);
611 }
612 } else {
613
614 netif_wake_queue(self->netdev);
615 }
616 spin_unlock_irqrestore(&self->lock, flags);
617}
618
619
620
621
622
623
624
625
626
627
628static void irda_usb_net_timeout(struct net_device *netdev)
629{
630 unsigned long flags;
631 struct irda_usb_cb *self = netdev->priv;
632 struct urb *urb;
633 int done = 0;
634
635 IRDA_DEBUG(0, "%s(), Network layer thinks we timed out!\n", __func__);
636 IRDA_ASSERT(self != NULL, return;);
637
638
639 spin_lock_irqsave(&self->lock, flags);
640
641
642 if (!self->present) {
643 IRDA_WARNING("%s(), device not present!\n", __func__);
644 netif_stop_queue(netdev);
645 spin_unlock_irqrestore(&self->lock, flags);
646 return;
647 }
648
649
650 urb = self->speed_urb;
651 if (urb->status != 0) {
652 IRDA_DEBUG(0, "%s: Speed change timed out, urb->status=%d, urb->transfer_flags=0x%04X\n", netdev->name, urb->status, urb->transfer_flags);
653
654 switch (urb->status) {
655 case -EINPROGRESS:
656 usb_unlink_urb(urb);
657
658
659
660 done = 1;
661 break;
662 case -ECONNRESET:
663 case -ENOENT:
664 default:
665 urb->status = 0;
666 netif_wake_queue(self->netdev);
667 done = 1;
668 break;
669 }
670 }
671
672
673 urb = self->tx_urb;
674 if (urb->status != 0) {
675 struct sk_buff *skb = urb->context;
676
677 IRDA_DEBUG(0, "%s: Tx timed out, urb->status=%d, urb->transfer_flags=0x%04X\n", netdev->name, urb->status, urb->transfer_flags);
678
679
680 self->stats.tx_errors++;
681
682#ifdef IU_BUG_KICK_TIMEOUT
683
684 if(self->new_speed == -1)
685 self->new_speed = self->speed;
686 if(self->new_xbofs == -1)
687 self->new_xbofs = self->xbofs;
688 irda_usb_change_speed_xbofs(self);
689#endif
690
691 switch (urb->status) {
692 case -EINPROGRESS:
693 usb_unlink_urb(urb);
694
695
696
697
698
699 done = 1;
700 break;
701 case -ECONNRESET:
702 case -ENOENT:
703 default:
704 if(skb != NULL) {
705 dev_kfree_skb_any(skb);
706 urb->context = NULL;
707 }
708 urb->status = 0;
709 netif_wake_queue(self->netdev);
710 done = 1;
711 break;
712 }
713 }
714 spin_unlock_irqrestore(&self->lock, flags);
715
716
717
718
719
720
721
722}
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struct urb *urb)
762{
763 struct irda_skb_cb *cb;
764 int ret;
765
766 IRDA_DEBUG(2, "%s()\n", __func__);
767
768
769 IRDA_ASSERT(skb != NULL, return;);
770 IRDA_ASSERT(urb != NULL, return;);
771
772
773 cb = (struct irda_skb_cb *) skb->cb;
774 cb->context = self;
775
776
777 usb_fill_bulk_urb(urb, self->usbdev,
778 usb_rcvbulkpipe(self->usbdev, self->bulk_in_ep),
779 skb->data, IRDA_SKB_MAX_MTU,
780 irda_usb_receive, skb);
781 urb->status = 0;
782
783
784 ret = usb_submit_urb(urb, GFP_ATOMIC);
785 if (ret) {
786
787
788 IRDA_WARNING("%s(), Failed to submit Rx URB %d\n",
789 __func__, ret);
790 }
791}
792
793
794
795
796
797
798
799
800static void irda_usb_receive(struct urb *urb)
801{
802 struct sk_buff *skb = (struct sk_buff *) urb->context;
803 struct irda_usb_cb *self;
804 struct irda_skb_cb *cb;
805 struct sk_buff *newskb;
806 struct sk_buff *dataskb;
807 struct urb *next_urb;
808 unsigned int len, docopy;
809
810 IRDA_DEBUG(2, "%s(), len=%d\n", __func__, urb->actual_length);
811
812
813 cb = (struct irda_skb_cb *) skb->cb;
814 IRDA_ASSERT(cb != NULL, return;);
815 self = (struct irda_usb_cb *) cb->context;
816 IRDA_ASSERT(self != NULL, return;);
817
818
819 if ((!self->netopen) || (!self->present)) {
820 IRDA_DEBUG(0, "%s(), Network is gone!\n", __func__);
821
822 return;
823 }
824
825
826 if (urb->status != 0) {
827 switch (urb->status) {
828 case -EILSEQ:
829 self->stats.rx_crc_errors++;
830
831
832 case -ECONNRESET:
833
834
835
836
837 case -ESHUTDOWN:
838
839 case -ETIME:
840
841 default:
842 self->stats.rx_errors++;
843 IRDA_DEBUG(0, "%s(), RX status %d, transfer_flags 0x%04X \n", __func__, urb->status, urb->transfer_flags);
844 break;
845 }
846
847
848
849
850
851
852
853
854
855
856 self->rx_defer_timer.function = &irda_usb_rx_defer_expired;
857 self->rx_defer_timer.data = (unsigned long) urb;
858 mod_timer(&self->rx_defer_timer, jiffies + (10 * HZ / 1000));
859 return;
860 }
861
862
863 if (urb->actual_length <= self->header_length) {
864 IRDA_WARNING("%s(), empty frame!\n", __func__);
865 goto done;
866 }
867
868
869
870
871
872
873 do_gettimeofday(&self->stamp);
874
875
876
877
878
879
880
881 docopy = (urb->actual_length < IRDA_RX_COPY_THRESHOLD);
882
883
884 if (self->capability & IUC_STIR421X)
885 newskb = dev_alloc_skb(docopy ? urb->actual_length :
886 IRDA_SKB_MAX_MTU +
887 USB_IRDA_STIR421X_HEADER);
888 else
889 newskb = dev_alloc_skb(docopy ? urb->actual_length :
890 IRDA_SKB_MAX_MTU);
891
892 if (!newskb) {
893 self->stats.rx_dropped++;
894
895
896 goto done;
897 }
898
899
900
901
902
903 if(docopy) {
904
905 skb_copy_from_linear_data(skb, newskb->data, urb->actual_length);
906
907 dataskb = newskb;
908
909
910
911 } else {
912
913 dataskb = skb;
914
915 skb = newskb;
916 }
917
918
919 skb_put(dataskb, urb->actual_length);
920 skb_pull(dataskb, self->header_length);
921
922
923 dataskb->dev = self->netdev;
924 skb_reset_mac_header(dataskb);
925 dataskb->protocol = htons(ETH_P_IRDA);
926 len = dataskb->len;
927 netif_rx(dataskb);
928
929
930 self->stats.rx_bytes += len;
931 self->stats.rx_packets++;
932 self->netdev->last_rx = jiffies;
933
934done:
935
936
937
938
939
940
941
942
943
944
945
946 next_urb = self->idle_rx_urb;
947
948
949 urb->context = NULL;
950 self->idle_rx_urb = urb;
951
952
953
954 irda_usb_submit(self, skb, next_urb);
955}
956
957
958
959
960
961
962static void irda_usb_rx_defer_expired(unsigned long data)
963{
964 struct urb *urb = (struct urb *) data;
965 struct sk_buff *skb = (struct sk_buff *) urb->context;
966 struct irda_usb_cb *self;
967 struct irda_skb_cb *cb;
968 struct urb *next_urb;
969
970 IRDA_DEBUG(2, "%s()\n", __func__);
971
972
973 cb = (struct irda_skb_cb *) skb->cb;
974 IRDA_ASSERT(cb != NULL, return;);
975 self = (struct irda_usb_cb *) cb->context;
976 IRDA_ASSERT(self != NULL, return;);
977
978
979 next_urb = self->idle_rx_urb;
980 urb->context = NULL;
981 self->idle_rx_urb = urb;
982 irda_usb_submit(self, skb, next_urb);
983}
984
985
986
987
988
989
990static int irda_usb_is_receiving(struct irda_usb_cb *self)
991{
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009 return 0;
1010}
1011
1012#define STIR421X_PATCH_PRODUCT_VER "Product Version: "
1013#define STIR421X_PATCH_STMP_TAG "STMP"
1014#define STIR421X_PATCH_CODE_OFFSET 512
1015
1016#define STIR421X_PATCH_END_OF_HDR_TAG 0x1A
1017#define STIR421X_PATCH_BLOCK_SIZE 1023
1018
1019
1020
1021
1022
1023
1024
1025
1026static int stir421x_fw_upload(struct irda_usb_cb *self,
1027 const unsigned char *patch,
1028 const unsigned int patch_len)
1029{
1030 int ret = -ENOMEM;
1031 int actual_len = 0;
1032 unsigned int i;
1033 unsigned int block_size = 0;
1034 unsigned char *patch_block;
1035
1036 patch_block = kzalloc(STIR421X_PATCH_BLOCK_SIZE, GFP_KERNEL);
1037 if (patch_block == NULL)
1038 return -ENOMEM;
1039
1040
1041 for (i = 0; i < patch_len; i += block_size) {
1042 block_size = patch_len - i;
1043
1044 if (block_size > STIR421X_PATCH_BLOCK_SIZE)
1045 block_size = STIR421X_PATCH_BLOCK_SIZE;
1046
1047
1048 memcpy(patch_block, patch + i, block_size);
1049
1050 ret = usb_bulk_msg(self->usbdev,
1051 usb_sndbulkpipe(self->usbdev,
1052 self->bulk_out_ep),
1053 patch_block, block_size,
1054 &actual_len, msecs_to_jiffies(500));
1055 IRDA_DEBUG(3,"%s(): Bulk send %u bytes, ret=%d\n",
1056 __func__, actual_len, ret);
1057
1058 if (ret < 0)
1059 break;
1060
1061 mdelay(10);
1062 }
1063
1064 kfree(patch_block);
1065
1066 return ret;
1067 }
1068
1069
1070
1071
1072
1073
1074static int stir421x_patch_device(struct irda_usb_cb *self)
1075{
1076 unsigned int i;
1077 int ret;
1078 char stir421x_fw_name[11];
1079 const struct firmware *fw;
1080 const unsigned char *fw_version_ptr;
1081 unsigned long fw_version = 0;
1082
1083
1084
1085
1086
1087 sprintf(stir421x_fw_name, "4210%4X.sb",
1088 self->usbdev->descriptor.bcdDevice);
1089 ret = request_firmware(&fw, stir421x_fw_name, &self->usbdev->dev);
1090 if (ret < 0)
1091 return ret;
1092
1093
1094 IRDA_MESSAGE("%s(): Received firmware %s (%zu bytes)\n",
1095 __func__, stir421x_fw_name, fw->size);
1096
1097 ret = -EINVAL;
1098
1099
1100 if (!memcmp(fw->data, STIR421X_PATCH_PRODUCT_VER,
1101 sizeof(STIR421X_PATCH_PRODUCT_VER) - 1)) {
1102 fw_version_ptr = fw->data +
1103 sizeof(STIR421X_PATCH_PRODUCT_VER) - 1;
1104
1105
1106 if (fw_version_ptr[3] == '.' &&
1107 fw_version_ptr[7] == '.') {
1108 unsigned long major, minor, build;
1109 major = simple_strtoul(fw_version_ptr, NULL, 10);
1110 minor = simple_strtoul(fw_version_ptr + 4, NULL, 10);
1111 build = simple_strtoul(fw_version_ptr + 8, NULL, 10);
1112
1113 fw_version = (major << 12)
1114 + (minor << 8)
1115 + ((build / 10) << 4)
1116 + (build % 10);
1117
1118 IRDA_DEBUG(3, "%s(): Firmware Product version %ld\n",
1119 __func__, fw_version);
1120 }
1121 }
1122
1123 if (self->usbdev->descriptor.bcdDevice == cpu_to_le16(fw_version)) {
1124
1125
1126
1127
1128
1129 for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG)
1130 && (i < fw->size); i++) ;
1131
1132 if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i])
1133 && (i < STIR421X_PATCH_CODE_OFFSET)) {
1134 if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG,
1135 sizeof(STIR421X_PATCH_STMP_TAG) - 1)) {
1136
1137
1138 i += sizeof(STIR421X_PATCH_STMP_TAG);
1139 ret = stir421x_fw_upload(self, &fw->data[i],
1140 fw->size - i);
1141 }
1142 }
1143 }
1144
1145 release_firmware(fw);
1146
1147 return ret;
1148}
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168static int irda_usb_net_open(struct net_device *netdev)
1169{
1170 struct irda_usb_cb *self;
1171 unsigned long flags;
1172 char hwname[16];
1173 int i;
1174
1175 IRDA_DEBUG(1, "%s()\n", __func__);
1176
1177 IRDA_ASSERT(netdev != NULL, return -1;);
1178 self = (struct irda_usb_cb *) netdev->priv;
1179 IRDA_ASSERT(self != NULL, return -1;);
1180
1181 spin_lock_irqsave(&self->lock, flags);
1182
1183 if(!self->present) {
1184 spin_unlock_irqrestore(&self->lock, flags);
1185 IRDA_WARNING("%s(), device not present!\n", __func__);
1186 return -1;
1187 }
1188
1189 if(self->needspatch) {
1190 spin_unlock_irqrestore(&self->lock, flags);
1191 IRDA_WARNING("%s(), device needs patch\n", __func__) ;
1192 return -EIO ;
1193 }
1194
1195
1196
1197 self->speed = -1;
1198 self->xbofs = -1;
1199 self->new_speed = -1;
1200 self->new_xbofs = -1;
1201
1202
1203
1204 self->netopen = 1;
1205 spin_unlock_irqrestore(&self->lock, flags);
1206
1207
1208
1209
1210
1211
1212 sprintf(hwname, "usb#%d", self->usbdev->devnum);
1213 self->irlap = irlap_open(netdev, &self->qos, hwname);
1214 IRDA_ASSERT(self->irlap != NULL, return -1;);
1215
1216
1217 netif_start_queue(netdev);
1218
1219
1220
1221
1222
1223 self->idle_rx_urb = self->rx_urb[IU_MAX_ACTIVE_RX_URBS];
1224 self->idle_rx_urb->context = NULL;
1225
1226
1227
1228 for (i = 0; i < IU_MAX_ACTIVE_RX_URBS; i++) {
1229 struct sk_buff *skb = dev_alloc_skb(IRDA_SKB_MAX_MTU);
1230 if (!skb) {
1231
1232
1233 IRDA_WARNING("%s(), Failed to allocate Rx skb\n",
1234 __func__);
1235 return -1;
1236 }
1237
1238 irda_usb_submit(self, skb, self->rx_urb[i]);
1239 }
1240
1241
1242 return 0;
1243}
1244
1245
1246
1247
1248
1249
1250
1251
1252static int irda_usb_net_close(struct net_device *netdev)
1253{
1254 struct irda_usb_cb *self;
1255 int i;
1256
1257 IRDA_DEBUG(1, "%s()\n", __func__);
1258
1259 IRDA_ASSERT(netdev != NULL, return -1;);
1260 self = (struct irda_usb_cb *) netdev->priv;
1261 IRDA_ASSERT(self != NULL, return -1;);
1262
1263
1264
1265 self->netopen = 0;
1266
1267
1268 netif_stop_queue(netdev);
1269
1270
1271 del_timer(&self->rx_defer_timer);
1272
1273
1274 for (i = 0; i < self->max_rx_urb; i++) {
1275 struct urb *urb = self->rx_urb[i];
1276 struct sk_buff *skb = (struct sk_buff *) urb->context;
1277
1278 usb_kill_urb(urb);
1279
1280 if(skb) {
1281 dev_kfree_skb(skb);
1282 urb->context = NULL;
1283 }
1284 }
1285
1286 usb_kill_urb(self->tx_urb);
1287 usb_kill_urb(self->speed_urb);
1288
1289
1290 if (self->irlap)
1291 irlap_close(self->irlap);
1292 self->irlap = NULL;
1293
1294 return 0;
1295}
1296
1297
1298
1299
1300
1301static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1302{
1303 unsigned long flags;
1304 struct if_irda_req *irq = (struct if_irda_req *) rq;
1305 struct irda_usb_cb *self;
1306 int ret = 0;
1307
1308 IRDA_ASSERT(dev != NULL, return -1;);
1309 self = dev->priv;
1310 IRDA_ASSERT(self != NULL, return -1;);
1311
1312 IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd);
1313
1314 switch (cmd) {
1315 case SIOCSBANDWIDTH:
1316 if (!capable(CAP_NET_ADMIN))
1317 return -EPERM;
1318
1319 spin_lock_irqsave(&self->lock, flags);
1320
1321 if(self->present) {
1322
1323 self->new_speed = irq->ifr_baudrate;
1324 irda_usb_change_speed_xbofs(self);
1325 }
1326 spin_unlock_irqrestore(&self->lock, flags);
1327 break;
1328 case SIOCSMEDIABUSY:
1329 if (!capable(CAP_NET_ADMIN))
1330 return -EPERM;
1331
1332 if(self->netopen)
1333 irda_device_set_media_busy(self->netdev, TRUE);
1334 break;
1335 case SIOCGRECEIVING:
1336 irq->ifr_receiving = irda_usb_is_receiving(self);
1337 break;
1338 default:
1339 ret = -EOPNOTSUPP;
1340 }
1341
1342 return ret;
1343}
1344
1345
1346
1347
1348
1349static struct net_device_stats *irda_usb_net_get_stats(struct net_device *dev)
1350{
1351 struct irda_usb_cb *self = dev->priv;
1352 return &self->stats;
1353}
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366static inline void irda_usb_init_qos(struct irda_usb_cb *self)
1367{
1368 struct irda_class_desc *desc;
1369
1370 IRDA_DEBUG(3, "%s()\n", __func__);
1371
1372 desc = self->irda_desc;
1373
1374
1375 irda_init_max_qos_capabilies(&self->qos);
1376
1377
1378
1379
1380 self->qos.baud_rate.bits = le16_to_cpu(desc->wBaudRate);
1381 self->qos.min_turn_time.bits = desc->bmMinTurnaroundTime;
1382 self->qos.additional_bofs.bits = desc->bmAdditionalBOFs;
1383 self->qos.window_size.bits = desc->bmWindowSize;
1384 self->qos.data_size.bits = desc->bmDataSize;
1385
1386 IRDA_DEBUG(0, "%s(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X\n",
1387 __func__, self->qos.baud_rate.bits, self->qos.data_size.bits, self->qos.window_size.bits, self->qos.additional_bofs.bits, self->qos.min_turn_time.bits);
1388
1389
1390 if(self->capability & IUC_SIR_ONLY)
1391 self->qos.baud_rate.bits &= 0x00ff;
1392 if(self->capability & IUC_SMALL_PKT)
1393 self->qos.data_size.bits = 0x07;
1394 if(self->capability & IUC_NO_WINDOW)
1395 self->qos.window_size.bits = 0x01;
1396 if(self->capability & IUC_MAX_WINDOW)
1397 self->qos.window_size.bits = 0x7f;
1398 if(self->capability & IUC_MAX_XBOFS)
1399 self->qos.additional_bofs.bits = 0x01;
1400
1401#if 1
1402
1403 if (qos_mtt_bits)
1404 self->qos.min_turn_time.bits = qos_mtt_bits;
1405#endif
1406
1407
1408
1409
1410 irda_qos_bits_to_value(&self->qos);
1411}
1412
1413
1414
1415
1416
1417
1418static inline int irda_usb_open(struct irda_usb_cb *self)
1419{
1420 struct net_device *netdev = self->netdev;
1421
1422 IRDA_DEBUG(1, "%s()\n", __func__);
1423
1424 irda_usb_init_qos(self);
1425
1426
1427 netdev->hard_start_xmit = irda_usb_hard_xmit;
1428 netdev->tx_timeout = irda_usb_net_timeout;
1429 netdev->watchdog_timeo = 250*HZ/1000;
1430 netdev->open = irda_usb_net_open;
1431 netdev->stop = irda_usb_net_close;
1432 netdev->get_stats = irda_usb_net_get_stats;
1433 netdev->do_ioctl = irda_usb_net_ioctl;
1434
1435 return register_netdev(netdev);
1436}
1437
1438
1439
1440
1441
1442
1443static inline void irda_usb_close(struct irda_usb_cb *self)
1444{
1445 IRDA_DEBUG(1, "%s()\n", __func__);
1446
1447
1448 unregister_netdev(self->netdev);
1449
1450
1451 kfree(self->speed_buff);
1452 self->speed_buff = NULL;
1453
1454 kfree(self->tx_buff);
1455 self->tx_buff = NULL;
1456}
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_host_endpoint *endpoint, int ennum)
1478{
1479 int i;
1480
1481
1482 self->bulk_in_ep = 0;
1483 self->bulk_out_ep = 0;
1484 self->bulk_int_ep = 0;
1485
1486
1487 for(i = 0; i < ennum; i++) {
1488
1489
1490 __u8 ep;
1491 __u8 dir;
1492 __u8 attr;
1493 __u16 psize;
1494
1495
1496 ep = endpoint[i].desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
1497 dir = endpoint[i].desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK;
1498 attr = endpoint[i].desc.bmAttributes;
1499 psize = le16_to_cpu(endpoint[i].desc.wMaxPacketSize);
1500
1501
1502 if(attr == USB_ENDPOINT_XFER_BULK) {
1503
1504 if(dir == USB_DIR_IN) {
1505
1506 self->bulk_in_ep = ep;
1507 } else {
1508
1509 self->bulk_out_ep = ep;
1510 self->bulk_out_mtu = psize;
1511 }
1512 } else {
1513 if((attr == USB_ENDPOINT_XFER_INT) &&
1514 (dir == USB_DIR_IN)) {
1515
1516 self->bulk_int_ep = ep;
1517 } else {
1518 IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __func__, ep);
1519 }
1520 }
1521 }
1522
1523 IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n",
1524 __func__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep);
1525
1526 return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0));
1527}
1528
1529#ifdef IU_DUMP_CLASS_DESC
1530
1531
1532
1533
1534
1535
1536
1537static inline void irda_usb_dump_class_desc(struct irda_class_desc *desc)
1538{
1539
1540 printk("bLength=%x\n", desc->bLength);
1541 printk("bDescriptorType=%x\n", desc->bDescriptorType);
1542 printk("bcdSpecRevision=%x\n", le16_to_cpu(desc->bcdSpecRevision));
1543 printk("bmDataSize=%x\n", desc->bmDataSize);
1544 printk("bmWindowSize=%x\n", desc->bmWindowSize);
1545 printk("bmMinTurnaroundTime=%d\n", desc->bmMinTurnaroundTime);
1546 printk("wBaudRate=%x\n", le16_to_cpu(desc->wBaudRate));
1547 printk("bmAdditionalBOFs=%x\n", desc->bmAdditionalBOFs);
1548 printk("bIrdaRateSniff=%x\n", desc->bIrdaRateSniff);
1549 printk("bMaxUnicastList=%x\n", desc->bMaxUnicastList);
1550}
1551#endif
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interface *intf)
1564{
1565 struct usb_device *dev = interface_to_usbdev (intf);
1566 struct irda_class_desc *desc;
1567 int ret;
1568
1569 desc = kzalloc(sizeof(*desc), GFP_KERNEL);
1570 if (!desc)
1571 return NULL;
1572
1573
1574
1575
1576
1577
1578
1579
1580 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev,0),
1581 IU_REQ_GET_CLASS_DESC,
1582 USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
1583 0, intf->altsetting->desc.bInterfaceNumber, desc,
1584 sizeof(*desc), 500);
1585
1586 IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret);
1587 if (ret < sizeof(*desc)) {
1588 IRDA_WARNING("usb-irda: class_descriptor read %s (%d)\n",
1589 (ret<0) ? "failed" : "too short", ret);
1590 }
1591 else if (desc->bDescriptorType != USB_DT_IRDA) {
1592 IRDA_WARNING("usb-irda: bad class_descriptor type\n");
1593 }
1594 else {
1595#ifdef IU_DUMP_CLASS_DESC
1596 irda_usb_dump_class_desc(desc);
1597#endif
1598
1599 return desc;
1600 }
1601 kfree(desc);
1602 return NULL;
1603}
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619static int irda_usb_probe(struct usb_interface *intf,
1620 const struct usb_device_id *id)
1621{
1622 struct net_device *net;
1623 struct usb_device *dev = interface_to_usbdev(intf);
1624 struct irda_usb_cb *self;
1625 struct usb_host_interface *interface;
1626 struct irda_class_desc *irda_desc;
1627 int ret = -ENOMEM;
1628 int i;
1629
1630
1631
1632
1633
1634
1635 IRDA_MESSAGE("IRDA-USB found at address %d, Vendor: %x, Product: %x\n",
1636 dev->devnum, le16_to_cpu(dev->descriptor.idVendor),
1637 le16_to_cpu(dev->descriptor.idProduct));
1638
1639 net = alloc_irdadev(sizeof(*self));
1640 if (!net)
1641 goto err_out;
1642
1643 SET_NETDEV_DEV(net, &intf->dev);
1644 self = net->priv;
1645 self->netdev = net;
1646 spin_lock_init(&self->lock);
1647 init_timer(&self->rx_defer_timer);
1648
1649 self->capability = id->driver_info;
1650 self->needspatch = ((self->capability & IUC_STIR421X) != 0);
1651
1652
1653 if (self->capability & IUC_STIR421X) {
1654 self->max_rx_urb = IU_SIGMATEL_MAX_RX_URBS;
1655 self->header_length = USB_IRDA_STIR421X_HEADER;
1656 } else {
1657 self->max_rx_urb = IU_MAX_RX_URBS;
1658 self->header_length = USB_IRDA_HEADER;
1659 }
1660
1661 self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *),
1662 GFP_KERNEL);
1663
1664 for (i = 0; i < self->max_rx_urb; i++) {
1665 self->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
1666 if (!self->rx_urb[i]) {
1667 goto err_out_1;
1668 }
1669 }
1670 self->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
1671 if (!self->tx_urb) {
1672 goto err_out_1;
1673 }
1674 self->speed_urb = usb_alloc_urb(0, GFP_KERNEL);
1675 if (!self->speed_urb) {
1676 goto err_out_2;
1677 }
1678
1679
1680 if (usb_reset_configuration (dev) < 0) {
1681 err("reset_configuration failed");
1682 ret = -EIO;
1683 goto err_out_3;
1684 }
1685
1686
1687
1688
1689
1690 ret = usb_set_interface(dev, intf->altsetting->desc.bInterfaceNumber, 0);
1691 IRDA_DEBUG(1, "usb-irda: set interface %d result %d\n", intf->altsetting->desc.bInterfaceNumber, ret);
1692 switch (ret) {
1693 case 0:
1694 break;
1695 case -EPIPE:
1696
1697
1698
1699 IRDA_DEBUG(0, "%s(), Received -EPIPE, ignoring...\n", __func__);
1700 break;
1701 default:
1702 IRDA_DEBUG(0, "%s(), Unknown error %d\n", __func__, ret);
1703 ret = -EIO;
1704 goto err_out_3;
1705 }
1706
1707
1708 interface = intf->cur_altsetting;
1709 if(!irda_usb_parse_endpoints(self, interface->endpoint,
1710 interface->desc.bNumEndpoints)) {
1711 IRDA_ERROR("%s(), Bogus endpoints...\n", __func__);
1712 ret = -EIO;
1713 goto err_out_3;
1714 }
1715
1716 self->usbdev = dev;
1717
1718
1719 irda_desc = irda_usb_find_class_desc(intf);
1720 ret = -ENODEV;
1721 if (!irda_desc)
1722 goto err_out_3;
1723
1724 if (self->needspatch) {
1725 ret = usb_control_msg (self->usbdev, usb_sndctrlpipe (self->usbdev, 0),
1726 0x02, 0x40, 0, 0, NULL, 0, 500);
1727 if (ret < 0) {
1728 IRDA_DEBUG (0, "usb_control_msg failed %d\n", ret);
1729 goto err_out_3;
1730 } else {
1731 mdelay(10);
1732 }
1733 }
1734
1735 self->irda_desc = irda_desc;
1736 self->present = 1;
1737 self->netopen = 0;
1738 self->usbintf = intf;
1739
1740
1741
1742
1743
1744 self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
1745 if (!self->speed_buff)
1746 goto err_out_3;
1747
1748 self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length,
1749 GFP_KERNEL);
1750 if (!self->tx_buff)
1751 goto err_out_4;
1752
1753 ret = irda_usb_open(self);
1754 if (ret)
1755 goto err_out_5;
1756
1757 IRDA_MESSAGE("IrDA: Registered device %s\n", net->name);
1758 usb_set_intfdata(intf, self);
1759
1760 if (self->needspatch) {
1761
1762 ret = stir421x_patch_device(self);
1763 self->needspatch = (ret < 0);
1764 if (self->needspatch) {
1765 IRDA_ERROR("STIR421X: Couldn't upload patch\n");
1766 goto err_out_6;
1767 }
1768
1769
1770 irda_desc = irda_usb_find_class_desc (self->usbintf);
1771 if (!irda_desc) {
1772 ret = -ENODEV;
1773 goto err_out_6;
1774 }
1775 kfree(self->irda_desc);
1776 self->irda_desc = irda_desc;
1777 irda_usb_init_qos(self);
1778 }
1779
1780 return 0;
1781err_out_6:
1782 unregister_netdev(self->netdev);
1783err_out_5:
1784 kfree(self->tx_buff);
1785err_out_4:
1786 kfree(self->speed_buff);
1787err_out_3:
1788
1789 usb_free_urb(self->speed_urb);
1790err_out_2:
1791 usb_free_urb(self->tx_urb);
1792err_out_1:
1793 for (i = 0; i < self->max_rx_urb; i++)
1794 usb_free_urb(self->rx_urb[i]);
1795 free_netdev(net);
1796err_out:
1797 return ret;
1798}
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812static void irda_usb_disconnect(struct usb_interface *intf)
1813{
1814 unsigned long flags;
1815 struct irda_usb_cb *self = usb_get_intfdata(intf);
1816 int i;
1817
1818 IRDA_DEBUG(1, "%s()\n", __func__);
1819
1820 usb_set_intfdata(intf, NULL);
1821 if (!self)
1822 return;
1823
1824
1825 spin_lock_irqsave(&self->lock, flags);
1826
1827
1828
1829 self->present = 0;
1830
1831
1832 del_timer(&self->rx_defer_timer);
1833
1834
1835
1836 spin_unlock_irqrestore(&self->lock, flags);
1837
1838
1839 if((self->netopen) || (self->irlap)) {
1840
1841
1842 netif_stop_queue(self->netdev);
1843
1844 for (i = 0; i < self->max_rx_urb; i++)
1845 usb_kill_urb(self->rx_urb[i]);
1846
1847
1848 usb_kill_urb(self->tx_urb);
1849 usb_kill_urb(self->speed_urb);
1850 }
1851
1852
1853 irda_usb_close(self);
1854
1855 self->usbdev = NULL;
1856 self->usbintf = NULL;
1857
1858
1859 for (i = 0; i < self->max_rx_urb; i++)
1860 usb_free_urb(self->rx_urb[i]);
1861 kfree(self->rx_urb);
1862
1863 usb_free_urb(self->tx_urb);
1864 usb_free_urb(self->speed_urb);
1865
1866
1867 free_netdev(self->netdev);
1868 IRDA_DEBUG(0, "%s(), USB IrDA Disconnected\n", __func__);
1869}
1870
1871
1872
1873
1874
1875static struct usb_driver irda_driver = {
1876 .name = "irda-usb",
1877 .probe = irda_usb_probe,
1878 .disconnect = irda_usb_disconnect,
1879 .id_table = dongles,
1880};
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892static int __init usb_irda_init(void)
1893{
1894 int ret;
1895
1896 ret = usb_register(&irda_driver);
1897 if (ret < 0)
1898 return ret;
1899
1900 IRDA_MESSAGE("USB IrDA support registered\n");
1901 return 0;
1902}
1903module_init(usb_irda_init);
1904
1905
1906
1907
1908
1909static void __exit usb_irda_cleanup(void)
1910{
1911
1912 usb_deregister(&irda_driver);
1913}
1914module_exit(usb_irda_cleanup);
1915
1916
1917
1918
1919
1920module_param(qos_mtt_bits, int, 0);
1921MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
1922MODULE_AUTHOR("Roman Weissgaerber <weissg@vienna.at>, Dag Brattli <dag@brattli.net>, Jean Tourrilhes <jt@hpl.hp.com> and Nick Fedchik <nick@fedchik.org.ua>");
1923MODULE_DESCRIPTION("IrDA-USB Dongle Driver");
1924MODULE_LICENSE("GPL");