Am Montag, 16. Juni 2003 21:02 schrieb Greg KH: > On Sat, Jun 14, 2003 at 12:21:14PM +0200, Oliver Neukum wrote: > > Am Samstag, 14. Juni 2003 01:34 schrieb Greg KH: > > > On Thu, Jun 12, 2003 at 09:27:38AM +0200, Oliver Neukum wrote: > > > > Hi Greg, > > > > > > > > this changes kaweth to use usb_buffer_alloc in the control > > > > and recieve paths, in which it is using fixed buffers which > > > > are not safe on some architectures. As a plus, it should > > > > get a little faster on some architectures. > > > > Please apply. > > > > > > I got the following trying to apply it: > > > > > > [EMAIL PROTECTED] linux-2.5-bk]$ patch -p1 -g1 --dry-run < ../u2 > > > drivers/usb/net/kaweth.c 1.65: 1253 lines patching file > > > drivers/usb/net/kaweth.c Hunk #2 succeeded at 226 (offset 2 lines). > > > Hunk #4 succeeded at 538 (offset 2 lines). > > > Hunk #6 succeeded at 673 (offset 2 lines). > > > Hunk #8 succeeded at 1040 (offset 2 lines). > > > Hunk #9 FAILED at 1074. > > > Hunk #10 FAILED at 1090. > > > Hunk #11 succeeded at 1149 (offset 4 lines). > > > 2 out of 11 hunks FAILED -- saving rejects to file > > > drivers/usb/net/kaweth.c.rej > > > > > > > > > And this was before applying Alan Stern's patch :) > > > > > > Can you re-diff this against the latest -bk tree? > > > > This should hopefully work. > > Ugh, nope, still fails :(
OK, here we go again. Regards Oliver PS: If that doesn't work, I'll sacrifice a few floppies to the gods. You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== [EMAIL PROTECTED], 2003-06-18 10:19:40+02:00, [EMAIL PROTECTED] - switch to usb_buffer_alloc kaweth.c | 46 +++++++++++++++++++++++++++++++++++++++------- 1 files changed, 39 insertions(+), 7 deletions(-) diff -Nru a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c --- a/drivers/usb/net/kaweth.c Wed Jun 18 10:23:55 2003 +++ b/drivers/usb/net/kaweth.c Wed Jun 18 10:23:55 2003 @@ -225,13 +225,17 @@ struct urb *rx_urb; struct urb *tx_urb; struct urb *irq_urb; + + dma_addr_t intbufferhandle; + __u8 *intbuffer; + dma_addr_t rxbufferhandle; + __u8 *rx_buf; + struct sk_buff *tx_skb; __u8 *firmware_buf; __u8 scratch[KAWETH_SCRATCH_SIZE]; - __u8 rx_buf[KAWETH_BUF_SIZE]; - __u8 intbuffer[INTBUFFERSIZE]; __u16 packet_filter_bitmap; struct kaweth_ethernet_configuration configuration; @@ -524,6 +528,8 @@ KAWETH_BUF_SIZE, kaweth_usb_receive, kaweth); + kaweth->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + kaweth->rx_urb->transfer_dma = kaweth->rxbufferhandle; if((result = usb_submit_urb(kaweth->rx_urb, mem_flags))) { if (result == -ENOMEM) @@ -532,7 +538,7 @@ } else { kaweth->suspend_lowmem = 0; } - + return result; } @@ -630,6 +636,8 @@ int_callback, kaweth, HZ/4); + kaweth->irq_urb->transfer_dma = kaweth->intbufferhandle; + kaweth->irq_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; res = usb_submit_urb(kaweth->irq_urb, GFP_KERNEL); if (res) { @@ -665,10 +673,10 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr) { u32 ethcmd; - + if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) return -EFAULT; - + switch (ethcmd) { case ETHTOOL_GDRVINFO: { struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO}; @@ -678,7 +686,7 @@ return 0; } } - + return -EOPNOTSUPP; } @@ -1033,6 +1041,19 @@ if (!kaweth->irq_urb) goto err_tx_and_rx; + kaweth->intbuffer = usb_buffer_alloc( kaweth->dev, + INTBUFFERSIZE, + GFP_KERNEL, + &kaweth->intbufferhandle); + if (!kaweth->intbuffer) + goto err_tx_and_rx_and_irq; + kaweth->rx_buf = usb_buffer_alloc( kaweth->dev, + KAWETH_BUF_SIZE, + GFP_KERNEL, + &kaweth->rxbufferhandle); + if (!kaweth->rx_buf) + goto err_all_but_rxbuf; + kaweth->net = netdev; memcpy(kaweth->net->broadcast, &bcast_addr, sizeof(bcast_addr)); memcpy(kaweth->net->dev_addr, @@ -1053,7 +1074,7 @@ kaweth->net->mtu = le16_to_cpu(kaweth->configuration.segment_size); memset(&kaweth->stats, 0, sizeof(kaweth->stats)); - + SET_MODULE_OWNER(netdev); usb_set_intfdata(intf, kaweth); @@ -1071,6 +1092,12 @@ err_intfdata: usb_set_intfdata(intf, NULL); +err_all: + usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); +err_all_but_rxbuf: + usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); +err_tx_and_rx_and_irq: + usb_free_urb(kaweth->irq_urb); err_tx_and_rx: usb_free_urb(kaweth->rx_urb); err_only_tx: @@ -1123,6 +1150,11 @@ usb_free_urb(kaweth->rx_urb); usb_free_urb(kaweth->tx_urb); + usb_free_urb(kaweth->irq_urb); + + + usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); + usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); kfree(kaweth); } =================================================================== This BitKeeper patch contains the following changesets: 1.1985 ## Wrapped with gzip_uu ## begin 664 bkpatch5743 M'XL(`)LA\#X``[U6:4_;0!#][/T56U6J0HN3/>[EMAIL PROTECTED](([EMAIL PROTECTED]"D0!5*E"LAQ[ M<RAQW*YMH))_?,=V")@0H*U:*])X=^=X\^;9SEM\F4CE:O%B=BT5>HL_QTGJ M:G`?9:%<-I<RFV=1,U83.!O&,9RUIG$D6U5`ZT))F;3F_HU,IY%4$XG`;^"G MP13#<>)JM,G7.^G/[]+5AKU/EU\Z0X3:;?QQZB\G\ERFN-U&H_E!F,E%<ZYB M?UJ4S-?'.2.$4LI,PDU!S9S9G!LY%604PFW(+&<[EMAIL PROTECTED]([EMAIL PROTECTED] [EMAIL PROTECTED],)X3;G"[EMAIL PROTECTED];F/`6$2UJ8TI<ZK@&^4"82PBN [EMAIL PROTECTED]@6*=H$/\]RU\1`'6<7(S*PF+,?3BC;+Q6"K/7RSB`!UCP^(&&MQS MA_3?O!`B/D'[EMAIL PROTECTED]@!G$8R3FS*<^%$"$EAC\*?&J&PGZ& MG5I6&$0M<S$'F]C4YE9.#,.R2UULBWA:)G^.&DV4G!Q4F8(X>A&I`$M,EG.' M.V:I&&'5]6*[W'J%7KB#=>N_"::@]0SKZJ;[EMAIL PROTECTED]&6QG^`S'U&;.P0%=("R/? M\\-0>2F>+=,*!;03+N0>TCPOL_'[]?Y>S5W=/NFM;HM>]B!WEW&.&>J;3(#1 M*KCZ/CAD:J3OI\I?)D7/XX4_27#>QI?#0^_TS+L8=D[/[EMAIL PROTECTED] [EMAIL PROTECTED]/;N/[XSJDKLE-3`%!::Y07W#V$,I,[EMAIL PROTECTED](KX)D#-)4!?H1% MRW5IBK5=K>UJW:>DP,[EMAIL PROTECTED]:[EMAIL PROTECTED]>G%X>00HSOO?>G>; MGXX&WG%O>-K[<K?S;DO#.]#Q;(P;;S;.=R!R$H-VI0(MW'[EMAIL PROTECTED]'$ M:_$>[EMAIL PROTECTED])>+ZR#<`5^5K:*$Z[*5>&5GJE!)3%,2O;,F\Q>'Y6+F[ M2'[EMAIL PROTECTED]/@Q:MRXCF<A?K]31[&[1:<`>@/[EMAIL PROTECTED])[3[C8MKXIN MC&Y5N*A8"+SQ2/`0UB]><-A\T>^J>+W\8][^/4GK?T+!5`;S)(O:/F>C0#(# *_0)$KN4'B0D````` ` end ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel