Fixed some of the error messages in mgmt_start().

This commit is contained in:
mark 2000-04-18 17:42:57 +00:00
parent 1056606ebd
commit 33185aed59

View file

@ -699,12 +699,12 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
/* Validate the command, if BSStype=infra is the tertiary loaded? */
if ( (msg->bsstype.data == P80211ENUM_bsstype_independent &&
priv->cap_sup_sta.id != 4) ||
(msg->bsstype.data == P80211ENUM_bsstype_infrastructure &&
priv->cap_sup_sta.id != 5) ) {
msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
return 0;
if ( msg->bsstype.data == P80211ENUM_bsstype_independent ) {
WLAN_LOG_ERROR0("AP driver cannot create IBSS.\n");
goto failed;
} else if ( priv->cap_sup_sta.id != 5) {
WLAN_LOG_ERROR0("AP driver failed to detect AP firmware.\n");
goto failed;
}
/* Set the REQUIRED config items */
@ -714,25 +714,17 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFOWNSSID,
bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
if ( result ) {
WLAN_LOG_DEBUG0(1, "Unable to set SSID\n");
WLAN_LOG_ERROR0("Failed to set SSID\n");
goto failed;
}
/* bsstype */
if ( msg->bsstype.data == P80211ENUM_bsstype_independent ) {
word = HFA384x_PORTTYPE_IBSS;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set port type=%d.\n", word);
goto failed;
}
}
/* bsstype - we use the default in the ap firmware */
/* beacon period */
word = msg->beaconperiod.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNINT, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set beacon period=%d.\n", word);
WLAN_LOG_ERROR1("Failed to set beacon period=%d.\n", word);
goto failed;
}
@ -740,7 +732,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
word = msg->dschannel.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set channel=%d.\n", word);
WLAN_LOG_ERROR1("Failed to set channel=%d.\n", word);
goto failed;
}
/* Basic rates */
@ -768,7 +760,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
}
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set basicrates=%d.\n", word);
WLAN_LOG_ERROR1("Failed to set basicrates=%d.\n", word);
goto failed;
}
@ -795,53 +787,30 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
if ( msg->operationalrate8.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate8.data);
}
if ( msg->bsstype.data == P80211ENUM_bsstype_infrastructure ) {
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set supprates=%d.\n", word);
goto failed;
}
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL0, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set txrates=%d.\n", word);
goto failed;
}
} else { /* assume ibss */
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set txrates=%d.\n", word);
goto failed;
}
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, &word);
if ( result ) {
WLAN_LOG_ERROR1("Failed to set supprates=%d.\n", word);
goto failed;
}
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL0, &word);
if ( result ) {
WLAN_LOG_ERROR1("Failed to set txrates=%d.\n", word);
goto failed;
}
/* ibssatimwindow */
if (msg->bsstype.data != P80211ENUM_bsstype_independent ) {
WLAN_LOG_INFO0("Setting atimwindow for non-ibss is pointless.\n");
} else {
word = msg->ibssatimwindow.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNATIMWIN, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set atimwindow=%d.\n", word);
goto failed;
}
}
/* The settings below this if statement only apply to infrastructure */
/* if we're not infrastructure, skip over them */
if (msg->bsstype.data != P80211ENUM_bsstype_infrastructure ) {
goto ibss_skip;
}
WLAN_LOG_INFO0("atimwindow not used in Infrastructure mode, ignored.\n");
/* DTIM period */
word = msg->dtimperiod.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNDTIMPER, &word);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Unable to set dtim period=%d.\n", word);
WLAN_LOG_ERROR1("Failed to set dtim period=%d.\n", word);
goto failed;
}
/* probedelay */
WLAN_LOG_INFO0("No setting for probedelay in prism2, skipped.\n");
WLAN_LOG_INFO0("prism2mgmt_start: probedelay not supported in prism2, ignored.\n");
/* cfpollable, cfpollreq, cfpperiod, cfpmaxduration */
if (msg->cfpollable.data == P80211ENUM_truth_true &&
@ -855,8 +824,10 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFAPPCFINFO,
pcfinfo, HFA384x_RID_CNFAPPCFINFO_LEN);
if ( result ) {
WLAN_LOG_DEBUG0(1, "Unable to read pcfinfo, not supported so skip it.\n");
goto ibss_skip;
WLAN_LOG_INFO0("prism2mgmt_start: read(pcfinfo) failed, "
"assume it's "
"not supported, pcf settings ignored.\n");
goto pcf_skip;
}
if ((msg->cfpollable.data == P80211ENUM_truth_false &&
msg->cfpollreq.data == P80211ENUM_truth_false) ) {
@ -892,13 +863,11 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFAPPCFINFO,
pcfinfo, HFA384x_RID_CNFAPPCFINFO_LEN);
if ( result ) {
WLAN_LOG_DEBUG0(1, "Unable to write pcfinfo, not supported so skip it.\n");
/* goto failed; */
WLAN_LOG_ERROR0("write(pcfinfo) failed.\n");
goto failed;
}
ibss_skip:
pcf_skip:
/* Enable the interrupts */
word = HFA384x_INTEN_INFDROP_SET(1) |
HFA384x_INTEN_INFO_SET(1) |
@ -922,7 +891,7 @@ ibss_skip:
/* Enable the Port */
result = hfa384x_cmd_enable(hw, 0);
if ( result ) {
WLAN_LOG_DEBUG1(1, "Enable macport failed, result=%d.\n", result);
WLAN_LOG_ERROR1("Enable macport failed, result=%d.\n", result);
goto failed;
}