Skip to content

Commit

Permalink
rndis_host: reduce MTU instead of refusing to talk to devices with lo…
Browse files Browse the repository at this point in the history
…w max packet size

This patch makes the host RNDIS driver talk to RNDIS devices with an MTU
less than 1.5k, instead of refusing to talk to such a device.

Signed-Off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>

--

Hi Jeff,
are you the right person to send this to?
Nobody else seems to be wanting to forward this to Linus...

Thanks,
Tom

Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Thomas Sailer authored and Jeff Garzik committed Oct 25, 2007
1 parent b88219f commit 500d2c2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions drivers/net/usb/rndis_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,19 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf)
}
tmp = le32_to_cpu(u.init_c->max_transfer_size);
if (tmp < dev->hard_mtu) {
dev_err(&intf->dev,
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
retval = -EINVAL;
goto fail_and_release;
if (tmp <= net->hard_header_len) {
dev_err(&intf->dev,
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
retval = -EINVAL;
goto fail_and_release;
}
dev->hard_mtu = tmp;
net->mtu = dev->hard_mtu - net->hard_header_len;
dev_warn(&intf->dev,
"dev can't take %u byte packets (max %u), "
"adjusting MTU to %u\n",
dev->hard_mtu, tmp, net->mtu);
}

/* REVISIT: peripheral "alignment" request is ignored ... */
Expand Down

0 comments on commit 500d2c2

Please sign in to comment.