/******************************************************************************* * wl_process_updated_record() ******************************************************************************* * * DESCRIPTION: * * Process the updated information record message signaled by the device. * * PARAMETERS: * * lp - a pointer to the device's private structure * * RETURNS: * * N/A * ******************************************************************************/ void wl_process_updated_record( struct wl_private *lp ) { DBG_FUNC( "wl_process_updated_record" ); DBG_ENTER( DbgInfo ); if( lp != NULL ) { lp->updatedRecord.u.u16[0] = CNV_LITTLE_TO_INT( lp->updatedRecord.u.u16[0] ); switch( lp->updatedRecord.u.u16[0] ) { case CFG_CUR_COUNTRY_INFO: DBG_TRACE( DbgInfo, "Updated Record: CFG_CUR_COUNTRY_INFO\n" ); wl_connect( lp ); break; case CFG_PORT_STAT: DBG_TRACE( DbgInfo, "Updated Record: WAIT_FOR_CONNECT (0xFD40)\n" ); //wl_connect( lp ); break; default: DBG_TRACE( DbgInfo, "UNKNOWN: 0x%04x\n", lp->updatedRecord.u.u16[0] ); } } DBG_LEAVE( DbgInfo ); return; } // wl_process_updated_record
/******************************************************************************* * wl_has_wep() ******************************************************************************* * * DESCRIPTION: * * Checks to see if the device supports WEP * * PARAMETERS: * * ifbp - the IFB pointer of the device in question * * RETURNS: * * 1 if WEP is known enabled, else 0 * ******************************************************************************/ int wl_has_wep (IFBP ifbp) { CFG_PRIVACY_OPT_IMPLEMENTED_STRCT ltv; int rc, privacy; /*------------------------------------------------------------------------*/ /* This function allows us to distiguish bronze cards from other types, to know if WEP exists. Does not distinguish (because there's no way to) between silver and gold cards. */ ltv.len = 2; ltv.typ = CFG_PRIVACY_OPT_IMPLEMENTED; rc = hcf_get_info( ifbp, (LTVP) <v ); privacy = CNV_LITTLE_TO_INT( ltv.privacy_opt_implemented ); //return rc ? 0 : privacy; return 1; } // wl_has_wep
/******************************************************************************* * wl_endian_translate_event() ******************************************************************************* * * DESCRIPTION: * * Determines what type of data is in the mailbox and performs the proper * endian translation. * * PARAMETERS: * * pLtv - an LTV pointer * * RETURNS: * * N/A * ******************************************************************************/ void wl_endian_translate_event( ltv_t *pLtv ) { DBG_FUNC( "wl_endian_translate_event" ); DBG_ENTER( DbgInfo ); switch( pLtv->typ ) { case CFG_TALLIES: break; case CFG_SCAN: { int numAPs; SCAN_RS_STRCT *pAps = (SCAN_RS_STRCT*)&pLtv->u.u8[0]; numAPs = (hcf_16)(( (size_t)( pLtv->len - 1 ) * 2 ) / (sizeof( SCAN_RS_STRCT ))); while( numAPs >= 1 ) { numAPs--; pAps[numAPs].channel_id = CNV_LITTLE_TO_INT( pAps[numAPs].channel_id ); pAps[numAPs].noise_level = CNV_LITTLE_TO_INT( pAps[numAPs].noise_level ); pAps[numAPs].signal_level = CNV_LITTLE_TO_INT( pAps[numAPs].signal_level ); pAps[numAPs].beacon_interval_time = CNV_LITTLE_TO_INT( pAps[numAPs].beacon_interval_time ); pAps[numAPs].capability = CNV_LITTLE_TO_INT( pAps[numAPs].capability ); pAps[numAPs].ssid_len = CNV_LITTLE_TO_INT( pAps[numAPs].ssid_len ); pAps[numAPs].ssid_val[pAps[numAPs].ssid_len] = 0; } } break; case CFG_ACS_SCAN: { PROBE_RESP *probe_resp = (PROBE_RESP *)pLtv; probe_resp->frameControl = CNV_LITTLE_TO_INT( probe_resp->frameControl ); probe_resp->durID = CNV_LITTLE_TO_INT( probe_resp->durID ); probe_resp->sequence = CNV_LITTLE_TO_INT( probe_resp->sequence ); probe_resp->dataLength = CNV_LITTLE_TO_INT( probe_resp->dataLength ); #ifndef WARP probe_resp->lenType = CNV_LITTLE_TO_INT( probe_resp->lenType ); #endif // WARP probe_resp->beaconInterval = CNV_LITTLE_TO_INT( probe_resp->beaconInterval ); probe_resp->capability = CNV_LITTLE_TO_INT( probe_resp->capability ); probe_resp->flags = CNV_LITTLE_TO_INT( probe_resp->flags ); } break; case CFG_LINK_STAT: #define ls ((LINK_STATUS_STRCT *)pLtv) ls->linkStatus = CNV_LITTLE_TO_INT( ls->linkStatus ); break; #undef ls case CFG_ASSOC_STAT: { ASSOC_STATUS_STRCT *pAs = (ASSOC_STATUS_STRCT *)pLtv; pAs->assocStatus = CNV_LITTLE_TO_INT( pAs->assocStatus ); } break; case CFG_SECURITY_STAT: { SECURITY_STATUS_STRCT *pSs = (SECURITY_STATUS_STRCT *)pLtv; pSs->securityStatus = CNV_LITTLE_TO_INT( pSs->securityStatus ); pSs->reason = CNV_LITTLE_TO_INT( pSs->reason ); } break; case CFG_WMP: break; case CFG_NULL: break; default: break; } DBG_LEAVE( DbgInfo ); return; } // wl_endian_translate_event
int hcfio_string( IFBP ifbp, int bap, int fid, int offset, wci_bufp pc_addr, int word_len, int tot_len, int type ) { hcf_io reg = ifbp->IFB_IOBase + bap - HREG_DATA_0 + HREG_OFFSET_0; //reg = offset register hcf_32 prot_cnt = ifbp->IFB_TickIni; hcf_16 *p1 = bap == BAP_0 ? ifbp->IFB_BAP_0 : ifbp->IFB_BAP_1; wci_bufp cp; wci_recordp wp = (wci_recordp)pc_addr; int rc; int tlen; #if HCF_ALIGN != 0 #endif // HCF_ALIGN /* assumption, writing words takes place only initial, never at odd NIC RAM addresses nor odd PC * addresses */ if ( ( rc = ifbp->IFB_TimStat ) == HCF_SUCCESS ) { /* 1 */ if ( IN_PORT_WORD( ifbp->IFB_IOBase + HREG_SW_0 ) != HCF_MAGIC ) rc = HCF_ERR_NO_NIC; /* 2 */ } if ( rc == HCF_SUCCESS ) { /* make sure all preceeding BAP manipulation is settled */ while ( prot_cnt && IN_PORT_WORD( reg ) & (HCMD_BUSY|HREG_OFFSET_ERR) ) prot_cnt--; if ( offset != (int)*p1 || fid != (int)*(p1+1) ) { /* 3 */ OUT_PORT_WORD( reg - HREG_OFFSET_0 + HREG_SELECT_0, fid ); OUT_PORT_WORD( reg, offset & 0xFFFE ); *p1 = (hcf_16)offset; *(p1+1) = (hcf_16)fid; /* use type == IO_IN and len == 0 as a way to set the BAP for the futute, e.g. at the end of hcf_send */ // while ( prot_cnt-- && IN_PORT_WORD( reg ) & (HCMD_BUSY|HREG_OFFSET_ERR) ) /*NOP*/; while ( tot_len && prot_cnt && IN_PORT_WORD( reg ) & (HCMD_BUSY|HREG_OFFSET_ERR) ) prot_cnt--; if ( prot_cnt == 0 ) { /* ;? It could be discussed whether the HREG_OFFSET_ERR bit should result in blocking NIC access * till next initialize */ rc = ifbp->IFB_TimStat = HCF_ERR_TIME_OUT; } } *p1 += (hcf_16)tot_len; /* 4 */ } reg += HREG_DATA_0 - HREG_OFFSET_0; // reg = data register if ( rc == HCF_SUCCESS && type == IO_IN ) { //input if ( tot_len ) { if ( offset & 0x01 ) { /*odd */ /* 10*/ *pc_addr++ = IN_PORT_BYTE( reg+1 ); tot_len--; } cp = pc_addr; tlen = DIV_BY_2( tot_len ); IN_PORT_STRING( reg, cp, tlen ); if ( tot_len & 1 ) *(pc_addr + tot_len - 1) = IN_PORT_BYTE( reg ); /* 11*/ while ( word_len-- ) { CNV_LITTLE_TO_INT_NP( wp ); /* 12*/ wp++; } } } if ( rc == HCF_SUCCESS && type != IO_IN ) { //output and/or check tlen = word_len; /* 20*/ while ( tlen-- ) { /* 20*/ OUT_PORT_WORD( reg, *(wci_recordp)pc_addr ); pc_addr += 2; } // tlen = offset + tot_len; if ( tot_len && offset & 0x01 ) { /* 21*/ OUT_PORT_WORD( reg, CNV_LITTLE_TO_INT( (*pc_addr <<8) + IN_PORT_BYTE( reg ) ) ); pc_addr++; tot_len--; } word_len = DIV_BY_2( tot_len ) - word_len; //misuse no longer needed parameter as temporary variable cp = pc_addr; OUT_PORT_STRING( reg, cp, word_len ); if ( tot_len & 1 ) OUT_PORT_BYTE( reg, *(pc_addr + tot_len - 1) ); /* 22*/ if ( type == IO_OUT_CHECK /*&& *p1 != ifbp->IFB_FSBase */) { //;?<HCF _L> should BE HARD CODED /* 30*/ if ( *p1 & 0X01 ) (void)IN_PORT_WORD( reg ); //align on word boundary OUT_PORT_WORD( reg, 0xCAFE ); OUT_PORT_WORD( reg, 0xABBA ); OUT_PORT_WORD( reg, 0xDEAD ); OUT_PORT_WORD( reg, 0xD00F ); //!! OUT_PORT_WORD( bap - HREG_OFFSET_0 + HREG_SELECT_0, fid ); /* 31*/ OUT_PORT_WORD( reg - HREG_DATA_0 + HREG_OFFSET_0, (*p1 + 1)&0xFFFE ); prot_cnt = ifbp->IFB_TickIni; while ( prot_cnt && IN_PORT_WORD(reg - HREG_DATA_0 + HREG_OFFSET_0) & (HCMD_BUSY|HREG_OFFSET_ERR) ) prot_cnt--; if ( prot_cnt == 0 ) { rc = ifbp->IFB_TimStat = HCF_ERR_TIME_OUT; } if ( IN_PORT_WORD( reg ) != 0xCAFE ) { rc = HCF_FAILURE; ifbp->IFB_PIFRscInd = 1; //! } else { //! rc = HCF_SUCCESS; } } } if ( rc == HCF_SUCCESS ) { /* 40*/ if ( IN_PORT_WORD( ifbp->IFB_IOBase + HREG_SW_0 ) != HCF_MAGIC ) rc = HCF_ERR_NO_NIC; } //! ASSERT( bap_ini( ifbp, bap, fid, (offset + len) & 0xFFFE) == HCF_SUCCESS ) /*99 */ return rc; }/* hcfio_string */