#define GDM7205_PADDING 256
-#define H2B(x) __cpu_to_be16(x)
-#define B2H(x) __be16_to_cpu(x)
-#define DB2H(x) __be32_to_cpu(x)
-
#define DOWNLOAD_CONF_VALUE 0x21
#ifdef CONFIG_WIMAX_GDM72XX_K_MODE
return -ENODEV;
}
- BUG_ON(len > TX_BUF_SIZE - padding - 1);
+ if (len > TX_BUF_SIZE - padding - 1)
+ return -EINVAL;
spin_lock_irqsave(&tx->lock, flags);
t->callback = cb;
t->cb_data = cb_data;
- /*
- * In some cases, USB Module of WiMax is blocked when data size is
+ /* In some cases, USB Module of WiMax is blocked when data size is
* the multiple of 512. So, increment length by one in that case.
*/
if ((len % 512) == 0)
list_for_each_entry(t, &tx->sdu_list, list) {
usb_submit_urb(t->urb, GFP_ATOMIC);
}
- /*
- * If free buffer for sdu tx doesn't
+ /* If free buffer for sdu tx doesn't
* exist, then tx queue should not be
* woken. For this reason, don't pass
* the command, START_SDU_TX.
bConfigurationValue = usbdev->actconfig->desc.bConfigurationValue;
/*USB description is set up with Little-Endian*/
- idVendor = L2H(usbdev->descriptor.idVendor);
- idProduct = L2H(usbdev->descriptor.idProduct);
- bcdDevice = L2H(usbdev->descriptor.bcdDevice);
+ idVendor = le16_to_cpu(usbdev->descriptor.idVendor);
+ idProduct = le16_to_cpu(usbdev->descriptor.idProduct);
+ bcdDevice = le16_to_cpu(usbdev->descriptor.bcdDevice);
dev_info(&intf->dev, "Found GDM USB VID = 0x%04x PID = 0x%04x...\n",
idVendor, idProduct);
phy_dev = usb_get_intfdata(intf);
/*USB description is set up with Little-Endian*/
- idProduct = L2H(usbdev->descriptor.idProduct);
+ idProduct = le16_to_cpu(usbdev->descriptor.idProduct);
if (idProduct != EMERGENCY_PID &&
bConfigurationValue != DOWNLOAD_CONF_VALUE &&
(idProduct & B_DOWNLOAD) == 0) {
-
udev = phy_dev->priv_dev;
udev->usbdev = NULL;
int ret;
while (!k_mode_stop) {
-
spin_lock_irqsave(&k_lock, flags2);
while (!list_empty(&k_list)) {
-
udev = list_entry(k_list.next, struct usbwm_dev, list);
tx = &udev->tx;
rx = &udev->rx;