User`s guide

Aironet Wireless Communications, Inc. 7-39 Confidential and Proprietary
Transmitting an 802.3 Packet
The following is sample code for transmitting a packet:
typedef struct { /* transmit control header */
unsigned long SwSupport; /* for use by host drivers */
unsigned short Status;
unsigned short PayloadLen;
unsigned short TxControl;
#define TXCTL_TXOK (1<<1) /* report if tx is ok */
#define TXCTL_TXEX (1<<2) /* report if tx fails */
#define TXCTL_802_3 (0<<3) /* 802.3 packet */
#define TXCTL_802_11 (1<<3) /* 802.11 mac packet */
#define TXCTL_ETHERNET (0<<4) /* payload has ethertype */
#define TXCTL_LLC (1<<4) /* payload is llc */
#define TXCTL_RELEASE (0<<5) /* release after completion */
#define TXCTL_NORELEASE (1<<5) /* on completion returns to host */
} tdsTxCtlHdr;
tdsCommand Cmd;
tdsResponse Rsp;
unsigned short transmit_allocate(int lenPayload)
{
Cmd.Command = CMD_ALLOCATETX;
Cmd.Param0 = lenPayload;
if (issuecommand(&cmd, &rsp) != SUCCESS) return 0;
if ( (rsp.Status & 0xFF00) != 0) return 0;
// wait for the allocate event/indication
while ( (IN4500(EVSTAT) & EV_ALLOC) == 0) ;
// get the allocated fid and acknowledge
TxFid = IN4500(TXALLOCFID);
OUT4500(EVACK, EV_ALLOC);
return TxFid;
}
transmit_802_3_packet(char *pPacket, int len)
{
unsigned short TxFid, TxControl, PayloadLen, EvStat, Status;
if (len < 12) return ERROR;
// packet is destination[6], source[6], payload[len-12]
if ( (TxFid = transmit_allocate(len-12)) == 0) return ERROR;
// write the Transmit control options
TxControl = TXCTL_TXOK | TXCTL_TXEX | TXCTL_802_3
| TXCTL_ETHERNET | TXCTL_RELEASE;
if (bap0_setup(TxFid, 0x0008) != SUCCESS) return ERROR;
bap0_write(&TxControl, sizeof(TxControl));
// write the payload length and dst/src/payload
if (bap0_setup(TxFid, 0x0036) != SUCCESS) return ERROR;