Added the adhoc patch referred to in the list archives at:

http://macdaddy.lists.linux-wlan.com/pipermail/linux-wlan-user/2001-August/002236.html
This commit is contained in:
mark 2001-08-31 23:12:50 +00:00
parent 5d26ebba05
commit e12631a561
4 changed files with 199 additions and 1 deletions

View File

@ -210,6 +210,47 @@ case "$ACTION" in
fi
WLAN_SCHEMESSID="$APSSID"
else
#
if is_true $IS_ADHOC ; then
#=======IBSS STARTUP==================================
startcmd="$WLANCTL $DEVICE dot11req_start "
startcmd="$startcmd ssid=$SSID"
startcmd="$startcmd bsstype=independent"
startcmd="$startcmd beaconperiod=$BCNINT"
startcmd="$startcmd dtimperiod=3"
startcmd="$startcmd cfpollable=false"
startcmd="$startcmd cfpollreq=false"
startcmd="$startcmd cfpperiod=3"
startcmd="$startcmd cfpmaxduration=100"
startcmd="$startcmd probedelay=100"
startcmd="$startcmd dschannel=$CHANNEL"
j=1
for i in $BASICRATES ; do
startcmd="$startcmd basicrate$j=$i"
j=$[j + 1]
done
j=1
for i in $OPRATES ; do
startcmd="$startcmd operationalrate$j=$i"
j=$[j + 1]
done
results=`$startcmd` # Here's where it runs
if [ $? = 0 ]; then
eval $results
if [ $resultcode != "success" ] ; then
echo "IBSS not started, resultcode=$resultcode"
exit 1
else
echo "IBSS mode started."
fi
else
echo FAILED: $startcmd
exit 1
fi
WLAN_SCHEMESSID="$SSID"
else #----------------------------
#=======STA STARTUP==================================
results=`$WLANCTL $DEVICE lnxreq_autojoin \
"ssid=$DesiredSSID" authtype=${AuthType:="opensystem"}`
@ -236,6 +277,7 @@ case "$ACTION" in
# Restore scheme file to it's prior contents
wlan_restore_schemefile
fi # david
fi
# ==========AP Interface====================================

View File

@ -41,6 +41,10 @@ card "SMC 2632W 11Mbps 802.11b WLAN Card"
card "BroMax Freeport 11Mbps 802.11b WLAN Card"
version "Intersil", "PRISM 2_5 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA"
bind "prism2_cs"
card "Intersil PRISM2 Reference Design 11Mb/s WLAN Card"
manfid 0x0156, 0x0002
bind "prism2_cs"

View File

@ -108,6 +108,15 @@ wlannoenable,*,*,*)
WLAN_DOWNLOADER=/sbin/prism2dl
WLAN_DLIMAGE=/etc/pcmcia/t10002c5.hex
#=======ADHOC START====================================
IS_ADHOC=y # y|n, y - adhoc, n - infrastructure
SSID="linux-wlan"
BCNINT=100 # Beacon interval (in Kus)
CHANNEL=6 # DS channel for BSS (1-14, depends
# on regulatory domain)
BASICRATES="2 4" # Rates for mgmt&ctl frames (in 500Kb/s)
OPRATES="2 4 11 22" # Supported rates in BSS (in 500Kb/s)
#=======AP START======================================
# If IS_AP is 'y', then the following settings will be
# used in the creation of a BSS with this station acting

View File

@ -781,13 +781,156 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
DBFENTER;
if (!priv->ap) {
// added for adhoc mode ---------------------
/* see if current f/w is less than 8c3 */
if ( (priv->ident_sta_fw.major == 0 &&
priv->ident_sta_fw.minor < 8) || // < 0.8
(priv->ident_sta_fw.major == 0 &&
priv->ident_sta_fw.minor == 8 &&
priv->ident_sta_fw.variant < 3) ) { // < 0.83
/* Ad-Hoc not quite supported on Prism2 */
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
msg->resultcode.data = P80211ENUM_resultcode_not_supported;
goto done;
}
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
/*** STATION ***/
/* Set the REQUIRED config items */
/* SSID */
pstr = (p80211pstrd_t*)&(msg->ssid.data);
prism2mgmt_pstr2bytestr(p2bytestr, pstr);
result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFOWNSSID,
bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
if ( result ) {
WLAN_LOG_ERROR0("Failed to set SSID\n");
goto failed;
}
/* bsstype - we use the default in the ap firmware */
word = 0; /* IBSS port */
hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, &word);
/* beacon period */
word = msg->beaconperiod.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNINT, &word);
if ( result ) {
WLAN_LOG_ERROR1("Failed to set beacon period=%d.\n", word);
goto failed;
}
/* dschannel */
word = msg->dschannel.data;
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, &word);
if ( result ) {
WLAN_LOG_ERROR1("Failed to set channel=%d.\n", word);
goto failed;
}
/* Basic rates */
word = p80211rate_to_p2bit(msg->basicrate1.data);
if ( msg->basicrate2.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->basicrate2.data);
}
if ( msg->basicrate3.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->basicrate3.data);
}
if ( msg->basicrate4.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->basicrate4.data);
}
if ( msg->basicrate5.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->basicrate5.data);
}
if ( msg->basicrate6.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->basicrate6.data);
}
if ( msg->basicrate7.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->basicrate7.data);
}
if ( msg->basicrate8.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->basicrate8.data);
}
result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, &word);
if ( result ) {
WLAN_LOG_ERROR1("Failed to set basicrates=%d.\n", word);
goto failed;
}
/* Operational rates (supprates and txratecontrol) */
word = p80211rate_to_p2bit(msg->operationalrate1.data);
if ( msg->operationalrate2.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate2.data);
}
if ( msg->operationalrate3.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate3.data);
}
if ( msg->operationalrate4.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate4.data);
}
if ( msg->operationalrate5.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate5.data);
}
if ( msg->operationalrate6.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate6.data);
}
if ( msg->operationalrate7.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate7.data);
}
if ( msg->operationalrate8.status == P80211ENUM_msgitem_status_data_ok ) {
word |= p80211rate_to_p2bit(msg->operationalrate8.data);
}
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_TXRATECNTL, &word);
if ( result ) {
WLAN_LOG_ERROR1("Failed to set txrates=%d.\n", word);
goto failed;
}
/* Enable the interrupts */
word = HFA384x_INTEN_INFDROP_SET(1) |
HFA384x_INTEN_INFO_SET(1) |
HFA384x_INTEN_ALLOC_SET(1) |
HFA384x_INTEN_TXEXC_SET(1) |
HFA384x_INTEN_DTIM_SET(1) |
HFA384x_INTEN_TX_SET(1) |
HFA384x_INTEN_RX_SET(1);
wlan_outw_cpu_to_le16(0xffff, (priv->hw->iobase + HFA384x_EVSTAT_OFF));
wlan_outw_cpu_to_le16(word, (hw->iobase + HFA384x_INTEN_OFF));
/* Set the macmode so the frame setup code knows what to do */
if ( msg->bsstype.data == P80211ENUM_bsstype_independent ) {
wlandev->macmode = WLAN_MACMODE_IBSS_STA;
word=2304; /* lets extend the data length a bit */
hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFMAXDATALEN, &word);
}
/* Enable the Port */
result = hfa384x_cmd_enable(hw, 0);
if ( result ) {
WLAN_LOG_ERROR1("Enable macport failed, result=%d.\n", result);
goto failed;
}
msg->resultcode.data = P80211ENUM_resultcode_success;
priv->state = WLAN_STATE_STARTED;
if (priv->log)
printk(KERN_INFO "wlan-sta: IBSS started.\n");
goto done;
// added for adhoc mode ---------------------
#if 0
/* Ad-Hoc not quite supported on Prism2 */
msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
msg->resultcode.data = P80211ENUM_resultcode_not_supported;
goto done;
#endif
}
/*** ACCESS POINT ***/