6262#include "../wusbcore/wa-hc.h"
6363#include "../wusbcore/wusbhc.h"
6464
65- #define D_LOCAL 0
66- #include <linux/uwb/debug.h>
67-
6865struct hwahc {
6966 struct wusbhc wusbhc ; /* has to be 1st */
7067 struct wahc wa ;
71- u8 buffer [16 ]; /* for misc usb transactions */
7268};
7369
74- /**
70+ /*
7571 * FIXME should be wusbhc
7672 *
7773 * NOTE: we need to cache the Cluster ID because later...there is no
@@ -125,23 +121,20 @@ static int hwahc_op_reset(struct usb_hcd *usb_hcd)
125121 struct hwahc * hwahc = container_of (wusbhc , struct hwahc , wusbhc );
126122 struct device * dev = & hwahc -> wa .usb_iface -> dev ;
127123
128- d_fnstart (4 , dev , "(hwahc %p)\n" , hwahc );
129124 mutex_lock (& wusbhc -> mutex );
130125 wa_nep_disarm (& hwahc -> wa );
131126 result = __wa_set_feature (& hwahc -> wa , WA_RESET );
132127 if (result < 0 ) {
133128 dev_err (dev , "error commanding HC to reset: %d\n" , result );
134129 goto error_unlock ;
135130 }
136- d_printf (3 , dev , "reset: waiting for device to change state\n" );
137131 result = __wa_wait_status (& hwahc -> wa , WA_STATUS_RESETTING , 0 );
138132 if (result < 0 ) {
139133 dev_err (dev , "error waiting for HC to reset: %d\n" , result );
140134 goto error_unlock ;
141135 }
142136error_unlock :
143137 mutex_unlock (& wusbhc -> mutex );
144- d_fnend (4 , dev , "(hwahc %p) = %d\n" , hwahc , result );
145138 return result ;
146139}
147140
@@ -154,15 +147,9 @@ static int hwahc_op_start(struct usb_hcd *usb_hcd)
154147 int result ;
155148 struct wusbhc * wusbhc = usb_hcd_to_wusbhc (usb_hcd );
156149 struct hwahc * hwahc = container_of (wusbhc , struct hwahc , wusbhc );
157- struct device * dev = & hwahc -> wa .usb_iface -> dev ;
158150
159- /* Set up a Host Info WUSB Information Element */
160- d_fnstart (4 , dev , "(hwahc %p)\n" , hwahc );
161151 result = - ENOSPC ;
162152 mutex_lock (& wusbhc -> mutex );
163- /* Start the numbering from the top so that the bottom
164- * range of the unauth addr space is used for devices,
165- * the top for HCs; use 0xfe - RC# */
166153 addr = wusb_cluster_id_get ();
167154 if (addr == 0 )
168155 goto error_cluster_id_get ;
@@ -176,7 +163,6 @@ static int hwahc_op_start(struct usb_hcd *usb_hcd)
176163 result = 0 ;
177164out :
178165 mutex_unlock (& wusbhc -> mutex );
179- d_fnend (4 , dev , "(hwahc %p) = %d\n" , hwahc , result );
180166 return result ;
181167
182168error_set_cluster_id :
@@ -213,18 +199,11 @@ static int hwahc_op_resume(struct usb_hcd *usb_hcd)
213199 */
214200static void hwahc_op_stop (struct usb_hcd * usb_hcd )
215201{
216- int result ;
217202 struct wusbhc * wusbhc = usb_hcd_to_wusbhc (usb_hcd );
218- struct hwahc * hwahc = container_of (wusbhc , struct hwahc , wusbhc );
219- struct wahc * wa = & hwahc -> wa ;
220- struct device * dev = & wa -> usb_iface -> dev ;
221203
222- d_fnstart (4 , dev , "(hwahc %p)\n" , hwahc );
223204 mutex_lock (& wusbhc -> mutex );
224205 wusb_cluster_id_put (wusbhc -> cluster_id );
225206 mutex_unlock (& wusbhc -> mutex );
226- d_fnend (4 , dev , "(hwahc %p) = %d\n" , hwahc , result );
227- return ;
228207}
229208
230209static int hwahc_op_get_frame_number (struct usb_hcd * usb_hcd )
@@ -573,11 +552,11 @@ static int wa_fill_descr(struct wahc *wa)
573552 itr_size = le16_to_cpu (usb_dev -> actconfig -> desc .wTotalLength );
574553 while (itr_size >= sizeof (* hdr )) {
575554 hdr = (struct usb_descriptor_header * ) itr ;
576- d_printf ( 3 , dev , "Extra device descriptor: "
577- "type %02x/%u bytes @ %zu (%zu left)\n" ,
578- hdr -> bDescriptorType , hdr -> bLength ,
579- (itr - usb_dev -> rawdescriptors [actconfig_idx ]),
580- itr_size );
555+ dev_dbg ( dev , "Extra device descriptor: "
556+ "type %02x/%u bytes @ %zu (%zu left)\n" ,
557+ hdr -> bDescriptorType , hdr -> bLength ,
558+ (itr - usb_dev -> rawdescriptors [actconfig_idx ]),
559+ itr_size );
581560 if (hdr -> bDescriptorType == USB_DT_WIRE_ADAPTER )
582561 goto found ;
583562 itr += hdr -> bLength ;
@@ -786,7 +765,6 @@ static void hwahc_destroy(struct hwahc *hwahc)
786765{
787766 struct wusbhc * wusbhc = & hwahc -> wusbhc ;
788767
789- d_fnstart (1 , NULL , "(hwahc %p)\n" , hwahc );
790768 mutex_lock (& wusbhc -> mutex );
791769 __wa_destroy (& hwahc -> wa );
792770 wusbhc_destroy (& hwahc -> wusbhc );
@@ -796,7 +774,6 @@ static void hwahc_destroy(struct hwahc *hwahc)
796774 usb_put_intf (hwahc -> wa .usb_iface );
797775 usb_put_dev (hwahc -> wa .usb_dev );
798776 mutex_unlock (& wusbhc -> mutex );
799- d_fnend (1 , NULL , "(hwahc %p) = void\n" , hwahc );
800777}
801778
802779static void hwahc_init (struct hwahc * hwahc )
@@ -813,7 +790,6 @@ static int hwahc_probe(struct usb_interface *usb_iface,
813790 struct hwahc * hwahc ;
814791 struct device * dev = & usb_iface -> dev ;
815792
816- d_fnstart (4 , dev , "(%p, %p)\n" , usb_iface , id );
817793 result = - ENOMEM ;
818794 usb_hcd = usb_create_hcd (& hwahc_hc_driver , & usb_iface -> dev , "wusb-hwa" );
819795 if (usb_hcd == NULL ) {
@@ -840,7 +816,6 @@ static int hwahc_probe(struct usb_interface *usb_iface,
840816 dev_err (dev , "Cannot setup phase B of WUSBHC: %d\n" , result );
841817 goto error_wusbhc_b_create ;
842818 }
843- d_fnend (4 , dev , "(%p, %p) = 0\n" , usb_iface , id );
844819 return 0 ;
845820
846821error_wusbhc_b_create :
@@ -850,7 +825,6 @@ static int hwahc_probe(struct usb_interface *usb_iface,
850825error_hwahc_create :
851826 usb_put_hcd (usb_hcd );
852827error_alloc :
853- d_fnend (4 , dev , "(%p, %p) = %d\n" , usb_iface , id , result );
854828 return result ;
855829}
856830
@@ -864,16 +838,12 @@ static void hwahc_disconnect(struct usb_interface *usb_iface)
864838 wusbhc = usb_hcd_to_wusbhc (usb_hcd );
865839 hwahc = container_of (wusbhc , struct hwahc , wusbhc );
866840
867- d_fnstart (1 , NULL , "(hwahc %p [usb_iface %p])\n" , hwahc , usb_iface );
868841 wusbhc_b_destroy (& hwahc -> wusbhc );
869842 usb_remove_hcd (usb_hcd );
870843 hwahc_destroy (hwahc );
871844 usb_put_hcd (usb_hcd );
872- d_fnend (1 , NULL , "(hwahc %p [usb_iface %p]) = void\n" , hwahc ,
873- usb_iface );
874845}
875846
876- /** USB device ID's that we handle */
877847static struct usb_device_id hwahc_id_table [] = {
878848 /* FIXME: use class labels for this */
879849 { USB_INTERFACE_INFO (0xe0 , 0x02 , 0x01 ), },
@@ -890,18 +860,7 @@ static struct usb_driver hwahc_driver = {
890860
891861static int __init hwahc_driver_init (void )
892862{
893- int result ;
894- result = usb_register (& hwahc_driver );
895- if (result < 0 ) {
896- printk (KERN_ERR "WA-CDS: Cannot register USB driver: %d\n" ,
897- result );
898- goto error_usb_register ;
899- }
900- return 0 ;
901-
902- error_usb_register :
903- return result ;
904-
863+ return usb_register (& hwahc_driver );
905864}
906865module_init (hwahc_driver_init );
907866
0 commit comments