plan 9 kernel history: overview | file list | diff list

1999/0715/pc/io.h (diff list | history)

1999/0713/sys/src/9/pc/io.h:219,2331999/0715/sys/src/9/pc/io.h:219,246 (short | long | prev | next)
Add SMBus transaction enum and generic function. Add locking.
rsc Fri Mar 4 12:44:25 2005
1998/0910    
	Scsiio	(*reset)(int, ISAConf*); 
} SCSIdev; 
1999/0713    
 
1999/0715    
/* SMBus transactions */ 
enum 
{ 
	SMBquick,		/* sends address only */ 
 
	/* write */ 
	SMBsend,		/* sends address and cmd */ 
	SMBbytewrite,		/* sends address and cmd and 1 byte */ 
	SMBwordwrite,		/* sends address and cmd and 2 bytes */ 
 
	/* read */ 
	SMBrecv,		/* sends address, recvs 1 byte */ 
	SMBbyteread,		/* sends address and cmd, recv's byte */ 
	SMBwordread,		/* sends address and cmd, recv's 2 bytes */ 
}; 
 
1999/0713    
typedef struct SMBus SMBus; 
struct SMBus { 
	void	*arg; 
	ulong	addr; 
	int	(*quick)(SMBus*, int); 
	int	(*send)(SMBus*, int, int); 
	int	(*recv)(SMBus*, int, int*); 
	int	(*bytewrite)(SMBus*, int); 
	int	(*byteread)(SMBus*, int, int*); 
	int	(*wordwrite)(SMBus*, int); 
	int	(*wordread)(SMBus*, int, int*); 
1999/0715    
	QLock;		/* mutex */ 
	Rendez	r;	/* rendezvous point for completion interrupts */ 
	void	*arg;	/* implementation dependent */ 
	ulong	base;	/* port or memory base of smbus */ 
	int	busy; 
	void	(*transact)(SMBus*, int, int, int, uchar*); 
1999/0713    
}; 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)