Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f42a4449 authored by David S. Miller's avatar David S. Miller
Browse files
parents 63fe46da ef85ad54
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -445,9 +445,9 @@ static void adm8211_interrupt_rci(struct ieee80211_hw *dev)
			struct ieee80211_rx_status rx_status = {0};

			if (priv->pdev->revision < ADM8211_REV_CA)
				rx_status.ssi = rssi;
				rx_status.signal = rssi;
			else
				rx_status.ssi = 100 - rssi;
				rx_status.signal = 100 - rssi;

			rx_status.rate_idx = rate;

@@ -1893,9 +1893,10 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,

	dev->extra_tx_headroom = sizeof(struct adm8211_tx_hdr);
	/* dev->flags = IEEE80211_HW_RX_INCLUDES_FCS in promisc mode */
	dev->flags = IEEE80211_HW_SIGNAL_UNSPEC;

	dev->channel_change_time = 1000;
	dev->max_rssi = 100;	/* FIXME: find better value */
	dev->max_signal = 100;    /* FIXME: find better value */

	dev->queues = 1; /* ADM8211C supports more, maybe ADM8211B too */

+29 −28
Original line number Diff line number Diff line
@@ -1148,7 +1148,6 @@ static u8 airo_dbm_to_pct (tdsRssiEntry *rssi_rid, u8 dbm);
static void airo_networks_free(struct airo_info *ai);

struct airo_info {
	struct net_device_stats	stats;
	struct net_device             *dev;
	struct list_head              dev_list;
	/* Note, we can have MAX_FIDS outstanding.  FIDs are 16-bits, so we
@@ -1924,7 +1923,7 @@ static int mpi_start_xmit(struct sk_buff *skb, struct net_device *dev) {
	if (npacks >= MAXTXQ - 1) {
		netif_stop_queue (dev);
		if (npacks > MAXTXQ) {
			ai->stats.tx_fifo_errors++;
			dev->stats.tx_fifo_errors++;
			return 1;
		}
		skb_queue_tail (&ai->txq, skb);
@@ -2044,13 +2043,13 @@ static void get_tx_error(struct airo_info *ai, s32 fid)
		bap_read(ai, &status, 2, BAP0);
	}
	if (le16_to_cpu(status) & 2) /* Too many retries */
		ai->stats.tx_aborted_errors++;
		ai->dev->stats.tx_aborted_errors++;
	if (le16_to_cpu(status) & 4) /* Transmit lifetime exceeded */
		ai->stats.tx_heartbeat_errors++;
		ai->dev->stats.tx_heartbeat_errors++;
	if (le16_to_cpu(status) & 8) /* Aid fail */
		{ }
	if (le16_to_cpu(status) & 0x10) /* MAC disabled */
		ai->stats.tx_carrier_errors++;
		ai->dev->stats.tx_carrier_errors++;
	if (le16_to_cpu(status) & 0x20) /* Association lost */
		{ }
	/* We produce a TXDROP event only for retry or lifetime
@@ -2102,7 +2101,7 @@ static void airo_end_xmit(struct net_device *dev) {
		for (; i < MAX_FIDS / 2 && (priv->fids[i] & 0xffff0000); i++);
	} else {
		priv->fids[fid] &= 0xffff;
		priv->stats.tx_window_errors++;
		dev->stats.tx_window_errors++;
	}
	if (i < MAX_FIDS / 2)
		netif_wake_queue(dev);
@@ -2128,7 +2127,7 @@ static int airo_start_xmit(struct sk_buff *skb, struct net_device *dev) {
		netif_stop_queue(dev);

		if (i == MAX_FIDS / 2) {
			priv->stats.tx_fifo_errors++;
			dev->stats.tx_fifo_errors++;
			return 1;
		}
	}
@@ -2167,7 +2166,7 @@ static void airo_end_xmit11(struct net_device *dev) {
		for (; i < MAX_FIDS && (priv->fids[i] & 0xffff0000); i++);
	} else {
		priv->fids[fid] &= 0xffff;
		priv->stats.tx_window_errors++;
		dev->stats.tx_window_errors++;
	}
	if (i < MAX_FIDS)
		netif_wake_queue(dev);
@@ -2199,7 +2198,7 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) {
		netif_stop_queue(dev);

		if (i == MAX_FIDS) {
			priv->stats.tx_fifo_errors++;
			dev->stats.tx_fifo_errors++;
			return 1;
		}
	}
@@ -2219,8 +2218,9 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) {
	return 0;
}

static void airo_read_stats(struct airo_info *ai)
static void airo_read_stats(struct net_device *dev)
{
	struct airo_info *ai = dev->priv;
	StatsRid stats_rid;
	__le32 *vals = stats_rid.vals;

@@ -2232,23 +2232,24 @@ static void airo_read_stats(struct airo_info *ai)
	readStatsRid(ai, &stats_rid, RID_STATS, 0);
	up(&ai->sem);

	ai->stats.rx_packets = le32_to_cpu(vals[43]) + le32_to_cpu(vals[44]) +
	dev->stats.rx_packets = le32_to_cpu(vals[43]) + le32_to_cpu(vals[44]) +
			       le32_to_cpu(vals[45]);
	ai->stats.tx_packets = le32_to_cpu(vals[39]) + le32_to_cpu(vals[40]) +
	dev->stats.tx_packets = le32_to_cpu(vals[39]) + le32_to_cpu(vals[40]) +
			       le32_to_cpu(vals[41]);
	ai->stats.rx_bytes = le32_to_cpu(vals[92]);
	ai->stats.tx_bytes = le32_to_cpu(vals[91]);
	ai->stats.rx_errors = le32_to_cpu(vals[0]) + le32_to_cpu(vals[2]) +
	dev->stats.rx_bytes = le32_to_cpu(vals[92]);
	dev->stats.tx_bytes = le32_to_cpu(vals[91]);
	dev->stats.rx_errors = le32_to_cpu(vals[0]) + le32_to_cpu(vals[2]) +
			      le32_to_cpu(vals[3]) + le32_to_cpu(vals[4]);
	ai->stats.tx_errors = le32_to_cpu(vals[42]) + ai->stats.tx_fifo_errors;
	ai->stats.multicast = le32_to_cpu(vals[43]);
	ai->stats.collisions = le32_to_cpu(vals[89]);
	dev->stats.tx_errors = le32_to_cpu(vals[42]) +
			      dev->stats.tx_fifo_errors;
	dev->stats.multicast = le32_to_cpu(vals[43]);
	dev->stats.collisions = le32_to_cpu(vals[89]);

	/* detailed rx_errors: */
	ai->stats.rx_length_errors = le32_to_cpu(vals[3]);
	ai->stats.rx_crc_errors = le32_to_cpu(vals[4]);
	ai->stats.rx_frame_errors = le32_to_cpu(vals[2]);
	ai->stats.rx_fifo_errors = le32_to_cpu(vals[0]);
	dev->stats.rx_length_errors = le32_to_cpu(vals[3]);
	dev->stats.rx_crc_errors = le32_to_cpu(vals[4]);
	dev->stats.rx_frame_errors = le32_to_cpu(vals[2]);
	dev->stats.rx_fifo_errors = le32_to_cpu(vals[0]);
}

static struct net_device_stats *airo_get_stats(struct net_device *dev)
@@ -2261,10 +2262,10 @@ static struct net_device_stats *airo_get_stats(struct net_device *dev)
			set_bit(JOB_STATS, &local->jobs);
			wake_up_interruptible(&local->thr_wait);
		} else
			airo_read_stats(local);
			airo_read_stats(dev);
	}

	return &local->stats;
	return &dev->stats;
}

