Commit 89c5be50 authored by David Kilroy's avatar David Kilroy Committed by Greg Kroah-Hartman

staging: wlags49_h2: Remove CKIP support from hcf

CKIP is a Cisco proprietary alternative to TKIP. Support removed to
simplify code - the defines to interact with the firmware are left in
place.
Signed-off-by: default avatarDavid Kilroy <kilroyd@googlemail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 85d5cb15
......@@ -512,8 +512,6 @@ HCF_STATIC hcf_16* BASED xxxx[ ] = {
*.ARGUMENTS
* ifbp address of the Interface Block
* action number identifying the type of change
* - HCF_ACT_CCX_OFF disable CKIP
* - HCF_ACT_CCX_ON enable CKIP
* - HCF_ACT_INT_FORCE_ON enable interrupt generation by WaveLAN NIC
* - HCF_ACT_INT_OFF disable interrupt generation by WaveLAN NIC
* - HCF_ACT_INT_ON compensate 1 HCF_ACT_INT_OFF, enable interrupt generation if balance reached
......@@ -537,7 +535,6 @@ HCF_STATIC hcf_16* BASED xxxx[ ] = {
*
*.DESCRIPTION
* hcf_action supports the following mode changing action-code pairs that are antonyms
* - HCF_ACT_CCX_OFF / HCF_ACT_CCX_ON
* - HCF_ACT_INT_[FORCE_]ON / HCF_ACT_INT_OFF
*
* Additionally hcf_action can start the following actions in the NIC:
......@@ -573,11 +570,6 @@ HCF_STATIC hcf_16* BASED xxxx[ ] = {
*! The INT_OFF/INT_ON housekeeping is initialized at 0x0000 by hcf_connect, causing the interrupt generation
* mechanism to be disabled at first. This suits MSF implementation based on a polling strategy.
*
* o HCF_ACT_CCX_OFF / HCF_ACT_CCX_ON
*!! This can use some more explanation;?
* Disables and Enables support in the HCF runtime code for the CCX feature. Each time one of these action
* codes is used, the effects of the preceding use cease.
*
* o HCF_ACT_SLEEP: Initiates the Disconnected DeepSleep process
* This command is only available if the HCF_DDS compile time option is set. It triggers the F/W to start the
* sleep handshaking. Regardless whether the Host initiates a Disconnected DeepSleep (DDS) or the F/W initiates
......@@ -791,13 +783,6 @@ hcf_action( IFBP ifbp, hcf_16 action )
// break;
#endif // HCF_DDS
#if (HCF_TYPE) & HCF_TYPE_CCX
case HCF_ACT_CCX_ON: // enable CKIP
case HCF_ACT_CCX_OFF: // disable CKIP
ifbp->IFB_CKIPStat = action;
break;
#endif // HCF_TYPE_CCX
case HCF_ACT_RX_ACK: //Receiver ACK
/*6*/ if ( ifbp->IFB_RxFID ) {
DAWA_ACK( HREG_EV_RX );
......@@ -1501,14 +1486,10 @@ hcf_dma_rx_get (IFBP ifbp)
DESC_STRCT *descp; // pointer to start of FrameList
descp = get_frame_lst( ifbp, DMA_RX );
if ( descp && descp->buf_addr ) //!be aware of the missing curly bracket
if ( descp && descp->buf_addr ) {
//skip decapsulation at confined descriptor
#if (HCF_ENCAP) == HCF_ENC
#if (HCF_TYPE) & HCF_TYPE_CCX
if ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_OFF )
#endif // HCF_TYPE_CCX
{
int i;
DESC_STRCT *p = descp->next_desc_addr; //pointer to 2nd descriptor of frame
HCFASSERT(p, 0);
......@@ -1634,18 +1615,16 @@ hcf_dma_tx_get( IFBP ifbp )
DESC_STRCT *descp; // pointer to start of FrameList
descp = get_frame_lst( ifbp, DMA_TX );
if ( descp && descp->buf_addr ) //!be aware of the missing curly bracket
if ( descp && descp->buf_addr ) {
//skip decapsulation at confined descriptor
#if (HCF_ENCAP) == HCF_ENC
if ( ( descp->BUF_CNT == HFS_TYPE )
#if (HCF_TYPE) & HCF_TYPE_CCX
|| ( descp->BUF_CNT == HFS_DAT )
#endif // HCF_TYPE_CCX
) { // perform decapsulation if needed
if ( ( descp->BUF_CNT == HFS_TYPE )) {
// perform decapsulation if needed
descp->next_desc_addr->buf_phys_addr -= HCF_DASA_SIZE;
descp->next_desc_addr->BUF_CNT += HCF_DASA_SIZE;
}
#endif // HCF_ENC
}
if ( descp == NULL ) { //;?could be integrated into get_frame_lst
ifbp->IFB_DmaPackets &= (hcf_16)~HREG_EV_TDMAD;
}
......@@ -1792,34 +1771,6 @@ hcf_dma_tx_put( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
HCFASSERT( descp->BUF_SIZE >= HCF_DMA_TX_BUF1_SIZE, descp->BUF_SIZE ); //minimal storage for encapsulation
HCFASSERT( p->BUF_CNT >= 14, p->BUF_CNT ); //at least DA, SA and 'type' in 2nd buffer
#if (HCF_TYPE) & HCF_TYPE_CCX
/* if we are doing PPK +/- CMIC, or we are sending a DDP frame */
if ( ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_ON ) ||
( ( p->BUF_CNT >= 20 ) && ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_OFF ) &&
( p->buf_addr[12] == 0xAA ) && ( p->buf_addr[13] == 0xAA ) &&
( p->buf_addr[14] == 0x03 ) && ( p->buf_addr[15] == 0x00 ) &&
( p->buf_addr[16] == 0x40 ) && ( p->buf_addr[17] == 0x96 ) &&
( p->buf_addr[18] == 0x00 ) && ( p->buf_addr[19] == 0x00 )))
{
/* copy the DA/SA to the first buffer */
for ( i = 0; i < HCF_DASA_SIZE; i++ ) {
descp->buf_addr[i + HFS_ADDR_DEST] = p->buf_addr[i];
}
/* calculate the length of the second fragment only */
i = 0;
do { i += p->BUF_CNT; } while( p = p->next_desc_addr );
i -= HCF_DASA_SIZE ;
/* convert the length field to big endian, using the endian friendly macros */
i = CNV_SHORT_TO_BIG(i); //!! this converts ONLY on LE platforms, how does that relate to the non-CCX code
*(hcf_16*)(&descp->buf_addr[HFS_LEN]) = (hcf_16)i;
descp->BUF_CNT = HFS_DAT;
// modify 2nd descriptor to skip the 'Da/Sa' fields
descp->next_desc_addr->buf_phys_addr += HCF_DASA_SIZE;
descp->next_desc_addr->BUF_CNT -= HCF_DASA_SIZE;
}
else
#endif // HCF_TYPE_CCX
{
descp->buf_addr[HFS_TYPE-1] = hcf_encap(&descp->next_desc_addr->buf_addr[HCF_DASA_SIZE]); /*4*/
if ( descp->buf_addr[HFS_TYPE-1] != ENC_NONE ) {
for ( i=0; i < HCF_DASA_SIZE; i++ ) { /*6*/
......@@ -1835,7 +1786,6 @@ hcf_dma_tx_put( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
descp->next_desc_addr->buf_phys_addr += HCF_DASA_SIZE;
descp->next_desc_addr->BUF_CNT -= HCF_DASA_SIZE;
}
}
#endif // HCF_ENC
}
put_frame_lst( ifbp, descp, DMA_TX );
......@@ -2708,35 +2658,17 @@ hcf_send_msg( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
#endif // HCF_TYPE_TX_DELAY
OPW( HREG_DATA_1, tx_cntl ) ;
OPW( HREG_DATA_1, 0 );
#if ! ( (HCF_TYPE) & HCF_TYPE_CCX )
HCFASSERT( p->BUF_CNT >= 14, p->BUF_CNT );
/* assume DestAddr/SrcAddr/Len/Type ALWAYS contained in 1st fragment
* otherwise life gets too cumbersome for MIC and Encapsulation !!!!!!!!
if ( p->BUF_CNT >= 14 ) { alternatively: add a safety escape !!!!!!!!!!!! } */
#endif // HCF_TYPE_CCX
CALC_TX_MIC( NULL, -1 ); //initialize MIC
/*10*/ put_frag( ifbp, p->buf_addr, HCF_DASA_SIZE BE_PAR(0) ); //write DA, SA with MIC calculation
CALC_TX_MIC( p->buf_addr, HCF_DASA_SIZE ); //MIC over DA, SA
CALC_TX_MIC( null_addr, 4 ); //MIC over (virtual) priority field
#if (HCF_TYPE) & HCF_TYPE_CCX
//!!be careful do not use positive test on HCF_ACT_CCX_OFF, because IFB_CKIPStat is initially 0
if(( ifbp->IFB_CKIPStat == HCF_ACT_CCX_ON ) ||
((GET_BUF_CNT(p) >= 20 ) && ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_OFF ) &&
(p->buf_addr[12] == 0xAA) && (p->buf_addr[13] == 0xAA) &&
(p->buf_addr[14] == 0x03) && (p->buf_addr[15] == 0x00) &&
(p->buf_addr[16] == 0x40) && (p->buf_addr[17] == 0x96) &&
(p->buf_addr[18] == 0x00) && (p->buf_addr[19] == 0x00)))
{
i = HCF_DASA_SIZE;
OPW( HREG_DATA_1, CNV_SHORT_TO_BIG( len - i ));
/* need to send out the remainder of the fragment */
put_frag( ifbp, &p->buf_addr[i], GET_BUF_CNT(p) - i BE_PAR(0) );
}
else
#endif // HCF_TYPE_CCX
{
//if encapsulation needed
#if (HCF_ENCAP) == HCF_ENC
//write length (with SNAP-header,Type, without //DA,SA,Length ) no MIC calc.
......@@ -2755,7 +2687,7 @@ hcf_send_msg( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
//complete 1st fragment starting with Type with MIC calculation
put_frag( ifbp, &p->buf_addr[i], p->BUF_CNT - i BE_PAR(0) );
CALC_TX_MIC( &p->buf_addr[i], p->BUF_CNT - i );
}
//do the remaining fragments with MIC calculation
while ( ( p = p->next_desc_addr ) != NULL ) {
/* obnoxious c:/hcf/hcf.c(1480) : warning C4769: conversion of near pointer to long integer,
......@@ -3116,11 +3048,6 @@ hcf_service_nic( IFBP ifbp, wci_bufp bufp, unsigned int len )
CALC_RX_MIC( null_addr, 4 ); //. MIC over (virtual) priority field
CALC_RX_MIC( buf_addr+14, 8 ); //. skip Len, MIC over SNAP,Type or 8 data bytes)
buf_addr += 22;
#if (HCF_TYPE) & HCF_TYPE_CCX
//!!be careful do not use positive test on HCF_ACT_CCX_OFF, because IFB_CKIPStat is initially 0
if( ifbp->IFB_CKIPStat != HCF_ACT_CCX_ON )
#endif // HCF_TYPE_CCX
{
#if (HCF_ENCAP) == HCF_ENC
HCFASSERT( len >= HFS_DAT + 2 + sizeof(snap_header), len );
/*34*/ i = *(wci_recordp)&bufp[HFS_STAT] & ( HFS_STAT_MSG_TYPE | HFS_STAT_ERR );
......@@ -3135,7 +3062,6 @@ hcf_service_nic( IFBP ifbp, wci_bufp bufp, unsigned int len )
}
#endif // HCF_ENC
}
}
/*40*/ ifbp->IFB_lal = min( (hcf_16)(len - HFS_ADDR_DEST), ifbp->IFB_RxLen );
i = ifbp->IFB_lal - ( buf_addr - ( bufp + HFS_ADDR_DEST ) );
get_frag( ifbp, buf_addr, i BE_PAR(0) );
......
......@@ -336,9 +336,6 @@ typedef struct {
#endif // HCF_ASSERT_PRINTF
#endif // HCF_ASSERT
hcf_16 volatile IFB_IntOffCnt; // 0xFFFF based HCF_ACT_INT_OFF nesting counter, DeepSleep flag
#if (HCF_TYPE) & HCF_TYPE_CCX
hcf_16 IFB_CKIPStat; // CKIP Status flag
#endif // HCF_TYPE_CCX
#if (HCF_TALLIES) & ( HCF_TALLIES_NIC | HCF_TALLIES_HCF ) //Hermes and/or HCF tally support
hcf_32 IFB_Silly_you_should_align; //;?
hcf_16 IFB_TallyLen; // Tally length (to build an LTV)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment