~kris/9p

9hist

f6347b44fcb2d6b17d12f9f7f833cd0b55333b69 — David du Colombier 25 years ago 52d5186
Plan 9 from Bell Labs 2001-09-12
4 files changed, 34 insertions(+), 7 deletions(-)

M bitsy/etherwavelan.c
M pc/etherwavelan.c
M port/chan.c
M port/sysfile.c
M bitsy/etherwavelan.c => bitsy/etherwavelan.c +5 -1
@@ 105,7 105,6 @@ enum
	WTyp_NodeName	= 0xfc0e,
	WTyp_Crypt	= 0xfc20,
	WTyp_XClear	= 0xfc22,
	WTyp_Tick	= 0xfce0,
 	WTyp_CreateIBSS	= 0xfc81,
	WTyp_RtsThres	= 0xfc83,
	WTyp_TxRate	= 0xfc84,


@@ 115,10 114,12 @@ enum
	WTyp_Prom	= 0xfc85,
	WTyp_Keys	= 0xfcb0,
	WTyp_TxKey	= 0xfcb1,
	WTyp_StationID	= 0xfd20,
	WTyp_CurName	= 0xfd41,
	WTyp_BaseID	= 0xfd42,	// ID of the currently connected-to base station
	WTyp_CurTxRate	= 0xfd44,	// Current TX rate
	WTyp_HasCrypt	= 0xfd4f,
	WTyp_Tick	= 0xfce0,
};

// Controller


@@ 435,7 436,10 @@ ltv_outstr(Ctlr* ctlr, int type, char* val)
	memset(&ltv, 0, sizeof(ltv));
	ltv.len = (sizeof(ltv.type)+sizeof(ltv.slen)+sizeof(ltv.s))/2;
	ltv.type = type;

//	This should be ltv.slen = len; according to Axel Belinfante
	ltv.slen = (len+1) & ~1;

	strncpy(ltv.s, val, len);
	w_outltv(ctlr, &ltv);
}

M pc/etherwavelan.c => pc/etherwavelan.c +11 -1
@@ 105,7 105,7 @@ enum
	WTyp_NodeName	= 0xfc0e,
	WTyp_Crypt	= 0xfc20,
	WTyp_XClear	= 0xfc22,
	WTyp_Tick	= 0xfce0,
 	WTyp_CreateIBSS	= 0xfc81,
	WTyp_RtsThres	= 0xfc83,
	WTyp_TxRate	= 0xfc84,
		WTx1Mbps	= 0x0,


@@ 119,6 119,7 @@ enum
	WTyp_BaseID	= 0xfd42,	// ID of the currently connected-to base station
	WTyp_CurTxRate	= 0xfd44,	// Current TX rate
	WTyp_HasCrypt	= 0xfd4f,
	WTyp_Tick	= 0xfce0,
};

// Controller


@@ 274,6 275,7 @@ struct Ctlr
	int	attached;
	int	slot;
	int	iob;
 	int	createibss;
	int	ptype;
	int	apdensity;
	int	rtsthres;


@@ 541,6 543,7 @@ w_enable(Ether* ether)
	ltv_outs(ctlr, WTyp_Tick, 8);
	ltv_outs(ctlr, WTyp_MaxLen, ctlr->maxlen);
	ltv_outs(ctlr, WTyp_Ptype, ctlr->ptype);
 	ltv_outs(ctlr, WTyp_CreateIBSS, ctlr->createibss);
	ltv_outs(ctlr, WTyp_RtsThres, ctlr->rtsthres);
	ltv_outs(ctlr, WTyp_TxRate, ctlr->txrate);
	ltv_outs(ctlr, WTyp_ApDens, ctlr->apdensity);


@@ 1050,6 1053,12 @@ option(Ctlr* ctlr, char* buf, long n)
		else
			r = -1;
	}
	else if(cistrcmp(cb->f[0], "ibss") == 0){
		if(cistrcmp(cb->f[1], "on") == 0)
			ctlr->createibss = 1;
		else
			ctlr->createibss = 0;
	}
	else if(cistrcmp(cb->f[0], "crypt") == 0){
		if(cistrcmp(cb->f[1], "off") == 0)
			ctlr->crypt = 0;


@@ 1218,6 1227,7 @@ reset(Ether* ether)
	ctlr->chan = 0;
	ctlr->ptype = WDfltPType;
	ctlr->txkey = 0;
	ctlr->createibss = 0;
	ctlr->keys.len = sizeof(WKey)*WNKeys/2 + 1;
	ctlr->keys.type = WTyp_Keys;
	if(ctlr->hascrypt = ltv_ins(ctlr, WTyp_HasCrypt))

M port/chan.c => port/chan.c +11 -4
@@ 546,10 546,17 @@ cunmount(Chan *mnt, Chan *mounted)
	Mhead *m, **l;
	Mount *f, **p;

if(mnt->umh)	/* should not happen */
	print("cunmount newp extra umh %p has %p\n", mnt, mnt->umh);
if(mounted && mounted->umh)
	print("cunmount old extra umh %p has %p\n", mounted, mounted->umh);
	if(mnt->umh)	/* should not happen */
		print("cunmount newp extra umh %p has %p\n", mnt, mnt->umh);

	/*
	 * It _can_ happen that mounted->umh is non-nil, 
	 * because mounted is the result of namec(Aopen)
	 * (see sysfile.c:/^sysunmount).
	 * If we open a union directory, it will have a umh.
	 * Although surprising, this is okay, since the
	 * cclose will take care of freeing the umh.
	 */

	pg = up->pgrp;
	wlock(&pg->ns);

M port/sysfile.c => port/sysfile.c +7 -1
@@ 784,7 784,13 @@ sysunmount(ulong *arg)
			nexterror();
		}
		validaddr(arg[0], 1, 0);
		cmounted = namec((char*)arg[0], Aaccess, OREAD, 0);
		/*
		 * This has to be namec(..., Aopen, ...) because
		 * if arg[0] is something like /srv/cs or /fd/0,
		 * opening it is the only way to get at the real
		 * Chan underneath.
		 */
		cmounted = namec((char*)arg[0], Aopen, OREAD, 0);
		poperror();
	}