static void airo_set_promisc(struct airo_info *ai) {
@@ -3092,7 +3093,7 @@ static int airo_thread(void *data) {
		else if (test_bit(JOB_XMIT11, &ai->jobs))
			airo_end_xmit11(dev);
		else if (test_bit(JOB_STATS, &ai->jobs))
			airo_read_stats(ai);
			airo_read_stats(dev);
		else if (test_bit(JOB_WSTATS, &ai->jobs))
			airo_read_wireless_stats(ai);
		else if (test_bit(JOB_PROMISC, &ai->jobs))
@@ -3288,7 +3289,7 @@ static irqreturn_t airo_interrupt(int irq, void *dev_id)

			skb = dev_alloc_skb( len + hdrlen + 2 + 2 );
			if ( !skb ) {
				apriv->stats.rx_dropped++;
				dev->stats.rx_dropped++;
				goto badrx;
			}
			skb_reserve(skb, 2); /* This way the IP header is aligned */
@@ -3556,7 +3557,7 @@ static void mpi_receive_802_3(struct airo_info *ai)

		skb = dev_alloc_skb(len);
		if (!skb) {
			ai->stats.rx_dropped++;
			ai->dev->stats.rx_dropped++;
			goto badrx;
		}
		buffer = skb_put(skb,len);
@@ -3649,7 +3650,7 @@ void mpi_receive_802_11 (struct airo_info *ai)

	skb = dev_alloc_skb( len + hdrlen + 2 );
	if ( !skb ) {
		ai->stats.rx_dropped++;
		ai->dev->stats.rx_dropped++;
		goto badrx;
	}
	buffer = (u16*)skb_put (skb, len + hdrlen);
+20 −20
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ static inline int arlan_drop_tx(struct net_device *dev)
{
	struct arlan_private *priv = netdev_priv(dev);

	priv->stats.tx_errors++;
	dev->stats.tx_errors++;
	if (priv->Conf->tx_delay_ms)
	{
		priv->tx_done_delayed = jiffies + priv->Conf->tx_delay_ms * HZ / 1000 + 1;
@@ -1269,7 +1269,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
		{
			IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
				printk("arlan intr: transmit OK\n");
			priv->stats.tx_packets++;
			dev->stats.tx_packets++;
			priv->bad = 0;
			priv->reset = 0;
			priv->retransmissions = 0;
@@ -1496,7 +1496,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
			if (skb == NULL)
			{
				printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
				priv->stats.rx_dropped++;
				dev->stats.rx_dropped++;
				break;
			}
			skb_reserve(skb, 2);
@@ -1536,14 +1536,14 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
				}
			netif_rx(skb);
			dev->last_rx = jiffies;
			priv->stats.rx_packets++;
			priv->stats.rx_bytes += pkt_len;
			dev->stats.rx_packets++;
			dev->stats.rx_bytes += pkt_len;
		}
		break;
		
		default:
			printk(KERN_ERR "arlan intr: received unknown status\n");
			priv->stats.rx_crc_errors++;
			dev->stats.rx_crc_errors++;
			break;
	}
	ARLAN_DEBUG_EXIT("arlan_rx_interrupt");
@@ -1719,23 +1719,23 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev)

	/* Update the statistics from the device registers. */

	READSHM(priv->stats.collisions, arlan->numReTransmissions, u_int);
	READSHM(priv->stats.rx_crc_errors, arlan->numCRCErrors, u_int);
	READSHM(priv->stats.rx_dropped, arlan->numFramesDiscarded, u_int);
	READSHM(priv->stats.rx_fifo_errors, arlan->numRXBufferOverflows, u_int);
	READSHM(priv->stats.rx_frame_errors, arlan->numReceiveFramesLost, u_int);
	READSHM(priv->stats.rx_over_errors, arlan->numRXOverruns, u_int);
	READSHM(priv->stats.rx_packets, arlan->numDatagramsReceived, u_int);
	READSHM(priv->stats.tx_aborted_errors, arlan->numAbortErrors, u_int);
	READSHM(priv->stats.tx_carrier_errors, arlan->numStatusTimeouts, u_int);
	READSHM(priv->stats.tx_dropped, arlan->numDatagramsDiscarded, u_int);
	READSHM(priv->stats.tx_fifo_errors, arlan->numTXUnderruns, u_int);
	READSHM(priv->stats.tx_packets, arlan->numDatagramsTransmitted, u_int);
	READSHM(priv->stats.tx_window_errors, arlan->numHoldOffs, u_int);
	READSHM(dev->stats.collisions, arlan->numReTransmissions, u_int);
	READSHM(dev->stats.rx_crc_errors, arlan->numCRCErrors, u_int);
	READSHM(dev->stats.rx_dropped, arlan->numFramesDiscarded, u_int);
	READSHM(dev->stats.rx_fifo_errors, arlan->numRXBufferOverflows, u_int);
	READSHM(dev->stats.rx_frame_errors, arlan->numReceiveFramesLost, u_int);
	READSHM(dev->stats.rx_over_errors, arlan->numRXOverruns, u_int);
	READSHM(dev->stats.rx_packets, arlan->numDatagramsReceived, u_int);
	READSHM(dev->stats.tx_aborted_errors, arlan->numAbortErrors, u_int);
	READSHM(dev->stats.tx_carrier_errors, arlan->numStatusTimeouts, u_int);
	READSHM(dev->stats.tx_dropped, arlan->numDatagramsDiscarded, u_int);
	READSHM(dev->stats.tx_fifo_errors, arlan->numTXUnderruns, u_int);
	READSHM(dev->stats.tx_packets, arlan->numDatagramsTransmitted, u_int);
	READSHM(dev->stats.tx_window_errors, arlan->numHoldOffs, u_int);

	ARLAN_DEBUG_EXIT("arlan_statistics");

	return &priv->stats;
	return &dev->stats;
}


