merged in all changes done to the trunk up to Aug 28
[pintos-anon] / src / devices / usb.c
index f4bc738c96320c3f886fba925869912d74998458..1ac802f563496e769945024c24b70a5b55409e55 100644 (file)
@@ -260,7 +260,8 @@ usb_configure_default (struct host *h)
   host_dev_info hi;
   host_eop_info cfg_eop;
   bool ignore_device = false;
-  int err, sz, txed;
+  int err, sz; 
+  unsigned txed;
   int config_val;
 
   hi = h->dev->create_dev_channel (h->info, ADDR_DEFAULT, USB_VERSION_1_1);
@@ -431,7 +432,7 @@ usb_load_config (struct usb_dev *dev, int idx, void *data, int dsz)
 
   sz = usb_tx_all (&dev->cfg_eop, cd, dsz,
                   sizeof (struct config_descriptor), true);
-  if (sz < sizeof (struct config_descriptor))
+  if (sz < (int) sizeof (struct config_descriptor))
     {
       printf ("USB: Did not rx GET descriptor (%d bytes, expected %d)\n", sz,
              sizeof (struct config_descriptor));
@@ -597,8 +598,12 @@ usb_get_string (struct usb_dev *udev, int ndx)
   sp.value = (SETUP_DESC_STRING << 8) | ndx;
   sp.index = 0;
   sp.length = MAX_USB_STR;
-  udev->host->dev->tx_pkt (udev->h_cfg_eop, USB_TOKEN_SETUP,
-                          &sp, 0, sizeof (sp), NULL, false);
+
+  if (udev->host->dev->tx_pkt (udev->h_cfg_eop, USB_TOKEN_SETUP,
+                              &sp, 0, sizeof (sp), NULL, true) 
+                           != USB_HOST_ERR_NONE) 
+    return NULL;
+
   sz = usb_tx_all (&udev->cfg_eop, &str, MAX_USB_STR, 2, true);
   sz +=
     usb_tx_all (&udev->cfg_eop, str + sz, (uint8_t) (str[0]) - sz, 0, true);