ipw2100.c revision 922d2c76afbee21520ffa2088c4e60dcb80d3945
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright(c) 2004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Redistribution and use in source and binary forms, with or without
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * modification, are permitted provided that the following conditions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 1. Redistributions of source code must retain the above copyright
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * notice unmodified, this list of conditions, and the following
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * disclaimer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2. Redistributions in binary form must reproduce the above copyright
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * notice, this list of conditions and the following disclaimer in the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * documentation and/or other materials provided with the distribution.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3270659f55e0928d6edec3d26217cc29398a8149Srikanth, Ramana * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SUCH DAMAGE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * kCF framework include files
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char ipw2100_ident[] = IPW2100_DRV_DESC " " IPW2100_DRV_REV;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * PIO access attribute for register
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic ddi_device_acc_attr_t ipw2100_csr_accattr = {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic ddi_device_acc_attr_t ipw2100_dma_accattr = {
NULL,
int instance;
if (dip) {
goto fail1;
goto fail1;
goto fail2;
goto fail2;
goto fail3;
goto fail3;
goto fail4;
goto fail5;
if (err != 0) {
goto fail6;
goto fail6;
return (DDI_SUCCESS);
return (err);
int err;
return (DDI_FAILURE);
return (err);
return (DDI_SUCCESS);
return (DDI_SUCCESS);
int err, i;
case IEEE80211_M_STA:
case IEEE80211_M_HOSTAP:
case IEEE80211_M_IBSS:
case IEEE80211_M_AHDEMO:
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
return (err);
for (i = 0; i < IEEE80211_WEP_NKID; i++) {
return (err);
return (err);
return (err);
return (err);
return (err);
return (DDI_FAILURE);
return (DDI_SUCCESS);
int err;
return (DDI_FAILURE);
goto fail;
goto fail;
goto fail;
goto fail;
return (DDI_SUCCESS);
fail:
return (err);
if (val == 0)
val));
int ntries;
int ntries;
return (DDI_FAILURE);
return (DDI_SUCCESS);
* get the radio status from IPW_CSR_IO, invoked by wificonfig/dladm
* This function is used to get the statistic, invoked by wificonfig/dladm
int err;
goto fail0;
goto fail1;
goto fail2;
goto fail3;
return (DDI_SUCCESS);
return (err);
int err, i;
goto fail0;
for (i = 0; i < IPW2100_NUM_TXBUF; i++) {
goto fail1;
goto fail2;
for (i = 0; i < IPW2100_NUM_RXBUF; i++) {
goto fail3;
goto fail4;
goto fail5;
return (DDI_SUCCESS);
for (i = 0; i < IPW2100_NUM_RXBUF; i++)
for (i = 0; i < IPW2100_NUM_TXBUF; i++)
return (err);
for (i = 0; i < IPW2100_NUM_TXBUF; i++)
for (i = 0; i < IPW2100_NUM_RXBUF; i++)
for (i = 0; i < IPW2100_NUM_TXBUF; i++)
for (i = 0; i < IPW2100_NUM_RXBUF; i++) {
int err;
return (err);
return (DDI_SUCCESS);
switch (state) {
case IEEE80211_S_RUN:
case IEEE80211_S_INIT:
case IEEE80211_S_SCAN:
case IEEE80211_S_AUTH:
case IEEE80211_S_ASSOC:
return (DDI_SUCCESS);
switch (stat) {
case MAC_STAT_RBYTES:
case MAC_STAT_IPACKETS:
case MAC_STAT_OBYTES:
case MAC_STAT_OPACKETS:
case WIFI_STAT_TX_FRAGS:
case WIFI_STAT_MCAST_TX:
case WIFI_STAT_TX_FAILED:
case WIFI_STAT_TX_RETRANS:
case WIFI_STAT_RTS_SUCCESS:
case WIFI_STAT_ACK_FAILURE:
case WIFI_STAT_RX_FRAGS:
case WIFI_STAT_MCAST_RX:
case WIFI_STAT_RTS_FAILURE:
case WIFI_STAT_RX_DUPS:
case WIFI_STAT_FCS_ERRORS:
case WIFI_STAT_WEP_ERRORS:
case MAC_STAT_IFSPEED:
case MAC_STAT_NOXMTBUF:
case MAC_STAT_IERRORS:
case MAC_STAT_OERRORS:
return (ENOTSUP);
int stat_cnt = 0;
int err;
goto fail;
fail:
return (EIO);
recfg = 0;
if (on)
goto fail;
fail:
return (EIO);
static mblk_t *
return (NULL);
DDI_SUCCESS) {
return (mp);
struct ieee80211_key *k;
struct ipw2100_hdr *h;
int err;
m = NULL;
goto fail0;
goto fail1;
goto fail1;
goto fail1;
off = 0;
while (m0) {
if (cnt) {
goto fail2;
off = 0;
m0 = m;
if (cnt) {
h->encrypt = 0;
h->keyidx = 0;
h->keysz = 0;
off = 0;
while (m0) {
if (cnt) {
freemsg(m);
return (err);
#define IEEE80211_IOCTL_NOT_REQUIRED (0)
int err;
MBLKL(m)));
return (IEEE80211_IOCTL_NOT_REQUIRED);
switch (cmd) {
case WLAN_SET_PARAM:
case WLAN_COMMAND:
case WLAN_GET_PARAM:
return (IEEE80211_IOCTL_NOT_REQUIRED);
if (need_privilege) {
if (ret != 0) {
return (IEEE80211_IOCTL_NOT_REQUIRED);
return (IEEE80211_IOCTL_NOT_REQUIRED);
if (!need_net80211) {
return (IEEE80211_IOCTL_NOT_REQUIRED);
return (IEEE80211_IOCTL_REQUIRED);
switch (id) {
case WL_RADIO:
case WL_DESIRED_RATES:
case WL_DISASSOCIATE:
ret = 0;
return (ret);
switch (cmd) {
case WLAN_GET_PARAM:
case WLAN_SET_PARAM:
return (ret);
mblk_t *m;
static uint_t
#if DEBUG
return (DDI_INTR_UNCLAIMED);
ireg));
goto enable_interrupt;
i * sizeof (struct ipw2100_status),
sizeof (struct ipw2100_status),
i * sizeof (struct ipw2100_bd),
sizeof (struct ipw2100_bd),
sizeof (struct ipw2100_rxb),
#if DEBUG
state));
switch (state) {
case IPW2100_STATE_ASSOCIATED:
case IPW2100_STATE_DISABLED:
case IPW2100_STATE_SCANNING:
return (DDI_INTR_CLAIMED);
_init(void)
int status;
return (status);
return (status);
_fini(void)
int status;
return (status);