changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: nusb/ether: tune buffer size parameters for SMSC ethernet (raspi) (thanks richard miller)

changeset 6827: 7b448156e427
parent 6826: 4160a02cb25d
child 6828: a803b93706b8
author: cinap_lenrek@felloff.net
date: Sat, 20 Oct 2018 19:29:18 +0200
files: sys/src/cmd/nusb/ether/smsc.c
description: nusb/ether: tune buffer size parameters for SMSC ethernet (raspi) (thanks richard miller)
     1.1--- a/sys/src/cmd/nusb/ether/smsc.c
     1.2+++ b/sys/src/cmd/nusb/ether/smsc.c
     1.3@@ -14,10 +14,9 @@ enum {
     1.4 	Resettime	= 1000,
     1.5 	E2pbusytime	= 1000,
     1.6 	Afcdefault	= 0xF830A1,
     1.7-//	Hsburst		= 37,	/* from original linux driver */
     1.8-	Hsburst		= 8,
     1.9+	Hsburst		= 24,
    1.10 	Fsburst		= 129,
    1.11-	Defbulkdly	= 0x2000,
    1.12+	Defbulkdly	= 1000,
    1.13 
    1.14 	Ethp8021q	= 0x8100,
    1.15 	MACoffset 	= 1,
    1.16@@ -211,11 +210,9 @@ smscreceive(Dev *ep)
    1.17 	uint hd;
    1.18 	int n;
    1.19 
    1.20-	if(Doburst)
    1.21-		b = allocb(Hsburst*512);
    1.22-	else
    1.23-		b = allocb(Maxpkt+4);
    1.24-	if((n = read(ep->dfd, b->wp, b->lim - b->base)) < 0){
    1.25+	n = Doburst? Hsburst*512 : Maxpkt+4;
    1.26+	b = allocb(n);
    1.27+	if((n = read(ep->dfd, b->wp, n)) < 0){
    1.28 		freeb(b);
    1.29 		return -1;
    1.30 	}