usbip: vhci: stop printing kernel pointer addresses in messages
[pandora-kernel.git] / drivers / staging / usbip / vhci_hcd.c
index 2ee97e2..c756250 100644 (file)
@@ -248,14 +248,19 @@ done:
 /* See hub_configure in hub.c */
 static inline void hub_descriptor(struct usb_hub_descriptor *desc)
 {
+       int width;
+
        memset(desc, 0, sizeof(*desc));
        desc->bDescriptorType = 0x29;
-       desc->bDescLength = 9;
        desc->wHubCharacteristics = (__force __u16)
                (__constant_cpu_to_le16(0x0001));
+
        desc->bNbrPorts = VHCI_NPORTS;
-       desc->u.hs.DeviceRemovable[0] = 0xff;
-       desc->u.hs.DeviceRemovable[1] = 0xff;
+       BUILD_BUG_ON(VHCI_NPORTS > USB_MAXCHILDREN);
+       width = desc->bNbrPorts / 8 + 1;
+       desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * width;
+       memset(&desc->u.hs.DeviceRemovable[0], 0, width);
+       memset(&desc->u.hs.DeviceRemovable[width], 0xff, width);
 }
 
 static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
@@ -386,29 +391,6 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                                dum->port_status[rhport] |=
                                        USB_PORT_STAT_ENABLE;
                        }
-#if 0
-                       if (dum->driver) {
-                               dum->port_status[rhport] |=
-                                       USB_PORT_STAT_ENABLE;
-                               /* give it the best speed we agree on */
-                               dum->gadget.speed = dum->driver->speed;
-                               dum->gadget.ep0->maxpacket = 64;
-                               switch (dum->gadget.speed) {
-                               case USB_SPEED_HIGH:
-                                       dum->port_status[rhport] |=
-                                               USB_PORT_STAT_HIGH_SPEED;
-                                       break;
-                               case USB_SPEED_LOW:
-                                       dum->gadget.ep0->maxpacket = 8;
-                                       dum->port_status[rhport] |=
-                                               USB_PORT_STAT_LOW_SPEED;
-                                       break;
-                               default:
-                                       dum->gadget.speed = USB_SPEED_FULL;
-                                       break;
-                               }
-                       }
-#endif
                }
                ((u16 *) buf)[0] = cpu_to_le16(dum->port_status[rhport]);
                ((u16 *) buf)[1] = cpu_to_le16(dum->port_status[rhport] >> 16);
@@ -425,15 +407,6 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                case USB_PORT_FEAT_SUSPEND:
                        usbip_dbg_vhci_rh(" SetPortFeature: "
                                          "USB_PORT_FEAT_SUSPEND\n");
-#if 0
-                       dum->port_status[rhport] |=
-                               (1 << USB_PORT_FEAT_SUSPEND);
-                       if (dum->driver->suspend) {
-                               spin_unlock(&dum->lock);
-                               dum->driver->suspend(&dum->gadget);
-                               spin_lock(&dum->lock);
-                       }
-#endif
                        break;
                case USB_PORT_FEAT_RESET:
                        usbip_dbg_vhci_rh(" SetPortFeature: "
@@ -444,13 +417,6 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                                        ~(USB_PORT_STAT_ENABLE |
                                          USB_PORT_STAT_LOW_SPEED |
                                          USB_PORT_STAT_HIGH_SPEED);
-#if 0
-                               if (dum->driver) {
-                                       dev_dbg(hardware, "disconnect\n");
-                                       stop_activity(dum, dum->driver);
-                               }
-#endif
-
                                /* FIXME test that code path! */
                        }
                        /* 50msec reset signaling */
@@ -550,9 +516,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
        unsigned long flags;
        struct vhci_device *vdev;
 
-       usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n",
-                         hcd, urb, mem_flags);
-
        /* patch to usb_sg_init() is in 2.5.60 */
        BUG_ON(!urb->transfer_buffer && urb->transfer_buffer_length);
 
@@ -711,8 +674,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
        struct vhci_priv *priv;
        struct vhci_device *vdev;
 
-       pr_info("dequeue a urb %p\n", urb);
-
        spin_lock_irqsave(&the_controller->lock, flags);
 
        priv = urb->hcpriv;
@@ -741,7 +702,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 
                spin_lock_irqsave(&vdev->priv_lock, flags2);
 
-               pr_info("device %p seems to be disconnected\n", vdev);
                list_del(&priv->list);
                kfree(priv);
                urb->hcpriv = NULL;
@@ -753,8 +713,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
                 * vhci_rx will receive RET_UNLINK and give back the URB.
                 * Otherwise, we give back it here.
                 */
-               pr_info("gives back urb %p\n", urb);
-
                usb_hcd_unlink_urb_from_ep(hcd, urb);
 
                spin_unlock_irqrestore(&the_controller->lock, flags);
@@ -785,8 +743,6 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 
                unlink->unlink_seqnum = priv->seqnum;
 
-               pr_info("device %p seems to be still connected\n", vdev);
-
                /* send cmd_unlink and try to cancel the pending URB in the
                 * peer */
                list_add_tail(&unlink->list, &vdev->unlink_tx);