* /drivers/usb/class/cdc-acm.c patch question, please cc
@ 2006-09-22 21:45 Ryan Moszynski
2006-09-22 22:30 ` Greg KH
2006-09-24 13:26 ` Oliver Neukum
0 siblings, 2 replies; 6+ messages in thread
From: Ryan Moszynski @ 2006-09-22 21:45 UTC (permalink / raw)
To: David Kubicek, linux-kernel
using
2.6.18
quick version of this question:
how could i change line 1 to line 2 without breaking anything while
providing the
functionality of the patch i'm trying to apply?
/* line 1 /drivers/usb/class/cdc-acm.c line 918
readsize = le16_to_cpu(epread->wMaxPacketSize)* ( quirks ==
SINGLE_RX_URB ? 1 : 2);
/* line 2
readsize = (le16_to_cpu(epread->wMaxPacketSize) >
maxszr)?le16_to_cpu(epread->wMaxPacketSize):maxszr;
long version:
since 2.6.14 i have been applying the following patch and recompiling
my kernel so
that i can use my verizon kpc650 evdo card with my laptop. I've
applied this patch
succesfully on 2.6.14 and 2.6.15. It works great and I have no problems. I am
trying to apply the patch to 2.6.18 but it fails, and i don't want to
break anything,
though I do need the functionality of the patch, since evdo is my only form of
internet(i live out in the sticks.) Without this patch, after setting
up the needed
config files, i can websurf, but if i try to download anything, the
connection closes.
The rest of this patch, other than the chunk of which this line is a part,
applies successfully.
ftp://ftp.sonic.net/pub/users/qm/PC5740/usb_bufsz_linux-2.6.14-ulmo
#################
--- ./drivers/usb/class/cdc-acm.c.~1~ 2005-11-12 21:28:19.000000000 -0800
+++ ./drivers/usb/class/cdc-acm.c 2005-12-04 10:35:10.000000000 -0800
@@ -73,6 +73,7 @@
#define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt,
Vojtech Pavlik"
#define DRIVER_DESC "USB Abstract Control Model driver for USB modems
and ISDN adapters"
+static ushort maxszc = 0, maxszw = 0, maxszr = 0;
static struct usb_driver acm_driver;
static struct tty_driver *acm_tty_driver;
static struct acm *acm_table[ACM_TTY_MINORS];
@@ -833,9 +834,9 @@
}
memset(acm, 0, sizeof(struct acm));
- ctrlsize = le16_to_cpu(epctrl->wMaxPacketSize);
- readsize = le16_to_cpu(epread->wMaxPacketSize);
- acm->writesize = le16_to_cpu(epwrite->wMaxPacketSize);
+ ctrlsize = (le16_to_cpu(epctrl->wMaxPacketSize) >
maxszc)?le16_to_cpu(epctrl->wMaxPacketSize):maxszc;
+ readsize = (le16_to_cpu(epread->wMaxPacketSize) >
maxszr)?le16_to_cpu(epread->wMaxPacketSize):maxszr;
+ acm->writesize = (le16_to_cpu(epwrite->wMaxPacketSize) >
maxszw)?le16_to_cpu(epwrite->wMaxPacketSize):maxszw;
acm->control = control_interface;
acm->data = data_interface;
acm->minor = minor;
@@ -1084,4 +1085,9 @@
MODULE_AUTHOR( DRIVER_AUTHOR );
MODULE_DESCRIPTION( DRIVER_DESC );
MODULE_LICENSE("GPL");
-
+module_param(maxszc, ushort,0);
+MODULE_PARM_DESC(maxszc,"User specified USB endpoint control size");
+module_param(maxszr, ushort,0);
+MODULE_PARM_DESC(maxszr,"User specified USB endpoint read size");
+module_param(maxszw, ushort,0);
+MODULE_PARM_DESC(maxszw,"User specified USB endpoint write size");
--- ./drivers/usb/serial/usb-serial.c.~1~ 2005-11-12 21:28:19.000000000 -0800
+++ ./drivers/usb/serial/usb-serial.c 2005-12-04 10:30:04.000000000 -0800
@@ -361,6 +361,7 @@
drivers depend on it.
*/
+static ushort maxSize = 0;
static int debug;
static struct usb_serial *serial_table[SERIAL_TTY_MINORS]; /*
initially all NULL */
static LIST_HEAD(usb_serial_driver_list);
@@ -1061,7 +1062,7 @@
dev_err(&interface->dev, "No free urbs available\n");
goto probe_error;
}
- buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+ buffer_size = (le16_to_cpu(endpoint->wMaxPacketSize) >
maxSize)?le16_to_cpu(endpoint->wMaxPacketSize):maxSize;
port->bulk_in_size = buffer_size;
port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
@@ -1085,7 +1086,7 @@
dev_err(&interface->dev, "No free urbs available\n");
goto probe_error;
}
- buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+ buffer_size = (le16_to_cpu(endpoint->wMaxPacketSize) >
maxSize)?le16_to_cpu(endpoint->wMaxPacketSize):maxSize;
port->bulk_out_size = buffer_size;
port->bulk_out_endpointAddress = endpoint->bEndpointAddress;
port->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL);
@@ -1110,7 +1111,7 @@
dev_err(&interface->dev, "No free urbs available\n");
goto probe_error;
}
- buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+ buffer_size = (le16_to_cpu(endpoint->wMaxPacketSize) >
maxSize)?le16_to_cpu(endpoint->wMaxPacketSize):maxSize;
port->interrupt_in_endpointAddress = endpoint->bEndpointAddress;
port->interrupt_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
if (!port->interrupt_in_buffer) {
@@ -1137,7 +1138,7 @@
dev_err(&interface->dev, "No free urbs available\n");
goto probe_error;
}
- buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+ buffer_size = (le16_to_cpu(endpoint->wMaxPacketSize) >
maxSize)?le16_to_cpu(endpoint->wMaxPacketSize):maxSize;
port->interrupt_out_size = buffer_size;
port->interrupt_out_endpointAddress = endpoint->bEndpointAddress;
port->interrupt_out_buffer = kmalloc (buffer_size, GFP_KERNEL);
@@ -1434,3 +1435,5 @@
module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug enabled or not");
+module_param(maxSize, ushort,0);
+MODULE_PARM_DESC(maxSize,"User specified USB endpoint size");
#################
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: /drivers/usb/class/cdc-acm.c patch question, please cc
2006-09-22 21:45 /drivers/usb/class/cdc-acm.c patch question, please cc Ryan Moszynski
@ 2006-09-22 22:30 ` Greg KH
2006-09-24 13:26 ` Oliver Neukum
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2006-09-22 22:30 UTC (permalink / raw)
To: Ryan Moszynski; +Cc: David Kubicek, linux-kernel
On Fri, Sep 22, 2006 at 05:45:21PM -0400, Ryan Moszynski wrote:
> using
> 2.6.18
>
> quick version of this question:
>
> how could i change line 1 to line 2 without breaking anything while
> providing the
> functionality of the patch i'm trying to apply?
>
>
> /* line 1 /drivers/usb/class/cdc-acm.c line 918
> readsize = le16_to_cpu(epread->wMaxPacketSize)* ( quirks ==
> SINGLE_RX_URB ? 1 : 2);
>
> /* line 2
> readsize = (le16_to_cpu(epread->wMaxPacketSize) >
> maxszr)?le16_to_cpu(epread->wMaxPacketSize):maxszr;
>
>
>
>
>
> long version:
>
> since 2.6.14 i have been applying the following patch and recompiling
> my kernel so
> that i can use my verizon kpc650 evdo card with my laptop. I've
> applied this patch
> succesfully on 2.6.14 and 2.6.15. It works great and I have no problems.
> I am
> trying to apply the patch to 2.6.18 but it fails, and i don't want to
> break anything,
> though I do need the functionality of the patch, since evdo is my only form
> of
> internet(i live out in the sticks.) Without this patch, after setting
> up the needed
> config files, i can websurf, but if i try to download anything, the
> connection closes.
>
> The rest of this patch, other than the chunk of which this line is a part,
> applies successfully.
Try the 2.6.18 kernel with no patch, it should have a driver for this
device already.
If not, let me know, and I'll work on something, you should not have to
modify the usb-serial core to get this device to actually use a sane
data rate.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: /drivers/usb/class/cdc-acm.c patch question, please cc
2006-09-22 21:45 /drivers/usb/class/cdc-acm.c patch question, please cc Ryan Moszynski
2006-09-22 22:30 ` Greg KH
@ 2006-09-24 13:26 ` Oliver Neukum
2006-09-24 17:40 ` Ryan Moszynski
1 sibling, 1 reply; 6+ messages in thread
From: Oliver Neukum @ 2006-09-24 13:26 UTC (permalink / raw)
To: Ryan Moszynski; +Cc: David Kubicek, linux-kernel
Am Freitag, 22. September 2006 23:45 schrieb Ryan Moszynski:
> since 2.6.14 i have been applying the following patch and recompiling
> my kernel so
> that i can use my verizon kpc650 evdo card with my laptop. I've
> applied this patch
> succesfully on 2.6.14 and 2.6.15. It works great and I have no problems. I am
> trying to apply the patch to 2.6.18 but it fails, and i don't want to
> break anything,
First give me a description of your device. Secondly, we'll try
to find a generic solution. Thirdly, if nothing else helps, we'll add
a generic quirk to the driver.
Regards
Oliver
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: /drivers/usb/class/cdc-acm.c patch question, please cc
2006-09-24 13:26 ` Oliver Neukum
@ 2006-09-24 17:40 ` Ryan Moszynski
2006-09-25 15:07 ` Ryan Moszynski
2006-09-27 4:54 ` Greg KH
0 siblings, 2 replies; 6+ messages in thread
From: Ryan Moszynski @ 2006-09-24 17:40 UTC (permalink / raw)
To: linux-kernel; +Cc: Oliver Neukum, David Kubicek, greg
sorry guys, my bad.
I just compiled 2.6.18 again with my stock config, and everything
worked. With 2.6.15 i had to recompile using the patch and load these
in /etc/modules in order for my card to work at full speed.
######
ohci-hcd
usbserial vendor=0x0c88 product=0x17da maxSize=2048
cdc_acm maxszr=16384 maxszw=2048
#######
however, now, at boot the kernel loads the 'airprime' driver, and
everything works without any manual module loading. Yay. 2.6.15 had
the airprime driver, but i guess it didn't recognize my card at that
point.
However, to get this(and i would guess any other evdo) card to work,
you still have set up 4 config files:
######
etc/ppp/chap-secrets
etc/ppp/peers/verizon
etc/chatscripts/verizon-connect
etc/chatscripts/verizon-disconnect
#######
which makes it a lot more labor intensive to set up for the first time
than it is in windows, but at least everything works.
On 9/24/06, Oliver Neukum <oliver@neukum.org> wrote:
> Am Freitag, 22. September 2006 23:45 schrieb Ryan Moszynski:
> > since 2.6.14 i have been applying the following patch and recompiling
> > my kernel so
> > that i can use my verizon kpc650 evdo card with my laptop. I've
> > applied this patch
> > succesfully on 2.6.14 and 2.6.15. It works great and I have no problems. I am
> > trying to apply the patch to 2.6.18 but it fails, and i don't want to
> > break anything,
>
> First give me a description of your device. Secondly, we'll try
> to find a generic solution. Thirdly, if nothing else helps, we'll add
> a generic quirk to the driver.
>
> Regards
> Oliver
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: /drivers/usb/class/cdc-acm.c patch question, please cc
2006-09-24 17:40 ` Ryan Moszynski
@ 2006-09-25 15:07 ` Ryan Moszynski
2006-09-27 4:54 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Ryan Moszynski @ 2006-09-25 15:07 UTC (permalink / raw)
To: linux-kernel
well, chalk that up to false optimism.
my last message said that everything worked fine. It did, while I was
at home, where the maximum download speeds I can get are around 16
kbps, however, when I got into town where my speeds average 120 kbps
or so, the device is unusable. It can connect, and you can browse the
web, but as soon as you try to download something the connection
ceases to work, even though the card is still blinking like it's
connected. Setting the maxSize variable in the 2.6.15 patch fixed
this problem, i'm not sure whats in 2.6.18 thats supposed to do the
same job.
On 9/24/06, Ryan Moszynski <ryan.m.lists@gmail.com> wrote:
> sorry guys, my bad.
>
> I just compiled 2.6.18 again with my stock config, and everything
> worked. With 2.6.15 i had to recompile using the patch and load these
> in /etc/modules in order for my card to work at full speed.
>
> ######
> ohci-hcd
> usbserial vendor=0x0c88 product=0x17da maxSize=2048
> cdc_acm maxszr=16384 maxszw=2048
> #######
>
> however, now, at boot the kernel loads the 'airprime' driver, and
> everything works without any manual module loading. Yay. 2.6.15 had
> the airprime driver, but i guess it didn't recognize my card at that
> point.
>
> However, to get this(and i would guess any other evdo) card to work,
> you still have set up 4 config files:
>
> ######
> etc/ppp/chap-secrets
> etc/ppp/peers/verizon
> etc/chatscripts/verizon-connect
> etc/chatscripts/verizon-disconnect
> #######
>
> which makes it a lot more labor intensive to set up for the first time
> than it is in windows, but at least everything works.
>
>
>
> On 9/24/06, Oliver Neukum <oliver@neukum.org> wrote:
> > Am Freitag, 22. September 2006 23:45 schrieb Ryan Moszynski:
> > > since 2.6.14 i have been applying the following patch and recompiling
> > > my kernel so
> > > that i can use my verizon kpc650 evdo card with my laptop. I've
> > > applied this patch
> > > succesfully on 2.6.14 and 2.6.15. It works great and I have no problems. I am
> > > trying to apply the patch to 2.6.18 but it fails, and i don't want to
> > > break anything,
> >
> > First give me a description of your device. Secondly, we'll try
> > to find a generic solution. Thirdly, if nothing else helps, we'll add
> > a generic quirk to the driver.
> >
> > Regards
> > Oliver
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: /drivers/usb/class/cdc-acm.c patch question, please cc
2006-09-24 17:40 ` Ryan Moszynski
2006-09-25 15:07 ` Ryan Moszynski
@ 2006-09-27 4:54 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2006-09-27 4:54 UTC (permalink / raw)
To: Ryan Moszynski; +Cc: linux-kernel, Oliver Neukum, David Kubicek
On Sun, Sep 24, 2006 at 01:40:19PM -0400, Ryan Moszynski wrote:
>
> However, to get this(and i would guess any other evdo) card to work,
> you still have set up 4 config files:
>
> ######
> etc/ppp/chap-secrets
> etc/ppp/peers/verizon
> etc/chatscripts/verizon-connect
> etc/chatscripts/verizon-disconnect
> #######
>
> which makes it a lot more labor intensive to set up for the first time
> than it is in windows, but at least everything works.
Well, complain to the company that provides the cards. On Windows there
is a pretty little application that handles all of this for you.
Luckily for me, that's all in userspace and the kernel doesn't care
about it :)
Glad it's now working for you,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-27 5:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-22 21:45 /drivers/usb/class/cdc-acm.c patch question, please cc Ryan Moszynski
2006-09-22 22:30 ` Greg KH
2006-09-24 13:26 ` Oliver Neukum
2006-09-24 17:40 ` Ryan Moszynski
2006-09-25 15:07 ` Ryan Moszynski
2006-09-27 4:54 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox