4242
4343static struct usb_driver bfusb_driver ;
4444
45- static struct usb_device_id bfusb_table [] = {
45+ static const struct usb_device_id bfusb_table [] = {
4646 /* AVM BlueFRITZ! USB */
4747 { USB_DEVICE (0x057c , 0x2200 ) },
4848
@@ -318,7 +318,6 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
318318 return - ENOMEM ;
319319 }
320320
321- skb -> dev = (void * ) data -> hdev ;
322321 bt_cb (skb )-> pkt_type = pkt_type ;
323322
324323 data -> reassembly = skb ;
@@ -333,7 +332,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
333332 memcpy (skb_put (data -> reassembly , len ), buf , len );
334333
335334 if (hdr & 0x08 ) {
336- hci_recv_frame (data -> reassembly );
335+ hci_recv_frame (data -> hdev , data -> reassembly );
337336 data -> reassembly = NULL ;
338337 }
339338
@@ -465,26 +464,18 @@ static int bfusb_close(struct hci_dev *hdev)
465464 return 0 ;
466465}
467466
468- static int bfusb_send_frame (struct sk_buff * skb )
467+ static int bfusb_send_frame (struct hci_dev * hdev , struct sk_buff * skb )
469468{
470- struct hci_dev * hdev = (struct hci_dev * ) skb -> dev ;
471- struct bfusb_data * data ;
469+ struct bfusb_data * data = hci_get_drvdata (hdev );
472470 struct sk_buff * nskb ;
473471 unsigned char buf [3 ];
474472 int sent = 0 , size , count ;
475473
476474 BT_DBG ("hdev %p skb %p type %d len %d" , hdev , skb , bt_cb (skb )-> pkt_type , skb -> len );
477475
478- if (!hdev ) {
479- BT_ERR ("Frame for unknown HCI device (hdev=NULL)" );
480- return - ENODEV ;
481- }
482-
483476 if (!test_bit (HCI_RUNNING , & hdev -> flags ))
484477 return - EBUSY ;
485478
486- data = hci_get_drvdata (hdev );
487-
488479 switch (bt_cb (skb )-> pkt_type ) {
489480 case HCI_COMMAND_PKT :
490481 hdev -> stat .cmd_tx ++ ;
@@ -544,11 +535,6 @@ static int bfusb_send_frame(struct sk_buff *skb)
544535 return 0 ;
545536}
546537
547- static int bfusb_ioctl (struct hci_dev * hdev , unsigned int cmd , unsigned long arg )
548- {
549- return - ENOIOCTLCMD ;
550- }
551-
552538static int bfusb_load_firmware (struct bfusb_data * data ,
553539 const unsigned char * firmware , int count )
554540{
@@ -699,11 +685,10 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
699685 hci_set_drvdata (hdev , data );
700686 SET_HCIDEV_DEV (hdev , & intf -> dev );
701687
702- hdev -> open = bfusb_open ;
703- hdev -> close = bfusb_close ;
704- hdev -> flush = bfusb_flush ;
705- hdev -> send = bfusb_send_frame ;
706- hdev -> ioctl = bfusb_ioctl ;
688+ hdev -> open = bfusb_open ;
689+ hdev -> close = bfusb_close ;
690+ hdev -> flush = bfusb_flush ;
691+ hdev -> send = bfusb_send_frame ;
707692
708693 if (hci_register_dev (hdev ) < 0 ) {
709694 BT_ERR ("Can't register HCI device" );
0 commit comments