Home | History | Annotate | Download | only in net

Lines Matching refs:hw

175 static inline UINT16 hfa384x_getreg( hfa384x_t *hw, UINT reg )
178 return inw ( hw->iobase + reg );
180 return readw ( hw->membase + reg );
185 static inline void hfa384x_setreg( hfa384x_t *hw, UINT16 val, UINT reg )
188 outw ( val, hw->iobase + reg );
190 writew ( val, hw->membase + reg );
199 static inline UINT16 hfa384x_getreg_noswap( hfa384x_t *hw, UINT reg )
201 return hfa384x_getreg ( hw, reg );
203 static inline void hfa384x_setreg_noswap( hfa384x_t *hw, UINT16 val, UINT reg )
205 hfa384x_setreg ( hw, val, reg );
220 * hw device structure
228 * in hw structure.
230 static int hfa384x_docmd_wait( hfa384x_t *hw, UINT16 cmd, UINT16 parm0, UINT16 parm1, UINT16 parm2)
237 reg = hfa384x_getreg(hw, HFA384x_CMD);
239 reg = hfa384x_getreg(hw, HFA384x_CMD);
249 hfa384x_setreg(hw, parm0, HFA384x_PARAM0);
250 hfa384x_setreg(hw, parm1, HFA384x_PARAM1);
251 hfa384x_setreg(hw, parm2, HFA384x_PARAM2);
252 hw->lastcmd = cmd;
253 hfa384x_setreg(hw, cmd, HFA384x_CMD);
257 reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
263 reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
273 hw->status = hfa384x_getreg(hw, HFA384x_STATUS);
274 hw->resp0 = hfa384x_getreg(hw, HFA384x_RESP0);
275 hw->resp1 = hfa384x_getreg(hw, HFA384x_RESP1);
276 hw->resp2 = hfa384x_getreg(hw, HFA384x_RESP2);
277 hfa384x_setreg(hw, HFA384x_EVACK_CMD, HFA384x_EVACK);
278 return HFA384x_STATUS_RESULT_GET(hw->status);
286 * hw device structure
292 static int hfa384x_prepare_bap(hfa384x_t *hw, UINT16 id, UINT16 offset)
303 hfa384x_setreg(hw, id, HFA384x_SELECT0);
305 hfa384x_setreg(hw, offset, HFA384x_OFFSET0);
309 reg = hfa384x_getreg(hw, HFA384x_OFFSET0);
328 * hw device structure
336 static int hfa384x_copy_from_bap(hfa384x_t *hw, UINT16 id, UINT16 offset,
345 result = hfa384x_prepare_bap ( hw, id, offset );
349 *(UINT16*)(&(d[i])) = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
353 reg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
367 * hw device structure
375 static int hfa384x_copy_to_bap(hfa384x_t *hw, UINT16 id, UINT16 offset,
384 result = hfa384x_prepare_bap ( hw, id, offset );
388 hfa384x_setreg_noswap(hw, *(UINT16*)(&(d[i])), HFA384x_DATA0);
392 savereg = hfa384x_getreg_noswap(hw, HFA384x_DATA0);
393 result = hfa384x_prepare_bap ( hw, id, offset + (len & 0xfffe) );
396 hfa384x_setreg_noswap(hw, savereg, HFA384x_DATA0);
410 * hw device structure
418 static inline int hfa384x_cmd_access(hfa384x_t *hw, UINT16 write, UINT16 rid)
420 return hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ACCESS) | HFA384x_CMD_WRITE_SET(write), rid, 0, 0);
427 * hw device structure
437 static int hfa384x_drvr_getconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len)
443 result = hfa384x_cmd_access( hw, 0, rid);
449 result = hfa384x_copy_from_bap( hw, rid, 0, &rec, sizeof(rec));
459 result = hfa384x_copy_from_bap( hw, rid, sizeof(rec), buf, len);
468 * hw device structure
476 static int hfa384x_drvr_getconfig16(hfa384x_t *hw, UINT16 rid, void *val)
479 result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT16));
487 static int hfa384x_drvr_getconfig32(hfa384x_t *hw, UINT16 rid, void *val)
490 result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(UINT32));
502 * hw device structure
510 static int hfa384x_drvr_setconfig(hfa384x_t *hw, UINT16 rid, void *buf, UINT16 len)
518 result = hfa384x_copy_to_bap( hw, rid, 0, &rec, sizeof(rec));
525 result = hfa384x_copy_to_bap( hw, rid, sizeof(rec), buf, len);
532 result = hfa384x_cmd_access( hw, 1, rid);
540 * hw device structure
547 static int hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 *val)
551 return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT16));
554 static int hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 *val)
558 return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT32));
567 * hw device structure
579 static int hfa384x_wait_for_event(hfa384x_t *hw, UINT16 event_mask, UINT16 event_ack, int wait, int timeout, const char *descr)
585 reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
594 hfa384x_setreg(hw, reg & ( event_mask | event_ack ), HFA384x_EVACK);
607 hfa384x_t *hw = &hw_global;
610 reg = hfa384x_getreg(hw, HFA384x_EVSTAT);
619 hfa384x_setreg(hw, HFA384x_EVACK_RX_SET(1), HFA384x_EVACK);
621 rxfid = hfa384x_getreg(hw, HFA384x_RXFID);
623 result = hfa384x_copy_from_bap(hw, rxfid, 0, &rxdesc, sizeof(rxdesc));
641 result = hfa384x_copy_from_bap(hw, rxfid, HFA384x_RX_DATA_OFF,
660 hfa384x_t *hw = &hw_global;
668 result = hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ALLOC), HFA384x_DRVR_TXBUF_MAX, 0, 0);
673 if ( !hfa384x_wait_for_event(hw, HFA384x_EVSTAT_ALLOC, HFA384x_EVACK_INFO, 10, 50, "Tx FID to be allocated\n" ) ) return;
674 fid = hfa384x_getreg(hw, HFA384x_ALLOCFID);
683 memcpy(txdesc.address1, hw->bssid, WLAN_ADDR_LEN);
692 result = hfa384x_copy_to_bap(hw, fid, 0, &txdesc, sizeof(txdesc));
694 result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc), &p80211hdr, sizeof(p80211hdr) );
696 result = hfa384x_copy_to_bap( hw, fid, sizeof(txdesc) + sizeof(p80211hdr), (UINT8*)p, s );
700 result = hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_TX), fid, 0, 0);
707 result = hfa384x_wait_for_event(hw, HFA384x_EVSTAT_TXEXC | HFA384x_EVSTAT_TX, HFA384x_EVACK_INFO,
711 fid = hfa384x_getreg(hw, HFA384x_TXCOMPLFID);
713 result = hfa384x_copy_from_bap(hw, fid, 0, &status, sizeof(status));
761 static int prism2_probe ( struct nic *nic, hfa384x_t *hw ) {
772 result = hfa384x_docmd_wait(hw, HFA384x_CMDCODE_INIT, 0,0,0); /* Send initialize command */
774 hfa384x_setreg(hw, 0, HFA384x_INTEN); /* Disable interrupts */
775 hfa384x_setreg(hw, 0xffff, HFA384x_EVACK); /* Acknowledge any spurious events */
780 hfa384x_drvr_getconfig ( hw, HFA384x_RID_CNFOWNMACADDR, nic->node_addr, HFA384x_RID_CNFOWNMACADDR_LEN );
785 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN, &tmp16);
788 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, &tmp16);
791 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAUTHENTICATION, &tmp16);
797 result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID, ssid, HFA384x_RID_CNFDESIREDSSID_LEN); /* Set the SSID */
800 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, &tmp16);
803 result = hfa384x_docmd_wait(hw, HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_ENABLE) | HFA384x_CMD_MACPORT_SET(0), 0,0,0);
824 if ( !hfa384x_wait_for_event(hw, HFA384x_EVSTAT_INFO, 0, 1000, 2000, "Info event" ) ) return 0;
826 infofid = hfa384x_getreg(hw, HFA384x_INFOFID);
828 result = hfa384x_copy_from_bap( hw, infofid, 0, &inf.framelen, sizeof(UINT16));
832 result = hfa384x_copy_from_bap( hw, infofid, sizeof(UINT16),
848 result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CURRENTBSSID, hw->bssid, WLAN_BSSID_LEN);
850 DBG ( "Link connected (BSSID %s - ", eth_ntoa ( hw->bssid ) );