]> git.lizzy.rs Git - plan9front.git/commitdiff
nusb/ether: tune buffer size parameters for SMSC ethernet (raspi) (thanks richard...
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sat, 20 Oct 2018 17:29:18 +0000 (19:29 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sat, 20 Oct 2018 17:29:18 +0000 (19:29 +0200)
sys/src/cmd/nusb/ether/smsc.c

index 43143d3d81230d2e8fdb2dbc2cd6aa20ef628496..87c59e9179c00743bb0019a13a87b0611b6e679c 100644 (file)
@@ -14,10 +14,9 @@ enum {
        Resettime       = 1000,
        E2pbusytime     = 1000,
        Afcdefault      = 0xF830A1,
-//     Hsburst         = 37,   /* from original linux driver */
-       Hsburst         = 8,
+       Hsburst         = 24,
        Fsburst         = 129,
-       Defbulkdly      = 0x2000,
+       Defbulkdly      = 1000,
 
        Ethp8021q       = 0x8100,
        MACoffset       = 1,
@@ -211,11 +210,9 @@ smscreceive(Dev *ep)
        uint hd;
        int n;
 
-       if(Doburst)
-               b = allocb(Hsburst*512);
-       else
-               b = allocb(Maxpkt+4);
-       if((n = read(ep->dfd, b->wp, b->lim - b->base)) < 0){
+       n = Doburst? Hsburst*512 : Maxpkt+4;
+       b = allocb(n);
+       if((n = read(ep->dfd, b->wp, n)) < 0){
                freeb(b);
                return -1;
        }