aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>2014-05-20 12:30:04 -0400
committerFelipe Balbi <balbi@ti.com>2014-06-30 13:33:31 -0400
commitc2db8a8a01978a1ffad735f31268a1c9c81b413e (patch)
treed7a26e2ebfe5d8f4d44fc23edc1f38da2be65a20
parentadc82f77bee3487651f8ad253fb1c8a7bf4ec658 (diff)
usb: gadget: net2280: Dont use magic numbers
Instead of using magic numbers use #defines Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/net2280.c68
-rw-r--r--drivers/usb/gadget/net2280.h1
2 files changed, 36 insertions, 33 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 8112d9140a90..ba1fdd8f675d 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -152,7 +152,7 @@ static inline void enable_pciirqenb(struct net2280_ep *ep)
152{ 152{
153 u32 tmp = readl(&ep->dev->regs->pciirqenb0); 153 u32 tmp = readl(&ep->dev->regs->pciirqenb0);
154 154
155 if (ep->dev->pdev->vendor == 0x17cc) 155 if (ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
156 tmp |= 1 << ep->num; 156 tmp |= 1 << ep->num;
157 else 157 else
158 tmp |= 1 << ep_bit[ep->num]; 158 tmp |= 1 << ep_bit[ep->num];
@@ -182,7 +182,7 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
182 if ((desc->bEndpointAddress & 0x0f) == EP_DONTUSE) 182 if ((desc->bEndpointAddress & 0x0f) == EP_DONTUSE)
183 return -EDOM; 183 return -EDOM;
184 184
185 if (dev->pdev->vendor == 0x10b5) { 185 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX) {
186 if ((desc->bEndpointAddress & 0x0f) >= 0x0c) 186 if ((desc->bEndpointAddress & 0x0f) >= 0x0c)
187 return -EDOM; 187 return -EDOM;
188 ep->is_in = !!usb_endpoint_dir_in(desc); 188 ep->is_in = !!usb_endpoint_dir_in(desc);
@@ -192,7 +192,8 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
192 192
193 /* sanity check ep-e/ep-f since their fifos are small */ 193 /* sanity check ep-e/ep-f since their fifos are small */
194 max = usb_endpoint_maxp (desc) & 0x1fff; 194 max = usb_endpoint_maxp (desc) & 0x1fff;
195 if (ep->num > 4 && max > 64 && (dev->pdev->vendor == 0x17cc)) 195 if (ep->num > 4 && max > 64 &&
196 (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY))
196 return -ERANGE; 197 return -ERANGE;
197 198
198 spin_lock_irqsave (&dev->lock, flags); 199 spin_lock_irqsave (&dev->lock, flags);
@@ -237,7 +238,7 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
237 } 238 }
238 ep->is_iso = (tmp == USB_ENDPOINT_XFER_ISOC) ? 1 : 0; 239 ep->is_iso = (tmp == USB_ENDPOINT_XFER_ISOC) ? 1 : 0;
239 /* Enable this endpoint */ 240 /* Enable this endpoint */
240 if (dev->pdev->vendor == 0x17cc) { 241 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY) {
241 tmp <<= ENDPOINT_TYPE; 242 tmp <<= ENDPOINT_TYPE;
242 tmp |= desc->bEndpointAddress; 243 tmp |= desc->bEndpointAddress;
243 /* default full fifo lines */ 244 /* default full fifo lines */
@@ -472,7 +473,7 @@ static int net2280_disable (struct usb_ep *_ep)
472 spin_lock_irqsave (&ep->dev->lock, flags); 473 spin_lock_irqsave (&ep->dev->lock, flags);
473 nuke (ep); 474 nuke (ep);
474 475
475 if (ep->dev->pdev->vendor == 0x10b5) 476 if (ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX)
476 ep_reset_338x(ep->dev->regs, ep); 477 ep_reset_338x(ep->dev->regs, ep);
477 else 478 else
478 ep_reset_228x(ep->dev->regs, ep); 479 ep_reset_228x(ep->dev->regs, ep);
@@ -799,7 +800,7 @@ static void start_queue (struct net2280_ep *ep, u32 dmactl, u32 td_dma)
799 writel (readl (&dma->dmastat), &dma->dmastat); 800 writel (readl (&dma->dmastat), &dma->dmastat);
800 801
801 writel (td_dma, &dma->dmadesc); 802 writel (td_dma, &dma->dmadesc);
802 if (ep->dev->pdev->vendor == 0x10b5) 803 if (ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX)
803 dmactl |= (0x01 << DMA_REQUEST_OUTSTANDING); 804 dmactl |= (0x01 << DMA_REQUEST_OUTSTANDING);
804 writel (dmactl, &dma->dmactl); 805 writel (dmactl, &dma->dmactl);
805 806
@@ -995,7 +996,7 @@ net2280_queue (struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
995 /* DMA request while EP halted */ 996 /* DMA request while EP halted */
996 if (ep->dma && 997 if (ep->dma &&
997 (readl(&ep->regs->ep_rsp) & (1 << CLEAR_ENDPOINT_HALT)) && 998 (readl(&ep->regs->ep_rsp) & (1 << CLEAR_ENDPOINT_HALT)) &&
998 (dev->pdev->vendor == 0x10b5)) { 999 (dev->pdev->vendor == PCI_VENDOR_ID_PLX)) {
999 int valid = 1; 1000 int valid = 1;
1000 if (ep->is_in) { 1001 if (ep->is_in) {
1001 int expect; 1002 int expect;
@@ -1126,7 +1127,7 @@ static void scan_dma_completions (struct net2280_ep *ep)
1126 } else if (!ep->is_in 1127 } else if (!ep->is_in
1127 && (req->req.length % ep->ep.maxpacket) != 0) { 1128 && (req->req.length % ep->ep.maxpacket) != 0) {
1128 tmp = readl (&ep->regs->ep_stat); 1129 tmp = readl (&ep->regs->ep_stat);
1129 if (ep->dev->pdev->vendor == 0x10b5) 1130 if (ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX)
1130 return dma_done(ep, req, tmp, 0); 1131 return dma_done(ep, req, tmp, 0);
1131 1132
1132 /* AVOID TROUBLE HERE by not issuing short reads from 1133 /* AVOID TROUBLE HERE by not issuing short reads from
@@ -1234,7 +1235,7 @@ static void abort_dma_338x(struct net2280_ep *ep)
1234 1235
1235static void abort_dma(struct net2280_ep *ep) 1236static void abort_dma(struct net2280_ep *ep)
1236{ 1237{
1237 if (ep->dev->pdev->vendor == 0x17cc) 1238 if (ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
1238 return abort_dma_228x(ep); 1239 return abort_dma_228x(ep);
1239 return abort_dma_338x(ep); 1240 return abort_dma_338x(ep);
1240} 1241}
@@ -1392,7 +1393,7 @@ net2280_set_halt_and_wedge(struct usb_ep *_ep, int value, int wedged)
1392 ep->wedged = 1; 1393 ep->wedged = 1;
1393 } else { 1394 } else {
1394 clear_halt (ep); 1395 clear_halt (ep);
1395 if (ep->dev->pdev->vendor == 0x10b5 && 1396 if (ep->dev->pdev->vendor == PCI_VENDOR_ID_PLX &&
1396 !list_empty(&ep->queue) && ep->td_dma) 1397 !list_empty(&ep->queue) && ep->td_dma)
1397 restart_dma(ep); 1398 restart_dma(ep);
1398 ep->wedged = 0; 1399 ep->wedged = 0;
@@ -2104,7 +2105,7 @@ static void usb_reset_338x(struct net2280 *dev)
2104 2105
2105static void usb_reset(struct net2280 *dev) 2106static void usb_reset(struct net2280 *dev)
2106{ 2107{
2107 if (dev->pdev->vendor == 0x17cc) 2108 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
2108 return usb_reset_228x(dev); 2109 return usb_reset_228x(dev);
2109 return usb_reset_338x(dev); 2110 return usb_reset_338x(dev);
2110} 2111}
@@ -2260,7 +2261,7 @@ static void usb_reinit_338x(struct net2280 *dev)
2260 2261
2261static void usb_reinit(struct net2280 *dev) 2262static void usb_reinit(struct net2280 *dev)
2262{ 2263{
2263 if (dev->pdev->vendor == 0x17cc) 2264 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
2264 return usb_reinit_228x(dev); 2265 return usb_reinit_228x(dev);
2265 return usb_reinit_338x(dev); 2266 return usb_reinit_338x(dev);
2266} 2267}
@@ -2358,7 +2359,7 @@ static void ep0_start_338x(struct net2280 *dev)
2358 2359
2359static void ep0_start(struct net2280 *dev) 2360static void ep0_start(struct net2280 *dev)
2360{ 2361{
2361 if (dev->pdev->vendor == 0x17cc) 2362 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
2362 return ep0_start_228x(dev); 2363 return ep0_start_228x(dev);
2363 return ep0_start_338x(dev); 2364 return ep0_start_338x(dev);
2364} 2365}
@@ -2400,7 +2401,7 @@ static int net2280_start(struct usb_gadget *_gadget,
2400 if (retval) goto err_func; 2401 if (retval) goto err_func;
2401 2402
2402 /* Enable force-full-speed testing mode, if desired */ 2403 /* Enable force-full-speed testing mode, if desired */
2403 if (full_speed && dev->pdev->vendor == 0x17cc) 2404 if (full_speed && dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
2404 writel(1 << FORCE_FULL_SPEED_MODE, &dev->usb->xcvrdiag); 2405 writel(1 << FORCE_FULL_SPEED_MODE, &dev->usb->xcvrdiag);
2405 2406
2406 /* ... then enable host detection and ep0; and we're ready 2407 /* ... then enable host detection and ep0; and we're ready
@@ -2408,7 +2409,7 @@ static int net2280_start(struct usb_gadget *_gadget,
2408 */ 2409 */
2409 net2280_led_active (dev, 1); 2410 net2280_led_active (dev, 1);
2410 2411
2411 if (dev->pdev->vendor == 0x10b5) 2412 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX)
2412 defect7374_enable_data_eps_zero(dev); 2413 defect7374_enable_data_eps_zero(dev);
2413 2414
2414 ep0_start (dev); 2415 ep0_start (dev);
@@ -2471,7 +2472,7 @@ static int net2280_stop(struct usb_gadget *_gadget,
2471 net2280_led_active (dev, 0); 2472 net2280_led_active (dev, 0);
2472 2473
2473 /* Disable full-speed test mode */ 2474 /* Disable full-speed test mode */
2474 if (dev->pdev->vendor == 0x17cc) 2475 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
2475 writel(0, &dev->usb->xcvrdiag); 2476 writel(0, &dev->usb->xcvrdiag);
2476 2477
2477 device_remove_file (&dev->pdev->dev, &dev_attr_function); 2478 device_remove_file (&dev->pdev->dev, &dev_attr_function);
@@ -3120,7 +3121,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
3120 } 3121 }
3121 ep->stopped = 0; 3122 ep->stopped = 0;
3122 dev->protocol_stall = 0; 3123 dev->protocol_stall = 0;
3123 if (dev->pdev->vendor == 0x10b5) 3124 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX)
3124 ep->is_halt = 0; 3125 ep->is_halt = 0;
3125 else{ 3126 else{
3126 if (ep->dev->pdev->device == 0x2280) 3127 if (ep->dev->pdev->device == 0x2280)
@@ -3149,7 +3150,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
3149 cpu_to_le32s (&u.raw [0]); 3150 cpu_to_le32s (&u.raw [0]);
3150 cpu_to_le32s (&u.raw [1]); 3151 cpu_to_le32s (&u.raw [1]);
3151 3152
3152 if (dev->pdev->vendor == 0x10b5) 3153 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX)
3153 defect7374_workaround(dev, u.r); 3154 defect7374_workaround(dev, u.r);
3154 3155
3155 tmp = 0; 3156 tmp = 0;
@@ -3233,7 +3234,8 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
3233 } else { 3234 } else {
3234 VDEBUG(dev, "%s clear halt\n", e->ep.name); 3235 VDEBUG(dev, "%s clear halt\n", e->ep.name);
3235 clear_halt(e); 3236 clear_halt(e);
3236 if (ep->dev->pdev->vendor == 0x10b5 && 3237 if (ep->dev->pdev->vendor ==
3238 PCI_VENDOR_ID_PLX &&
3237 !list_empty(&e->queue) && e->td_dma) 3239 !list_empty(&e->queue) && e->td_dma)
3238 restart_dma(e); 3240 restart_dma(e);
3239 } 3241 }
@@ -3255,7 +3257,7 @@ static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
3255 if (e->ep.name == ep0name) 3257 if (e->ep.name == ep0name)
3256 goto do_stall; 3258 goto do_stall;
3257 set_halt (e); 3259 set_halt (e);
3258 if (dev->pdev->vendor == 0x10b5 && e->dma) 3260 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX && e->dma)
3259 abort_dma(e); 3261 abort_dma(e);
3260 allow_status (ep); 3262 allow_status (ep);
3261 VDEBUG (dev, "%s set halt\n", ep->ep.name); 3263 VDEBUG (dev, "%s set halt\n", ep->ep.name);
@@ -3423,7 +3425,7 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat)
3423 writel (tmp, &dma->dmastat); 3425 writel (tmp, &dma->dmastat);
3424 3426
3425 /* dma sync*/ 3427 /* dma sync*/
3426 if (dev->pdev->vendor == 0x10b5) { 3428 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX) {
3427 u32 r_dmacount = readl(&dma->dmacount); 3429 u32 r_dmacount = readl(&dma->dmacount);
3428 if (!ep->is_in && (r_dmacount & 0x00FFFFFF) && 3430 if (!ep->is_in && (r_dmacount & 0x00FFFFFF) &&
3429 (tmp & (1 << DMA_TRANSACTION_DONE_INTERRUPT))) 3431 (tmp & (1 << DMA_TRANSACTION_DONE_INTERRUPT)))
@@ -3508,7 +3510,7 @@ static irqreturn_t net2280_irq (int irq, void *_dev)
3508 struct net2280 *dev = _dev; 3510 struct net2280 *dev = _dev;
3509 3511
3510 /* shared interrupt, not ours */ 3512 /* shared interrupt, not ours */
3511 if (dev->pdev->vendor == 0x17cc && 3513 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY &&
3512 (!(readl(&dev->regs->irqstat0) & (1 << INTA_ASSERTED)))) 3514 (!(readl(&dev->regs->irqstat0) & (1 << INTA_ASSERTED))))
3513 return IRQ_NONE; 3515 return IRQ_NONE;
3514 3516
@@ -3520,7 +3522,7 @@ static irqreturn_t net2280_irq (int irq, void *_dev)
3520 /* control requests and PIO */ 3522 /* control requests and PIO */
3521 handle_stat0_irqs (dev, readl (&dev->regs->irqstat0)); 3523 handle_stat0_irqs (dev, readl (&dev->regs->irqstat0));
3522 3524
3523 if (dev->pdev->vendor == 0x10b5) { 3525 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX) {
3524 /* re-enable interrupt to trigger any possible new interrupt */ 3526 /* re-enable interrupt to trigger any possible new interrupt */
3525 u32 pciirqenb1 = readl(&dev->regs->pciirqenb1); 3527 u32 pciirqenb1 = readl(&dev->regs->pciirqenb1);
3526 writel(pciirqenb1 & 0x7FFFFFFF, &dev->regs->pciirqenb1); 3528 writel(pciirqenb1 & 0x7FFFFFFF, &dev->regs->pciirqenb1);
@@ -3565,7 +3567,7 @@ static void net2280_remove (struct pci_dev *pdev)
3565 } 3567 }
3566 if (dev->got_irq) 3568 if (dev->got_irq)
3567 free_irq (pdev->irq, dev); 3569 free_irq (pdev->irq, dev);
3568 if (use_msi && dev->pdev->vendor == 0x10b5) 3570 if (use_msi && dev->pdev->vendor == PCI_VENDOR_ID_PLX)
3569 pci_disable_msi(pdev); 3571 pci_disable_msi(pdev);
3570 if (dev->regs) 3572 if (dev->regs)
3571 iounmap (dev->regs); 3573 iounmap (dev->regs);
@@ -3601,7 +3603,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
3601 spin_lock_init (&dev->lock); 3603 spin_lock_init (&dev->lock);
3602 dev->pdev = pdev; 3604 dev->pdev = pdev;
3603 dev->gadget.ops = &net2280_ops; 3605 dev->gadget.ops = &net2280_ops;
3604 dev->gadget.max_speed = (dev->pdev->vendor == 0x10b5) ? 3606 dev->gadget.max_speed = (dev->pdev->vendor == PCI_VENDOR_ID_PLX) ?
3605 USB_SPEED_SUPER : USB_SPEED_HIGH; 3607 USB_SPEED_SUPER : USB_SPEED_HIGH;
3606 3608
3607 /* the "gadget" abstracts/virtualizes the controller */ 3609 /* the "gadget" abstracts/virtualizes the controller */
@@ -3644,7 +3646,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
3644 dev->dep = (struct net2280_dep_regs __iomem *) (base + 0x0200); 3646 dev->dep = (struct net2280_dep_regs __iomem *) (base + 0x0200);
3645 dev->epregs = (struct net2280_ep_regs __iomem *) (base + 0x0300); 3647 dev->epregs = (struct net2280_ep_regs __iomem *) (base + 0x0300);
3646 3648
3647 if (dev->pdev->vendor == 0x10b5) { 3649 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX) {
3648 u32 fsmvalue; 3650 u32 fsmvalue;
3649 u32 usbstat; 3651 u32 usbstat;
3650 dev->usb_ext = (struct usb338x_usb_ext_regs __iomem *) 3652 dev->usb_ext = (struct usb338x_usb_ext_regs __iomem *)
@@ -3687,7 +3689,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
3687 goto done; 3689 goto done;
3688 } 3690 }
3689 3691
3690 if (use_msi && dev->pdev->vendor == 0x10b5) 3692 if (use_msi && dev->pdev->vendor == PCI_VENDOR_ID_PLX)
3691 if (pci_enable_msi(pdev)) 3693 if (pci_enable_msi(pdev))
3692 ERROR(dev, "Failed to enable MSI mode\n"); 3694 ERROR(dev, "Failed to enable MSI mode\n");
3693 3695
@@ -3726,7 +3728,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
3726 } 3728 }
3727 3729
3728 /* enable lower-overhead pci memory bursts during DMA */ 3730 /* enable lower-overhead pci memory bursts during DMA */
3729 if (dev->pdev->vendor == 0x17cc) 3731 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
3730 writel((1 << DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE) 3732 writel((1 << DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE)
3731 // 256 write retries may not be enough... 3733 // 256 write retries may not be enough...
3732 // | (1 << PCI_RETRY_ABORT_ENABLE) 3734 // | (1 << PCI_RETRY_ABORT_ENABLE)
@@ -3779,7 +3781,7 @@ static void net2280_shutdown (struct pci_dev *pdev)
3779 writel (0, &dev->usb->usbctl); 3781 writel (0, &dev->usb->usbctl);
3780 3782
3781 /* Disable full-speed test mode */ 3783 /* Disable full-speed test mode */
3782 if (dev->pdev->vendor == 0x17cc) 3784 if (dev->pdev->vendor == PCI_VENDOR_ID_PLX_LEGACY)
3783 writel(0, &dev->usb->xcvrdiag); 3785 writel(0, &dev->usb->xcvrdiag);
3784} 3786}
3785 3787
@@ -3789,14 +3791,14 @@ static void net2280_shutdown (struct pci_dev *pdev)
3789static const struct pci_device_id pci_ids [] = { { 3791static const struct pci_device_id pci_ids [] = { {
3790 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe), 3792 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
3791 .class_mask = ~0, 3793 .class_mask = ~0,
3792 .vendor = 0x17cc, 3794 .vendor = PCI_VENDOR_ID_PLX_LEGACY,
3793 .device = 0x2280, 3795 .device = 0x2280,
3794 .subvendor = PCI_ANY_ID, 3796 .subvendor = PCI_ANY_ID,
3795 .subdevice = PCI_ANY_ID, 3797 .subdevice = PCI_ANY_ID,
3796}, { 3798}, {
3797 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe), 3799 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
3798 .class_mask = ~0, 3800 .class_mask = ~0,
3799 .vendor = 0x17cc, 3801 .vendor = PCI_VENDOR_ID_PLX_LEGACY,
3800 .device = 0x2282, 3802 .device = 0x2282,
3801 .subvendor = PCI_ANY_ID, 3803 .subvendor = PCI_ANY_ID,
3802 .subdevice = PCI_ANY_ID, 3804 .subdevice = PCI_ANY_ID,
@@ -3804,7 +3806,7 @@ static const struct pci_device_id pci_ids [] = { {
3804 { 3806 {
3805 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe), 3807 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
3806 .class_mask = ~0, 3808 .class_mask = ~0,
3807 .vendor = 0x10b5, 3809 .vendor = PCI_VENDOR_ID_PLX,
3808 .device = 0x3380, 3810 .device = 0x3380,
3809 .subvendor = PCI_ANY_ID, 3811 .subvendor = PCI_ANY_ID,
3810 .subdevice = PCI_ANY_ID, 3812 .subdevice = PCI_ANY_ID,
@@ -3812,7 +3814,7 @@ static const struct pci_device_id pci_ids [] = { {
3812 { 3814 {
3813 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe), 3815 .class = ((PCI_CLASS_SERIAL_USB << 8) | 0xfe),
3814 .class_mask = ~0, 3816 .class_mask = ~0,
3815 .vendor = 0x10b5, 3817 .vendor = PCI_VENDOR_ID_PLX,
3816 .device = 0x3382, 3818 .device = 0x3382,
3817 .subvendor = PCI_ANY_ID, 3819 .subvendor = PCI_ANY_ID,
3818 .subdevice = PCI_ANY_ID, 3820 .subdevice = PCI_ANY_ID,
diff --git a/drivers/usb/gadget/net2280.h b/drivers/usb/gadget/net2280.h
index a257516abbd6..30478c8ed878 100644
--- a/drivers/usb/gadget/net2280.h
+++ b/drivers/usb/gadget/net2280.h
@@ -43,6 +43,7 @@ set_idx_reg (struct net2280_regs __iomem *regs, u32 index, u32 value)
43 43
44#endif /* __KERNEL__ */ 44#endif /* __KERNEL__ */
45 45
46#define PCI_VENDOR_ID_PLX_LEGACY 0x17cc
46 47
47#define REG_DIAG 0x0 48#define REG_DIAG 0x0
48#define RETRY_COUNTER 16 49#define RETRY_COUNTER 16