Commit 02e37ba1 authored by Christian Lamparter's avatar Christian Lamparter Committed by John W. Linville

p54: per-device names

This patch replaces the static "p54:" strings in front of most printk's
with their corresponding per-device names.

It was always a bit of a hassle to check which device was
generating all the messages.
Signed-off-by: default avatarChristian Lamparter <chunkeey@web.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b2023ddc
...@@ -158,21 +158,21 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) ...@@ -158,21 +158,21 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
priv->fw_interface = be32_to_cpup((__be32 *) priv->fw_interface = be32_to_cpup((__be32 *)
bootrec->data); bootrec->data);
switch (priv->fw_interface) { switch (priv->fw_interface) {
case FW_FMAC:
printk(KERN_INFO "p54: FreeMAC firmware\n");
break;
case FW_LM20:
printk(KERN_INFO "p54: LM20 firmware\n");
break;
case FW_LM86: case FW_LM86:
printk(KERN_INFO "p54: LM86 firmware\n"); case FW_LM20:
break; case FW_LM87: {
case FW_LM87: char *iftype = (char *)bootrec->data;
printk(KERN_INFO "p54: LM87 firmware\n"); printk(KERN_INFO "%s: p54 detected a LM%c%c "
"firmware\n",
wiphy_name(dev->wiphy),
iftype[2], iftype[3]);
break; break;
}
case FW_FMAC:
default: default:
printk(KERN_INFO "p54: unknown firmware\n"); printk(KERN_ERR "%s: unsupported firmware\n",
break; wiphy_name(dev->wiphy));
return -ENODEV;
} }
break; break;
case BR_CODE_COMPONENT_VERSION: case BR_CODE_COMPONENT_VERSION:
...@@ -216,13 +216,15 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) ...@@ -216,13 +216,15 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
} }
if (fw_version) if (fw_version)
printk(KERN_INFO "p54: FW rev %s - Softmac protocol %x.%x\n", printk(KERN_INFO "%s: FW rev %s - Softmac protocol %x.%x\n",
fw_version, priv->fw_var >> 8, priv->fw_var & 0xff); wiphy_name(dev->wiphy), fw_version,
priv->fw_var >> 8, priv->fw_var & 0xff);
if (priv->fw_var < 0x500) if (priv->fw_var < 0x500)
printk(KERN_INFO "p54: you are using an obsolete firmware. " printk(KERN_INFO "%s: you are using an obsolete firmware. "
"visit http://wireless.kernel.org/en/users/Drivers/p54 " "visit http://wireless.kernel.org/en/users/Drivers/p54 "
"and grab one for \"kernel >= 2.6.28\"!\n"); "and grab one for \"kernel >= 2.6.28\"!\n",
wiphy_name(dev->wiphy));
if (priv->fw_var >= 0x300) { if (priv->fw_var >= 0x300) {
/* Firmware supports QoS, use it! */ /* Firmware supports QoS, use it! */
...@@ -399,8 +401,9 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ...@@ -399,8 +401,9 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
err = p54_convert_rev1(dev, curve_data); err = p54_convert_rev1(dev, curve_data);
break; break;
default: default:
printk(KERN_ERR "p54: unknown curve data " printk(KERN_ERR "%s: unknown curve data "
"revision %d\n", "revision %d\n",
wiphy_name(dev->wiphy),
curve_data->cal_method_rev); curve_data->cal_method_rev);
err = -ENODEV; err = -ENODEV;
break; break;
...@@ -460,7 +463,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ...@@ -460,7 +463,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
case PDR_PER_CHANNEL_BASEBAND_REGISTERS: case PDR_PER_CHANNEL_BASEBAND_REGISTERS:
break; break;
default: default:
printk(KERN_INFO "p54: unknown eeprom code : 0x%x\n", printk(KERN_INFO "%s: unknown eeprom code : 0x%x\n",
wiphy_name(dev->wiphy),
le16_to_cpu(entry->code)); le16_to_cpu(entry->code));
break; break;
} }
...@@ -470,7 +474,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ...@@ -470,7 +474,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
if (!synth || !priv->iq_autocal || !priv->output_limit || if (!synth || !priv->iq_autocal || !priv->output_limit ||
!priv->curve_data) { !priv->curve_data) {
printk(KERN_ERR "p54: not all required entries found in eeprom!\n"); printk(KERN_ERR "%s: not all required entries found in eeprom!\n",
wiphy_name(dev->wiphy));
err = -EINVAL; err = -EINVAL;
goto err; goto err;
} }
...@@ -515,7 +520,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ...@@ -515,7 +520,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
priv->curve_data = NULL; priv->curve_data = NULL;
} }
printk(KERN_ERR "p54: eeprom parse failed!\n"); printk(KERN_ERR "%s: eeprom parse failed!\n",
wiphy_name(dev->wiphy));
return err; return err;
} }
...@@ -1573,28 +1579,23 @@ static int p54_beacon_tim(struct sk_buff *skb) ...@@ -1573,28 +1579,23 @@ static int p54_beacon_tim(struct sk_buff *skb)
struct ieee80211_mgmt *mgmt = (void *)skb->data; struct ieee80211_mgmt *mgmt = (void *)skb->data;
u8 *pos, *end; u8 *pos, *end;
if (skb->len <= sizeof(mgmt)) { if (skb->len <= sizeof(mgmt))
printk(KERN_ERR "p54: beacon is too short!\n");
return -EINVAL; return -EINVAL;
}
pos = (u8 *)mgmt->u.beacon.variable; pos = (u8 *)mgmt->u.beacon.variable;
end = skb->data + skb->len; end = skb->data + skb->len;
while (pos < end) { while (pos < end) {
if (pos + 2 + pos[1] > end) { if (pos + 2 + pos[1] > end)
printk(KERN_ERR "p54: parsing beacon failed\n");
return -EINVAL; return -EINVAL;
}
if (pos[0] == WLAN_EID_TIM) { if (pos[0] == WLAN_EID_TIM) {
u8 dtim_len = pos[1]; u8 dtim_len = pos[1];
u8 dtim_period = pos[3]; u8 dtim_period = pos[3];
u8 *next = pos + 2 + dtim_len; u8 *next = pos + 2 + dtim_len;
if (dtim_len < 3) { if (dtim_len < 3)
printk(KERN_ERR "p54: invalid dtim len!\n");
return -EINVAL; return -EINVAL;
}
memmove(pos, next, end - next); memmove(pos, next, end - next);
if (dtim_len > 3) if (dtim_len > 3)
......
...@@ -405,7 +405,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev) ...@@ -405,7 +405,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
tmp = buf = kmalloc(P54U_FW_BLOCK, GFP_KERNEL); tmp = buf = kmalloc(P54U_FW_BLOCK, GFP_KERNEL);
if (!buf) { if (!buf) {
printk(KERN_ERR "p54usb: cannot allocate firmware upload buffer!\n"); dev_err(&priv->udev->dev, "(p54usb) cannot allocate firmware"
"upload buffer!\n");
err = -ENOMEM; err = -ENOMEM;
goto err_bufalloc; goto err_bufalloc;
} }
...@@ -413,13 +414,14 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev) ...@@ -413,13 +414,14 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
memcpy(buf, start_string, 4); memcpy(buf, start_string, 4);
err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 4); err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 4);
if (err) { if (err) {
printk(KERN_ERR "p54usb: reset failed! (%d)\n", err); dev_err(&priv->udev->dev, "(p54usb) reset failed! (%d)\n", err);
goto err_reset; goto err_reset;
} }
err = request_firmware(&fw_entry, "isl3887usb", &priv->udev->dev); err = request_firmware(&fw_entry, "isl3887usb", &priv->udev->dev);
if (err) { if (err) {
printk(KERN_ERR "p54usb: cannot find firmware (isl3887usb)\n"); dev_err(&priv->udev->dev, "p54usb: cannot find firmware "
"(isl3887usb)\n");
err = request_firmware(&fw_entry, "isl3887usb_bare", err = request_firmware(&fw_entry, "isl3887usb_bare",
&priv->udev->dev); &priv->udev->dev);
if (err) if (err)
...@@ -474,7 +476,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev) ...@@ -474,7 +476,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_size); err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_size);
if (err) { if (err) {
printk(KERN_ERR "p54usb: firmware upload failed!\n"); dev_err(&priv->udev->dev, "(p54usb) firmware "
"upload failed!\n");
goto err_upload_failed; goto err_upload_failed;
} }
...@@ -485,10 +488,9 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev) ...@@ -485,10 +488,9 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
*((__le32 *)buf) = cpu_to_le32(~crc32_le(~0, fw_entry->data, fw_entry->size)); *((__le32 *)buf) = cpu_to_le32(~crc32_le(~0, fw_entry->data, fw_entry->size));
err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, sizeof(u32)); err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, sizeof(u32));
if (err) { if (err) {
printk(KERN_ERR "p54usb: firmware upload failed!\n"); dev_err(&priv->udev->dev, "(p54usb) firmware upload failed!\n");
goto err_upload_failed; goto err_upload_failed;
} }
timeout = jiffies + msecs_to_jiffies(1000); timeout = jiffies + msecs_to_jiffies(1000);
while (!(err = usb_bulk_msg(priv->udev, while (!(err = usb_bulk_msg(priv->udev,
usb_rcvbulkpipe(priv->udev, P54U_PIPE_DATA), buf, 128, &alen, 1000))) { usb_rcvbulkpipe(priv->udev, P54U_PIPE_DATA), buf, 128, &alen, 1000))) {
...@@ -496,25 +498,27 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev) ...@@ -496,25 +498,27 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
break; break;
if (alen > 5 && !memcmp(buf, "ERROR", 5)) { if (alen > 5 && !memcmp(buf, "ERROR", 5)) {
printk(KERN_INFO "p54usb: firmware upload failed!\n");
err = -EINVAL; err = -EINVAL;
break; break;
} }
if (time_after(jiffies, timeout)) { if (time_after(jiffies, timeout)) {
printk(KERN_ERR "p54usb: firmware boot timed out!\n"); dev_err(&priv->udev->dev, "(p54usb) firmware boot "
"timed out!\n");
err = -ETIMEDOUT; err = -ETIMEDOUT;
break; break;
} }
} }
if (err) if (err) {
dev_err(&priv->udev->dev, "(p54usb) firmware upload failed!\n");
goto err_upload_failed; goto err_upload_failed;
}
buf[0] = 'g'; buf[0] = 'g';
buf[1] = '\r'; buf[1] = '\r';
err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 2); err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 2);
if (err) { if (err) {
printk(KERN_ERR "p54usb: firmware boot failed!\n"); dev_err(&priv->udev->dev, "(p54usb) firmware boot failed!\n");
goto err_upload_failed; goto err_upload_failed;
} }
...@@ -554,13 +558,15 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev) ...@@ -554,13 +558,15 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
buf = kmalloc(512, GFP_KERNEL); buf = kmalloc(512, GFP_KERNEL);
if (!buf) { if (!buf) {
printk(KERN_ERR "p54usb: firmware buffer alloc failed!\n"); dev_err(&priv->udev->dev, "(p54usb) firmware buffer "
"alloc failed!\n");
return -ENOMEM; return -ENOMEM;
} }
err = request_firmware(&fw_entry, "isl3886usb", &priv->udev->dev); err = request_firmware(&fw_entry, "isl3886usb", &priv->udev->dev);
if (err) { if (err) {
printk(KERN_ERR "p54usb: cannot find firmware (isl3886usb)\n"); dev_err(&priv->udev->dev, "(p54usb) cannot find firmware "
"(isl3886usb)\n");
err = request_firmware(&fw_entry, "isl3890usb", err = request_firmware(&fw_entry, "isl3890usb",
&priv->udev->dev); &priv->udev->dev);
if (err) { if (err) {
...@@ -685,8 +691,8 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev) ...@@ -685,8 +691,8 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_len); err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_len);
if (err) { if (err) {
printk(KERN_ERR "p54usb: firmware block upload " dev_err(&priv->udev->dev, "(p54usb) firmware block "
"failed\n"); "upload failed\n");
goto fail; goto fail;
} }
...@@ -719,8 +725,8 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev) ...@@ -719,8 +725,8 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
0x002C | (unsigned long)&devreg->direct_mem_win); 0x002C | (unsigned long)&devreg->direct_mem_win);
if (!(reg & cpu_to_le32(ISL38XX_DMA_STATUS_DONE)) || if (!(reg & cpu_to_le32(ISL38XX_DMA_STATUS_DONE)) ||
!(reg & cpu_to_le32(ISL38XX_DMA_STATUS_READY))) { !(reg & cpu_to_le32(ISL38XX_DMA_STATUS_READY))) {
printk(KERN_ERR "p54usb: firmware DMA transfer " dev_err(&priv->udev->dev, "(p54usb) firmware DMA "
"failed\n"); "transfer failed\n");
goto fail; goto fail;
} }
...@@ -825,8 +831,9 @@ static int __devinit p54u_probe(struct usb_interface *intf, ...@@ -825,8 +831,9 @@ static int __devinit p54u_probe(struct usb_interface *intf,
unsigned int i, recognized_pipes; unsigned int i, recognized_pipes;
dev = p54_init_common(sizeof(*priv)); dev = p54_init_common(sizeof(*priv));
if (!dev) { if (!dev) {
printk(KERN_ERR "p54usb: ieee80211 alloc failed\n"); dev_err(&udev->dev, "(p54usb) ieee80211 alloc failed\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -887,7 +894,7 @@ static int __devinit p54u_probe(struct usb_interface *intf, ...@@ -887,7 +894,7 @@ static int __devinit p54u_probe(struct usb_interface *intf,
err = ieee80211_register_hw(dev); err = ieee80211_register_hw(dev);
if (err) { if (err) {
printk(KERN_ERR "p54usb: Cannot register netdevice\n"); dev_err(&udev->dev, "(p54usb) Cannot register netdevice\n");
goto err_free_dev; goto err_free_dev;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment