User`s guide
Aironet Wireless Communications, Inc. 7-9 Confidential and Proprietary
In some circumstances Command.Busy also may not clear. This may occur when the host reads the
Command register at the same time as the firmware attempts to clear the Command.Busy bit.
A work-around is available for clearing a stuck Command.Busy, by setting EvAck.ClearCommandBusy.
If the firmware is not processing a command, the Command.Busy bit will be cleared.
The following is an example for issuing a single command:
typedef struct {
unsigned short Command;
unsigned short Param0;
unsigned short Param1;
unsigned short Param2;
} tdsCommand;
typedef struct {
unsigned short Status;
unsigned short Resp0;
unsigned short Resp1;
unsigned short Resp2;
} tdsResponse;
unsigned short issuecommand(tdsCommand *pCmd, tdsResponse *pRsp) {
// wait for command.busy to clear normally
// we will only issue one command at a time so no need
OUT4500(PARAM0, pCmd->Param0);
OUT4500(PARAM1, pCmd->Param1);
OUT4500(PARAM2, pCmd->Param2);
OUT4500(COMMAND, pCmd->Command);
while ( (IN4500(EVSTAT) & EV_CMD) == 0) {
if (IN4500(COMMAND) == command) { // PC4500 didn’t notice command, try again
OUT4500(COMMAND, command);
}
}
// command completed
pRsp->Status = IN4500(STATUS);
pRsp->Resp0 = IN4500(RESP0);
pRsp->Resp1 = IN4500(RESP1);
pRsp->Resp2 = IN4500(RESP2);
// clear stuck command busy if necessary
if (IN4500(COMMAND) & COMMAND_BUSY) {
OUT4500(EVACK, EV_CLEARCOMMANDBUSY);
}
// acknowledge processing the status/response
OUT4500(EVACK, EV_CMD);
}