netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@suse.cz>
To: Ivo van Doorn <ivdoorn@gmail.com>
Cc: netdev@vger.kernel.org, rt2x00-devel@lfcorreia.dyndns.org
Subject: Re: [PATCH 22/32] rt2x00: Allocate ring structures in single array
Date: Fri, 28 Apr 2006 12:52:01 +0200	[thread overview]
Message-ID: <20060428125201.4f20ece2@griffin.suse.cz> (raw)
In-Reply-To: <200604280003.14287.IvDoorn@gmail.com>

On Fri, 28 Apr 2006 00:03:13 +0200, Ivo van Doorn wrote:
> Use seperate function to convert a dscape ring ID
> to the address of the actual ring.

Just minor things:

> [...]
> @@ -1386,20 +1412,19 @@ rt2400pci_tx(struct net_device *net_dev,
>  
>  	rt2x00_register_read(rt2x00pci, TXCSR0, &reg);
>  
> -	if (control->queue == IEEE80211_TX_QUEUE_DATA0) {
> -		ring = &rt2x00pci->prio;
> -		rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, 1);
> -	} else if (control->queue == IEEE80211_TX_QUEUE_DATA1) {
> -		ring = &rt2x00pci->tx;
> -		rt2x00_set_field32(&reg, TXCSR0_KICK_TX, 1);
> -	} else if (control->queue == IEEE80211_TX_QUEUE_AFTER_BEACON) {
> -		ring = &rt2x00pci->atim;
> -		rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, 1);
> -	} else {
> -		ERROR("Frame received for invalid queue.");
> +	/*
> +	 * Determine which ring to put packet on.
> +	 */
> +	ring = rt2x00pci_get_ring(rt2x00pci, control->queue);
> +	if (unlikely(!ring)) {

Should not happen. Maybe some message that user should report a bug?

> +		ERROR("Attempt to send packet over invalid queue %d.\n",
> +			control->queue);
>  		return NET_RX_DROP;
>  	}
>  
> +	if (rt2x00_ring_full(ring))
> +		return NET_RX_DROP;

NET_XMIT_DROP?

> +
>  	entry = rt2x00_get_data_entry(ring);
>  	txd = entry->desc_addr;
>  
> [...]
> @@ -1780,14 +1813,17 @@ rt2400pci_conf_tx(struct net_device *net
>  	int queue, const struct ieee80211_tx_queue_params *params)
>  {
>  	struct rt2x00_pci	*rt2x00pci = ieee80211_dev_hw_data(net_dev);
> -	struct data_ring	*ring;
> +	struct data_ring	*ring = &rt2x00pci->ring[RING_TX];
>  
> -	if (queue == IEEE80211_TX_QUEUE_DATA0)
> -		ring = &rt2x00pci->prio;
> -	else if (queue == IEEE80211_TX_QUEUE_DATA1)
> -		ring = &rt2x00pci->tx;
> -	else
> -		return -EINVAL;
> +	/*
> +	 * We don't support variating cw_min and cw_max variables
> +	 * per queue. So by default we only configure the TX queue,
> +	 * and ignore all other configurations.
> +	 */
> +	if (queue != IEEE80211_TX_QUEUE_DATA0) {
> +		NOTICE("Ignoring configuration for queue %d.\n", queue);
> +		return 0;

Is there a reason for not returning a proper error code?

> +	}
>  
>  	memcpy(&ring->tx_params, params, sizeof(*params));
>  

Ditto for rt2500pci and rt2500usb.

Thanks,

-- 
Jiri Benc
SUSE Labs

  reply	other threads:[~2006-04-28 10:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 22:03 [PATCH 22/32] rt2x00: Allocate ring structures in single array Ivo van Doorn
2006-04-28 10:52 ` Jiri Benc [this message]
2006-04-28 14:25   ` Ivo van Doorn
2006-04-28 14:30     ` Jiri Benc
2006-04-28 14:33       ` Ivo van Doorn

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=20060428125201.4f20ece2@griffin.suse.cz \
    --to=jbenc@suse.cz \
    --cc=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).