Re: [PATCH] USBNET: fix handling padding packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2013-09-18 at 17:52 +0200, Bjørn Mork wrote:

> No modern device should need the padding.  No old device will be able to
> use the SG feature as implemented. You only enable it on USB3, don't

On XHCI.

> you? If this feature is restricted to USB3 capable devices, then it most
> certainly can be restricted to ZLP capable devices with absolutely no
> difference in the resulting set of supported devices.

No, USB 3.0 uses no companion controllers, so you can have devices
of any speed connected to it.

> Anyway, if you want to keep the padding for SG then maybe this will work
> and allow you to drop the extra struct usbnet field and allocation:
> 
>                         if (skb_tailroom(skb) && !dev->can_dma_sg) {
>                                skb->data[skb->len] = 0;
>                                __skb_put(skb, 1);
>                         } else if (dev->can_dma_sg) {
>                               sg_set_buf(&urb->sg[urb->num_sgs++], skb->data, 1);
>                         }
> 
> I.e. cheat and use the skb->data buffer twice, if that is allowed?  The
> actual value of the padding byte should not matter, I believe?

That makes me immediately suspect a violation of the DMA rules.

	Regards
		Oliver


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux