Commit f980c178 authored by Solomon Peachy's avatar Solomon Peachy Committed by Greg Kroah-Hartman

Staging: wlan-ng: Eliminate a boatload of tertiaryAP-only code.

Signed-off-by: default avatarSolomon Peachy <pizza@shaftnet.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8a1396ef
This diff is collapsed.
......@@ -609,30 +609,6 @@ typedef struct p80211msg_p2req_dump_state
p80211item_uint32_t resultcode ;
} __WLAN_ATTRIB_PACK__ p80211msg_p2req_dump_state_t;
typedef struct p80211msg_p2req_channel_info
{
UINT32 msgcode ;
UINT32 msglen ;
UINT8 devname[WLAN_DEVNAMELEN_MAX] ;
p80211item_uint32_t channellist ;
p80211item_uint32_t channeldwelltime ;
p80211item_uint32_t resultcode ;
p80211item_uint32_t numchinfo ;
} __WLAN_ATTRIB_PACK__ p80211msg_p2req_channel_info_t;
typedef struct p80211msg_p2req_channel_info_results
{
UINT32 msgcode ;
UINT32 msglen ;
UINT8 devname[WLAN_DEVNAMELEN_MAX] ;
p80211item_uint32_t channel ;
p80211item_uint32_t resultcode ;
p80211item_uint32_t avgnoiselevel ;
p80211item_uint32_t peaknoiselevel ;
p80211item_uint32_t bssactive ;
p80211item_uint32_t pcfactive ;
} __WLAN_ATTRIB_PACK__ p80211msg_p2req_channel_info_results_t;
typedef struct p80211msg_p2req_enable
{
UINT32 msgcode ;
......
......@@ -2305,175 +2305,6 @@ int prism2mgmt_dump_state(wlandevice_t *wlandev, void *msgp)
return result;
}
/*----------------------------------------------------------------
* prism2mgmt_channel_info
*
* Issues a ChannelInfoRequest.
*
* Arguments:
* wlandev wlan device structure
* msgp ptr to msg buffer
*
* Returns:
* 0 success and done
* <0 success, but we're waiting for something to finish.
* >0 an error occurred while handling the message.
* Side effects:
*
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_channel_info(wlandevice_t *wlandev, void *msgp)
{
p80211msg_p2req_channel_info_t *msg=msgp;
hfa384x_t *hw = wlandev->priv;
int result, i, n=0;
UINT16 channel_mask=0;
hfa384x_ChannelInfoRequest_data_t chinforeq;
// unsigned long now;
DBFENTER;
if (!hw->ap) {
/*** STATION ***/
/* Not supported in STA f/w */
P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_not_supported);
goto done;
}
/*** ACCESS POINT ***/
#define CHINFO_TIMEOUT 2
P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_success);
/* setting default value for channellist = all channels */
if (!msg->channellist.data) {
P80211_SET_INT(msg->channellist, 0x00007FFE);
}
/* setting default value for channeldwelltime = 100 ms */
if (!msg->channeldwelltime.data) {
P80211_SET_INT(msg->channeldwelltime, 100);
}
channel_mask = (UINT16) (msg->channellist.data >> 1);
for (i=0, n=0; i < 14; i++) {
if (channel_mask & (1<<i)) {
n++;
}
}
P80211_SET_INT(msg->numchinfo, n);
chinforeq.channelList = host2hfa384x_16(channel_mask);
chinforeq.channelDwellTime = host2hfa384x_16(msg->channeldwelltime.data);
atomic_set(&hw->channel_info.done, 1);
result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CHANNELINFOREQUEST,
&chinforeq, HFA384x_RID_CHANNELINFOREQUEST_LEN);
if ( result ) {
WLAN_LOG_ERROR("setconfig(CHANNELINFOREQUEST) failed. result=%d\n",
result);
msg->resultcode.data = P80211ENUM_resultcode_not_supported;
goto done;
}
/*
now = jiffies;
while (atomic_read(&hw->channel_info.done) != 1) {
if ((jiffies - now) > CHINFO_TIMEOUT*HZ) {
WLAN_LOG_NOTICE("ChannelInfo results not received in %d seconds, aborting.\n",
CHINFO_TIMEOUT);
msg->resultcode.data = P80211ENUM_resultcode_timeout;
goto done;
}
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(HZ/4);
current->state = TASK_RUNNING;
}
*/
done:
DBFEXIT;
return 0;
}
/*----------------------------------------------------------------
* prism2mgmt_channel_info_results
*
* Returns required ChannelInfo result.
*
* Arguments:
* wlandev wlan device structure
* msgp ptr to msg buffer
*
* Returns:
* 0 success and done
* <0 success, but we're waiting for something to finish.
* >0 an error occurred while handling the message.
* Side effects:
*
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_channel_info_results(wlandevice_t *wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_channel_info_results_t *msg=msgp;
int result=0;
int channel;
DBFENTER;
if (!hw->ap) {
/*** STATION ***/
/* Not supported in STA f/w */
P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_not_supported);
goto done;
}
/*** ACCESS POINT ***/
switch (atomic_read(&hw->channel_info.done)) {
case 0: msg->resultcode.status = P80211ENUM_msgitem_status_no_value;
goto done;
case 1: msg->resultcode.status = P80211ENUM_msgitem_status_incomplete_itemdata;
goto done;
}
P80211_SET_INT(msg->resultcode, P80211ENUM_resultcode_success);
channel=msg->channel.data-1;
if (channel < 0 || ! (hw->channel_info.results.scanchannels & 1<<channel) ) {
msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
goto done;
}
WLAN_LOG_DEBUG(2, "chinfo_results: channel %d, avg/peak level=%d/%d dB, active=%d\n",
channel+1,
hw->channel_info.results.result[channel].anl,
hw->channel_info.results.result[channel].pnl,
hw->channel_info.results.result[channel].active
);
P80211_SET_INT(msg->avgnoiselevel, hw->channel_info.results.result[channel].anl);
P80211_SET_INT(msg->peaknoiselevel, hw->channel_info.results.result[channel].pnl);
P80211_SET_INT(msg->bssactive, hw->channel_info.results.result[channel].active &
HFA384x_CHINFORESULT_BSSACTIVE
? P80211ENUM_truth_true
: P80211ENUM_truth_false) ;
P80211_SET_INT(msg->pcfactive, hw->channel_info.results.result[channel].active &
HFA384x_CHINFORESULT_PCFACTIVE
? P80211ENUM_truth_true
: P80211ENUM_truth_false) ;
done:
DBFEXIT;
return result;
}
/*----------------------------------------------------------------
* prism2mgmt_autojoin
*
......
......@@ -129,8 +129,6 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_mm_state(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_dump_state(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_enable(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_channel_info(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_channel_info_results(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp);
/*---------------------------------------------------------------
......
This diff is collapsed.
......@@ -497,14 +497,6 @@ static int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
WLAN_LOG_DEBUG(2,"Received mlme dump_state request\n");
result = prism2mgmt_dump_state(wlandev, msg);
break;
case DIDmsg_p2req_channel_info :
WLAN_LOG_DEBUG(2,"Received mlme channel_info request\n");
result = prism2mgmt_channel_info(wlandev, msg);
break;
case DIDmsg_p2req_channel_info_results :
WLAN_LOG_DEBUG(2,"Received mlme channel_info_results request\n");
result = prism2mgmt_channel_info_results(wlandev, msg);
break;
/*
* Linux specific messages
*/
......
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