kernels/linux-2.4.0/drivers/net/wan/sdla_fr.c
/*============================================================================
 * Send a frame on a selected DLCI.  
 */
Send a frame on a selected DLCI.
Send a frame on a selected DLCI .
static int fr_send (sdla_t* card, int dlci, unsigned char attr, int len,
	void *buf)
{
	fr_mbox_t* mbox = card->mbox + 0x800;
	int retry = MAX_CMD_RETRY;
	int err;
	do
	{
		mbox->cmd.dlci    = dlci;
		mbox->cmd.attr    = attr;
		mbox->cmd.length  = len;
		mbox->cmd.command = FR_WRITE;
		err = sdla_exec(mbox) ? mbox->cmd.result : CMD_TIMEOUT;
	} while (err && retry-- && fr_event(card, err, mbox));
	if (!err) {
		fr_tx_buf_ctl_t* frbuf;
               	if(card->hw.type == SDLA_S514)
			frbuf = (void*)(*(unsigned long*)mbox->data +
                        	card->hw.dpmbase);
		else
			frbuf = (void*)(*(unsigned long*)mbox->data -
                        	FR_MB_VECTOR + card->hw.dpmbase);
		sdla_poke(&card->hw, frbuf->offset, buf, len);
		frbuf->flag = 0x01;
	}
	return err;
}
static int fr_send ( sdla_t * card , int dlci , unsigned char attr , int len , void * buf ) { fr_mbox_t * mbox = card -> mbox + 0x800 ; int retry = MAX_CMD_RETRY ; int err ; do { mbox -> cmd . dlci = dlci ; mbox -> cmd . attr = attr ; mbox -> cmd . length = len ; mbox -> cmd . command = FR_WRITE ; err = sdla_exec ( mbox ) ? mbox -> cmd . result : CMD_TIMEOUT ; } while ( err && retry -- && fr_event ( card , err , mbox ) ) ; if ( ! err ) { fr_tx_buf_ctl_t * frbuf ; if ( card -> hw . type == SDLA_S514 ) frbuf = ( void * ) ( * ( unsigned long * ) mbox -> data + card -> hw . dpmbase ) ; else frbuf = ( void * ) ( * ( unsigned long * ) mbox -> data - FR_MB_VECTOR + card -> hw . dpmbase ) ; sdla_poke ( & card -> hw , frbuf -> offset , buf , len ) ; frbuf -> flag = 0x01 ; } return err ; }
Send a frame on a selected DLCI.
Send a frame on a selected DLCI .