From: Chr <chunkeey@web.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Hans de Goede <j.w.r.degoede@hhs.nl>,
Michael Wu <flamingice@sourmilk.net>,
linux-wireless@vger.kernel.org
Subject: Re: Recent linux-wireless git changes have broken my prism54pci card
Date: Tue, 21 Aug 2007 00:14:26 +0200 [thread overview]
Message-ID: <200708210014.26242.chunkeey@web.de> (raw)
In-Reply-To: <1187612256.6090.104.camel@johannes.berg>
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
On Monday, 20. August 2007, Johannes Berg wrote:
> On Mon, 2007-08-20 at 13:51 +0200, Chr wrote:
>
> > "pyh2: not handling 0x02 type control frame" (could be the FW)
>
> The driver, I assume.
No, it's really the firmware. I've "finally" tried the 2.4.12.0 and got the same messages...
But, I didn't get them with 2.7.0.0 or 2.5.2.0.
Moreover, because of some "unknown reason" 2.4.12.0 does not work very well with
my isl3880 chip, I cannot tx/rx any QoS data frame... And probably, it's because the
feature is not supported by the firmware...
I made two patches:
the p54-pull-padding.diff should finally fix the rate algorithm for "everyone" and as
a bonus for developers: it adds a printk for the firmware revision p54 is using.
(If noone complains within a week, I'll write a official patch post for it...)
p54-remove-qos.diff (must be applied on top of p54-pull-padding.diff) is _only_ for
Hans... It removes/reverts QoS/WME/WMM/IEEE802.11e features.
Thanks,
Chr
[-- Attachment #2: p54-pull-padding.diff --]
[-- Type: text/x-diff, Size: 5122 bytes --]
diff -Nurp a/drivers/net/wireless/p54common.c b/drivers/net/wireless/p54common.c
--- a/drivers/net/wireless/p54common.c 2007-08-18 20:44:04.000000000 +0200
+++ b/drivers/net/wireless/p54common.c 2007-08-20 23:06:46.000000000 +0200
@@ -48,6 +48,7 @@ void p54_parse_firmware(struct ieee80211
while (bootrec->data <= end_data &&
(bootrec->data + le32_to_cpu(bootrec->len)) <= end_data) {
u32 code = le32_to_cpu(bootrec->code);
+ size_t len = le32_to_cpu(bootrec->len);
switch (code) {
case BR_CODE_COMPONENT_ID:
switch (be32_to_cpu(*bootrec->data)) {
@@ -69,6 +70,9 @@ void p54_parse_firmware(struct ieee80211
}
break;
case BR_CODE_COMPONENT_VERSION:
+ priv->fw_version = kmalloc(len * 4, GFP_KERNEL);
+ snprintf(priv->fw_version, len * 4, "%s", (char*)bootrec->data);
+ printk(KERN_INFO "p54: firmware version %s\n", priv->fw_version);
break;
case BR_CODE_DESCR:
priv->rx_start = le32_to_cpu(bootrec->data[1]);
@@ -86,7 +90,7 @@ void p54_parse_firmware(struct ieee80211
default:
break;
}
- bootrec = (struct bootrec *)&bootrec->data[le32_to_cpu(bootrec->len)];
+ bootrec = (struct bootrec *)&bootrec->data[len];
}
}
EXPORT_SYMBOL_GPL(p54_parse_firmware);
@@ -315,9 +319,11 @@ static void p54_rx_frame_sent(struct iee
struct p54_control_hdr *hdr = (struct p54_control_hdr *) skb->data;
struct p54_frame_sent_hdr *payload = (struct p54_frame_sent_hdr *) hdr->data;
struct sk_buff *entry = (struct sk_buff *) priv->tx_queue.next;
+ struct p54_control_hdr *entry_hdr;
+ struct p54_tx_control_allocdata *entry_data;
u32 addr = le32_to_cpu(hdr->req_id) - 0x70;
struct memrecord *range = NULL;
- u32 freed = 0;
+ u32 freed = 0, pad = 0;
u32 last_addr = priv->rx_start;
while (entry != (struct sk_buff *)&priv->tx_queue) {
@@ -339,15 +345,25 @@ static void p54_rx_frame_sent(struct iee
memcpy(&status.control, range->control,
sizeof(status.control));
kfree(range->control);
- if (!payload->status)
- status.flags |= IEEE80211_TX_STATUS_ACK;
- else
- status.excessive_retries = 1;
- status.retry_count = payload->retries - 1;
- status.ack_signal = le16_to_cpu(payload->ack_rssi);
- skb_pull(entry, sizeof(*hdr) + sizeof(struct p54_tx_control_allocdata));
priv->tx_stats.data[status.control.queue].len--;
+
+ entry_hdr = (struct p54_control_hdr *) entry->data;
+ entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data;
+ if (entry_hdr->magic1 & cpu_to_le16(0x4000))
+ pad = entry_data->align[0];
+ else
+ pad = 0;
+ if (status.control.flags & IEEE80211_TXCTL_NO_ACK) {
+ if (!(payload->status & 0x01))
+ status.flags |= IEEE80211_TX_STATUS_ACK;
+ else
+ status.excessive_retries = 1;
+ status.retry_count = payload->retries - 1;
+ status.ack_signal = le16_to_cpu(payload->ack_rssi);
+ }
+ skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data));
ieee80211_tx_status_irqsafe(dev, entry, &status);
+
break;
} else
last_addr = range->end_addr;
@@ -486,6 +502,7 @@ static int p54_tx(struct ieee80211_hw *d
ieee80211_stop_queue(dev, control->queue);
padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3;
+
len = skb->len;
control_copy = kmalloc(sizeof(*control), GFP_ATOMIC);
@@ -496,10 +513,12 @@ static int p54_tx(struct ieee80211_hw *d
skb_push(skb, sizeof(*txhdr) + padding);
hdr = (struct p54_control_hdr *) skb_push(skb, sizeof(*hdr));
- if (padding)
- hdr->magic1 = cpu_to_le16(0x4010);
- else
- hdr->magic1 = cpu_to_le16(0x0010);
+ if (padding) {
+ hdr->magic1 = cpu_to_le16(0x4000);
+ txhdr->align[0] = padding;
+ } else
+ hdr->magic1 = cpu_to_le16(0x0000);
+
hdr->len = cpu_to_le16(len);
hdr->type = (control->flags & IEEE80211_TXCTL_NO_ACK) ? 0 : cpu_to_le16(1);
hdr->retry1 = hdr->retry2 = control->retry_limit;
@@ -515,6 +534,9 @@ static int p54_tx(struct ieee80211_hw *d
rate |= 0x40;
else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)
rate |= 0x20;
+ else
+ hdr->magic1 |= cpu_to_le16(0x0010);
+
memset(txhdr->rateset, rate, 8);
txhdr->wep_key_present = 0;
txhdr->wep_key_len = 0;
@@ -525,8 +547,6 @@ static int p54_tx(struct ieee80211_hw *d
txhdr->output_power = 0x7f; // HW Maximum
txhdr->magic5 = (control->flags & IEEE80211_TXCTL_NO_ACK) ?
0 : ((rate > 0x3) ? cpu_to_le32(0x33) : cpu_to_le32(0x23));
- if (padding)
- txhdr->align[0] = padding;
priv->tx(dev, hdr, skb->len, 0);
return 0;
@@ -938,6 +958,7 @@ void p54_free_common(struct ieee80211_hw
kfree(priv->output_limit);
kfree(priv->curve_data);
kfree(priv->cached_vdcf);
+ kfree(priv->fw_version);
}
EXPORT_SYMBOL_GPL(p54_free_common);
diff -Nurp a/drivers/net/wireless/p54.h b/drivers/net/wireless/p54.h
--- a/drivers/net/wireless/p54.h 2007-08-18 20:44:04.000000000 +0200
+++ b/drivers/net/wireless/p54.h 2007-08-20 23:05:45.000000000 +0200
@@ -60,6 +60,7 @@ struct p54_common {
struct pda_pa_curve_data *curve_data;
__le16 rxhw;
u8 version;
+ char *fw_version;
unsigned int tx_hdr_len;
void *cached_vdcf;
/* FIXME: this channels/modes/rates stuff sucks */
[-- Attachment #3: p54-remove-qos.diff --]
[-- Type: text/x-diff, Size: 1947 bytes --]
diff -Nurp a/drivers/net/wireless/p54common.c b/drivers/net/wireless/p54common.c
--- a/drivers/net/wireless/p54common.c 2007-08-20 23:06:46.000000000 +0200
+++ b/drivers/net/wireless/p54common.c 2007-08-20 23:41:07.000000000 +0200
@@ -345,7 +345,7 @@ static void p54_rx_frame_sent(struct iee
memcpy(&status.control, range->control,
sizeof(status.control));
kfree(range->control);
- priv->tx_stats.data[status.control.queue].len--;
+ priv->tx_stats.data[0].len--;
entry_hdr = (struct p54_control_hdr *) entry->data;
entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data;
@@ -493,13 +493,13 @@ static int p54_tx(struct ieee80211_hw *d
size_t padding, len;
u8 rate;
- current_queue = &priv->tx_stats.data[control->queue];
+ current_queue = &priv->tx_stats.data[0];
if (unlikely(current_queue->len > current_queue->limit))
return NETDEV_TX_BUSY;
current_queue->len++;
current_queue->count++;
if (current_queue->len == current_queue->limit)
- ieee80211_stop_queue(dev, control->queue);
+ ieee80211_stop_queue(dev, 0);
padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3;
@@ -540,7 +540,7 @@ static int p54_tx(struct ieee80211_hw *d
memset(txhdr->rateset, rate, 8);
txhdr->wep_key_present = 0;
txhdr->wep_key_len = 0;
- txhdr->frame_type = cpu_to_le32(control->queue + 4);
+ txhdr->frame_type = 4;
txhdr->magic4 = 0;
txhdr->antenna = (control->antenna_sel_tx == 0) ?
2 : control->antenna_sel_tx - 1;
@@ -920,12 +920,9 @@ struct ieee80211_hw *p54_init_common(siz
dev->max_rssi = 100;
/* (hard) queue limits */
- priv->tx_stats.data[0].limit = 3;
- priv->tx_stats.data[1].limit = 4;
- priv->tx_stats.data[2].limit = 3;
- priv->tx_stats.data[3].limit = 1;
+ priv->tx_stats.data[0].limit = 4;
- dev->queues = 4;
+ dev->queues = 1;
dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 +
sizeof(struct p54_tx_control_allocdata);
next prev parent reply other threads:[~2007-08-20 22:14 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 5:50 Recent linux-wireless git changes have broken my prism54pci card Hans de Goede
2007-08-13 6:18 ` Michael Wu
2007-08-13 6:33 ` Hans de Goede
2007-08-13 6:46 ` Andy Green
2007-08-13 7:49 ` Hans de Goede
2007-08-13 7:58 ` Michael Wu
2007-08-13 8:05 ` Andy Green
2007-08-13 11:58 ` Hans de Goede
2007-08-13 20:14 ` Michael Wu
2007-08-13 22:25 ` Chr
2007-08-14 8:10 ` Hans de Goede
2007-08-14 18:29 ` Chr
2007-08-20 0:44 ` Chr
2007-08-20 2:32 ` Larry Finger
2007-08-20 7:52 ` Hans de Goede
2007-08-20 11:51 ` Chr
2007-08-20 12:17 ` Johannes Berg
2007-08-20 22:14 ` Chr [this message]
2007-08-23 11:24 ` Hans de Goede
2007-08-23 14:43 ` Chr
2007-08-23 14:36 ` Hans de Goede
2007-08-23 21:52 ` Hans de Goede
2007-08-23 23:00 ` Chr
2007-08-24 9:45 ` Hans de Goede
2007-08-28 19:32 ` Chr
2007-08-30 5:52 ` Michael Wu
2007-08-30 11:16 ` Chr
2007-08-31 21:27 ` [PATCH 1/2] p54: various fixes Chr
2007-08-31 21:27 ` [PATCH 2/2] p54: disable QoS on older firmwares Chr
2007-09-01 4:58 ` Michael Wu
2007-09-01 16:54 ` [PATCH 2/2 v2] " Chr
2007-08-13 13:14 ` Recent linux-wireless git changes have broken my prism54pci card Johannes Berg
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=200708210014.26242.chunkeey@web.de \
--to=chunkeey@web.de \
--cc=flamingice@sourmilk.net \
--cc=j.w.r.degoede@hhs.nl \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.