static struct net_device_stats *orinoco_get_stats(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
-
+
return &priv->stats;
}
dev->name);
return NETDEV_TX_BUSY;
}
-
+
if (netif_queue_stopped(dev)) {
- printk(KERN_DEBUG "%s: Tx while transmitter busy!\n",
+ printk(KERN_DEBUG "%s: Tx while transmitter busy!\n",
dev->name);
return NETDEV_TX_BUSY;
}
-
+
if (orinoco_lock(priv, &flags) != 0) {
printk(KERN_ERR "%s: orinoco_xmit() called while hw_unavailable\n",
dev->name);
if (! netif_carrier_ok(dev) || (priv->iw_mode == IW_MODE_MONITOR)) {
/* Oops, the firmware hasn't established a connection,
- silently drop the packet (this seems to be the
- safest approach). */
+ silently drop the packet (this seems to be the
+ safest approach). */
goto drop;
}
dev->name, fid, err);
return;
}
-
+
DEBUG(1, "%s: Tx error, err %d (FID=%04X)\n", dev->name,
err, fid);
-
+
/* We produce a TXDROP event only for retry or lifetime
* exceeded, because that's the only status that really mean
* that this particular node went away.
skb->ip_summed = CHECKSUM_NONE;
skb->pkt_type = PACKET_OTHERHOST;
skb->protocol = cpu_to_be16(ETH_P_802_2);
-
+
stats->rx_packets++;
stats->rx_bytes += skb->len;
/* Sanity checks */
if (length < 3) { /* No for even an 802.2 LLC header */
/* At least on Symbol firmware with PCF we get quite a
- lot of these legitimately - Poll frames with no
- data. */
+ lot of these legitimately - Poll frames with no
+ data. */
goto out;
}
if (length > IEEE80211_MAX_DATA_LEN) {
header, plus 2 bytes so we can align the IP header on a
32bit boundary, plus 1 byte so we can read in odd length
packets from the card, which has an IO granularity of 16
- bits */
+ bits */
skb = dev_alloc_skb(length+ETH_HLEN+2+1);
if (!skb) {
printk(KERN_WARNING "%s: Can't allocate skb for Rx\n",
skb->ip_summed = CHECKSUM_NONE;
if (fc & IEEE80211_FCTL_TODS)
skb->pkt_type = PACKET_OTHERHOST;
-
+
/* Process the wireless stats if needed */
orinoco_stat_gather(dev, skb, desc);
default:
s = "UNKNOWN";
}
-
+
printk(KERN_DEBUG "%s: New link status: %s (%04x)\n",
dev->name, s, status);
}
"Frame dropped.\n", dev->name, err);
return;
}
-
+
len = HERMES_RECLEN_TO_BYTES(le16_to_cpu(info.len));
type = le16_to_cpu(info.type);
case HERMES_INQ_TALLIES: {
struct hermes_tallies_frame tallies;
struct iw_statistics *wstats = &priv->wstats;
-
+
if (len > sizeof(tallies)) {
printk(KERN_WARNING "%s: Tallies frame too long (%d bytes)\n",
dev->name, len);
len = sizeof(tallies);
}
-
+
err = hermes_bap_pread(hw, IRQ_BAP, &tallies, len,
infofid, sizeof(info));
if (err)
break;
-
+
/* Increment our various counters */
/* wstats->discard.nwid - no wrong BSSID stuff */
wstats->discard.code +=
le16_to_cpu(tallies.RxWEPUndecryptable);
- if (len == sizeof(tallies))
+ if (len == sizeof(tallies))
wstats->discard.code +=
le16_to_cpu(tallies.RxDiscards_WEPICVError) +
le16_to_cpu(tallies.RxDiscards_WEPExcluded);
hermes_set_irqmask(hw, 0);
hermes_write_regn(hw, EVACK, 0xffff);
}
-
+
/* firmware will have to reassociate */
netif_carrier_off(dev);
priv->last_linkstatus = 0xffff;
printk(KERN_WARNING "%s: firmware ALLOC bug detected "
"(old Symbol firmware?). Trying to work around... ",
dev->name);
-
+
priv->nicbuf_size = TX_NICBUF_SIZE_BUG;
err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
if (err)
/* Force uniform key length to work around firmware bugs */
keylen = le16_to_cpu(priv->keys[priv->tx_key].len);
-
+
if (keylen > LARGE_KEY_SIZE) {
printk(KERN_ERR "%s: BUG: Key %d has oversize length %d.\n",
priv->ndev->name, priv->tx_key, keylen);
HERMES_RID_CNFWEPFLAGS_INTERSIL,
master_wep_flag);
if (err)
- return err;
+ return err;
break;
}
} else {
createibss = priv->createibss;
}
-
+
err = hermes_write_wordrec(hw, USER_BAP,
HERMES_RID_CNFCREATEIBSS,
createibss);
if (priv->iw_mode == IW_MODE_MONITOR) {
/* Enable monitor mode */
dev->type = ARPHRD_IEEE80211;
- err = hermes_docmd_wait(hw, HERMES_CMD_TEST |
+ err = hermes_docmd_wait(hw, HERMES_CMD_TEST |
HERMES_TEST_MONITOR, 0, NULL);
} else {
/* Disable monitor mode */
if (err) {
printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n",
dev->name, err);
- } else
+ } else
priv->promiscuous = promisc;
}
BUG_ON(! p);
/* paranoia: bad address size in list? */
BUG_ON(p->dmi_addrlen != ETH_ALEN);
-
+
memcpy(mclist.addr[i], p->dmi_addr, ETH_ALEN);
p = p->next;
}
-
+
if (p)
printk(KERN_WARNING "%s: Multicast list is "
"longer than mc_count\n", dev->name);
orinoco_unlock(priv, &flags);
- /* Scanning support: Cleanup of driver struct */
+ /* Scanning support: Cleanup of driver struct */
orinoco_clear_scan_results(priv, 0);
priv->scan_inprogress = 0;
orinoco_unlock(priv, &flags);
return IRQ_NONE;
}
-
+
if (jiffies != last_irq_jiffy)
loops_this_jiffy = 0;
last_irq_jiffy = jiffies;
__orinoco_ev_tx(dev, hw);
if (events & HERMES_EV_ALLOC)
__orinoco_ev_alloc(dev, hw);
-
+
hermes_write_regn(hw, EVACK, evstat);
evstat = hermes_read_regn(hw, EVSTAT);
priv->has_ibss = (firmver >= 0x20000);
priv->has_wep = (firmver >= 0x15012);
priv->has_big_wep = (firmver >= 0x20000);
- priv->has_pm = (firmver >= 0x20000 && firmver < 0x22000) ||
+ priv->has_pm = (firmver >= 0x20000 && firmver < 0x22000) ||
(firmver >= 0x29000 && firmver < 0x30000) ||
firmver >= 0x31000;
priv->has_preamble = (firmver >= 0x20000);
*/
priv->do_fw_download = (priv->stop_fw != NULL);
- priv->broken_disableport = (firmver == 0x25013) ||
- (firmver >= 0x30000 && firmver <= 0x31000);
+ priv->broken_disableport = (firmver == 0x25013) ||
+ (firmver >= 0x30000 && firmver <= 0x31000);
priv->has_hostscan = (firmver >= 0x31001) ||
(firmver >= 0x29057 && firmver < 0x30000);
/* Tested with Intel firmware : 0x20015 => Jean II */
if (err)
goto out;
}
-
+
/* Set up the default configuration */
priv->iw_mode = IW_MODE_INFRA;
/* By default use IEEE/IBSS ad-hoc mode if we have it */
rid = (priv->port_type == 3) ? HERMES_RID_CNFOWNSSID :
HERMES_RID_CNFDESIREDSSID;
-
+
err = hermes_read_ltv(hw, USER_BAP, rid, sizeof(essidbuf),
NULL, &essidbuf);
if (err)
fail_unlock:
orinoco_unlock(priv, &flags);
- return err;
+ return err;
}
static int orinoco_hw_get_freq(struct orinoco_private *priv)
{
-
+
hermes_t *hw = &priv->hw;
int err = 0;
u16 channel;
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
-
+
err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CURRENTCHANNEL, &channel);
if (err)
goto out;
if (err)
return err;
-
+
num = le16_to_cpu(list.len);
*numrates = num;
num = min(num, max);
range->freq[k].e = 1;
k++;
}
-
+
if (k >= IW_MAX_FREQUENCIES)
break;
}
if ((val < 1) || (val > 3))
return -EINVAL;
-
+
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
priv->ap_density = val;
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
-
+
if (priv->has_mwo) {
err = hermes_read_wordrec(hw, USER_BAP,
HERMES_RID_CNFMWOROBUST_AGERE,
}
orinoco_unlock(priv, &flags);
-
+
return err;
}
int bitrate; /* 100s of kilobits */
int i;
unsigned long flags;
-
+
/* As the user space doesn't know our highest rate, it uses -1
* to ask us to set the highest rate. Test it using "iwconfig
* ethX rate auto" - Jean II */
ratemode = i;
break;
}
-
+
if (ratemode == -1)
return -EINVAL;
HERMES_RID_CURRENTTXRATE, &val);
if (err)
goto out;
-
+
switch (priv->firmware_type) {
case FIRMWARE_TYPE_AGERE: /* Lucent style rate */
/* Note : in Lucent firmware, the return value of
err = -EINVAL;
goto out;
}
-
+
if (prq->flags & IW_POWER_TIMEOUT) {
priv->pm_on = 1;
priv->pm_timeout = prq->value / 1000;
if(!priv->pm_on) {
err = -EINVAL;
goto out;
- }
+ }
}
out:
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
-
+
err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFPMENABLED, &enable);
if (err)
goto out;
idx = priv->tx_key;
if (encoding->flags & IW_ENCODE_DISABLED)
- alg = IW_ENCODE_ALG_NONE;
+ alg = IW_ENCODE_ALG_NONE;
if (priv->has_wpa && (alg != IW_ENCODE_ALG_TKIP)) {
/* Clear any TKIP TX key we had */
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
-
+
err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_SHORTRETRYLIMIT,
&short_limit);
if (err)
break;
}
priv->prefer_port3 = 0;
-
+
break;
case 1: /* Try to do Lucent proprietary ad-hoc mode */