netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: netdev@vger.kernel.org
Cc: rt2x00-devel@lfcorreia.dyndns.org
Subject: [PATCH 6/6] rt2x00 update: Apply correct error handling to dscape stack
Date: Fri, 28 Apr 2006 16:52:29 +0200	[thread overview]
Message-ID: <200604281652.29811.IvDoorn@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4507 bytes --]

From: Ivo van Doorn <IvDoorn@gmail.com>

Return correct error code at failure, and
request debug report when the function _tx()
has received an invalid queue.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:32:12.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 16:34:55.000000000 +0200
@@ -1538,20 +1538,21 @@ rt2400pci_tx(struct net_device *net_dev,
 	 */
 	ring = rt2x00pci_get_ring(rt2x00pci, control->queue);
 	if (unlikely(!ring)) {
-		ERROR("Attempt to send packet over invalid queue %d.\n",
-			control->queue);
-		return NET_RX_DROP;
+		ERROR("Attempt to send packet over invalid queue %d.\n"
+			"Please file bug report to %s.\n",
+			control->queue, DRV_PROJECT);
+		return NET_XMIT_DROP;
 	}
 
 	if (rt2x00_ring_full(ring))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	entry = rt2x00_get_data_entry(ring);
 	txd = entry->desc_addr;
 
 	if (rt2x00_get_field32(txd->word0, TXD_W0_OWNER_NIC)
 	|| rt2x00_get_field32(txd->word0, TXD_W0_VALID))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	memcpy(entry->data_addr, skb->data, skb->len);
 	rt2400pci_write_tx_desc(rt2x00pci, txd, skb, control);
@@ -2032,7 +2033,7 @@ rt2400pci_conf_tx(struct net_device *net
 	 */
 	if (queue != IEEE80211_TX_QUEUE_DATA0) {
 		NOTICE("Ignoring configuration for queue %d.\n", queue);
-		return 0;
+		return -EINVAL;
 	}
 
 	memcpy(&ring->tx_params, params, sizeof(*params));
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:32:31.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 16:34:54.000000000 +0200
@@ -1661,20 +1661,21 @@ rt2500pci_tx(struct net_device *net_dev,
 	 */
 	ring = rt2x00pci_get_ring(rt2x00pci, control->queue);
 	if (unlikely(!ring)) {
-		ERROR("Attempt to send packet over invalid queue %d.\n",
-			control->queue);
-		return NET_RX_DROP;
+		ERROR("Attempt to send packet over invalid queue %d.\n"
+			"Please file bug report to %s.\n",
+			control->queue, DRV_PROJECT);
+		return NET_XMIT_DROP;
 	}
 
 	if (rt2x00_ring_full(ring))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	entry = rt2x00_get_data_entry(ring);
 	txd = entry->desc_addr;
 
 	if (rt2x00_get_field32(txd->word0, TXD_W0_OWNER_NIC)
 	|| rt2x00_get_field32(txd->word0, TXD_W0_VALID))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	memcpy(entry->data_addr, skb->data, skb->len);
 	rt2500pci_write_tx_desc(rt2x00pci, txd, skb, control);
@@ -2147,7 +2148,7 @@ rt2500pci_conf_tx(struct net_device *net
 	ring = rt2x00pci_get_ring(rt2x00pci, queue);
 	if (unlikely(!ring)) {
 		NOTICE("Ignoring configuration for queue %d.\n", queue);
-		return 0;
+		return -EINVAL;
 	}
 
 	memcpy(&ring->tx_params, params, sizeof(*params));
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:32:06.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 16:34:56.000000000 +0200
@@ -1373,13 +1373,14 @@ rt2500usb_tx(struct net_device *net_dev,
 	 */
 	ring = rt2x00usb_get_ring(rt2x00usb, control->queue);
 	if (unlikely(!ring)) {
-		ERROR("Attempt to send packet over invalid queue %d.\n",
-			control->queue);
-		return NET_RX_DROP;
+		ERROR("Attempt to send packet over invalid queue %d.\n"
+			"Please file bug report to %s.\n",
+			control->queue, DRV_PROJECT);
+		return NET_XMIT_DROP;
 	}
 
 	if (rt2x00_ring_full(ring))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	entry = rt2x00_get_data_entry(ring);
 	txd = rt2x00usb_txdesc_addr(entry);
@@ -1797,7 +1798,7 @@ rt2500usb_conf_tx(struct net_device *net
 	ring = rt2x00usb_get_ring(rt2x00usb, queue);
 	if (unlikely(!ring)) {
 		NOTICE("Ignoring configuration for queue %d.\n", queue);
-		return 0;
+		return -EINVAL;
 	}
 
 	memcpy(&ring->tx_params, params, sizeof(*params));

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

                 reply	other threads:[~2006-04-28 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200604281652.29811.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rt2x00-devel@lfcorreia.dyndns.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).