+0 −1
Original line number Diff line number Diff line
@@ -330,7 +330,6 @@ struct TxParam
#define TX_RING_SIZE 2
/* Information that need to be kept for each board. */
struct arlan_private {
      struct net_device_stats stats;
      struct arlan_shmem __iomem * card;
      struct arlan_shmem * conf;

+7 −18
Original line number Diff line number Diff line
@@ -458,13 +458,11 @@ ath5k_pci_probe(struct pci_dev *pdev,

	/* Initialize driver private data */
	SET_IEEE80211_DEV(hw, &pdev->dev);
	hw->flags = IEEE80211_HW_RX_INCLUDES_FCS;
	hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
		    IEEE80211_HW_SIGNAL_DBM |
		    IEEE80211_HW_NOISE_DBM;
	hw->extra_tx_headroom = 2;
	hw->channel_change_time = 5000;
	/* these names are misleading */
	hw->max_rssi = -110; /* signal in dBm */
	hw->max_noise = -110; /* noise in dBm */
	hw->max_signal = 100; /* we will provide a percentage based on rssi */
	sc = hw->priv;
	sc->hw = hw;
	sc->pdev = pdev;
@@ -1787,6 +1785,8 @@ ath5k_tasklet_rx(unsigned long data)

	spin_lock(&sc->rxbuflock);
	do {
		rxs.flag = 0;

		if (unlikely(list_empty(&sc->rxbuf))) {
			ATH5K_WARN(sc, "empty rx buf pool\n");
			break;
@@ -1893,20 +1893,9 @@ ath5k_tasklet_rx(unsigned long data)
		rxs.freq = sc->curchan->center_freq;
		rxs.band = sc->curband->band;

		/*
		 * signal quality:
		 * the names here are misleading and the usage of these
		 * values by iwconfig makes it even worse
		 */
		/* noise floor in dBm, from the last noise calibration */
		rxs.noise = sc->ah->ah_noise_floor;
		/* signal level in dBm */
		rxs.ssi = rxs.noise + rs.rs_rssi;
		/*
		 * "signal" is actually displayed as Link Quality by iwconfig
		 * we provide a percentage based on rssi (assuming max rssi 64)
		 */
		rxs.signal = rs.rs_rssi * 100 / 64;
		rxs.signal = rxs.noise + rs.rs_rssi;
		rxs.qual = rs.rs_rssi * 100 / 64;

		rxs.antenna = rs.rs_antenna;
		rxs.rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate);
Loading