Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170901
b: refs/heads/master
c: 3414fc3
h: refs/heads/master
i:
  170899: eaeccaf
v: v3
  • Loading branch information
David Kilroy authored and John W. Linville committed Oct 27, 2009
1 parent 27efa63 commit 6a9e4e3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6226811f4eec35c509b931ac900ac074336103f5
refs/heads/master: 3414fc3f527ce74cfca543c37bcb52c8e63b915e
33 changes: 24 additions & 9 deletions trunk/drivers/net/wireless/orinoco/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ static inline fwtype_t determine_firmware_type(struct comp_id *nic_id)
/* Set priv->firmware type, determine firmware properties
* This function can be called before we have registerred with netdev,
* so all errors go out with dev_* rather than printk
*
* If non-NULL stores a firmware description in fw_name.
* If non-NULL stores a HW version in hw_ver
*
* These are output via generic cfg80211 ethtool support.
*/
int determine_fw_capabilities(struct orinoco_private *priv)
int determine_fw_capabilities(struct orinoco_private *priv,
char *fw_name, size_t fw_name_len,
u32 *hw_ver)
{
struct device *dev = priv->dev;
hermes_t *hw = &priv->hw;
Expand All @@ -85,6 +92,12 @@ int determine_fw_capabilities(struct orinoco_private *priv)
dev_info(dev, "Hardware identity %04x:%04x:%04x:%04x\n",
nic_id.id, nic_id.variant, nic_id.major, nic_id.minor);

if (hw_ver)
*hw_ver = (((nic_id.id & 0xff) << 24) |
((nic_id.variant & 0xff) << 16) |
((nic_id.major & 0xff) << 8) |
(nic_id.minor & 0xff));

priv->firmware_type = determine_firmware_type(&nic_id);

/* Get the firmware version */
Expand Down Expand Up @@ -135,8 +148,9 @@ int determine_fw_capabilities(struct orinoco_private *priv)
case FIRMWARE_TYPE_AGERE:
/* Lucent Wavelan IEEE, Lucent Orinoco, Cabletron RoamAbout,
ELSA, Melco, HP, IBM, Dell 1150, Compaq 110/210 */
snprintf(priv->fw_name, sizeof(priv->fw_name) - 1,
"Lucent/Agere %d.%02d", sta_id.major, sta_id.minor);
if (fw_name)
snprintf(fw_name, fw_name_len, "Lucent/Agere %d.%02d",
sta_id.major, sta_id.minor);

firmver = ((unsigned long)sta_id.major << 16) | sta_id.minor;

Expand Down Expand Up @@ -185,8 +199,8 @@ int determine_fw_capabilities(struct orinoco_private *priv)
tmp[SYMBOL_MAX_VER_LEN] = '\0';
}

snprintf(priv->fw_name, sizeof(priv->fw_name) - 1,
"Symbol %s", tmp);
if (fw_name)
snprintf(fw_name, fw_name_len, "Symbol %s", tmp);

priv->has_ibss = (firmver >= 0x20000);
priv->has_wep = (firmver >= 0x15012);
Expand Down Expand Up @@ -224,9 +238,9 @@ int determine_fw_capabilities(struct orinoco_private *priv)
* different and less well tested */
/* D-Link MAC : 00:40:05:* */
/* Addtron MAC : 00:90:D1:* */
snprintf(priv->fw_name, sizeof(priv->fw_name) - 1,
"Intersil %d.%d.%d", sta_id.major, sta_id.minor,
sta_id.variant);
if (fw_name)
snprintf(fw_name, fw_name_len, "Intersil %d.%d.%d",
sta_id.major, sta_id.minor, sta_id.variant);

firmver = ((unsigned long)sta_id.major << 16) |
((unsigned long)sta_id.minor << 8) | sta_id.variant;
Expand All @@ -245,7 +259,8 @@ int determine_fw_capabilities(struct orinoco_private *priv)
}
break;
}
dev_info(dev, "Firmware determined as %s\n", priv->fw_name);
if (fw_name)
dev_info(dev, "Firmware determined as %s\n", fw_name);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/orinoco/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
struct orinoco_private;
struct dev_addr_list;

int determine_fw_capabilities(struct orinoco_private *priv);
int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name,
size_t fw_name_len, u32 *hw_ver);
int orinoco_hw_read_card_settings(struct orinoco_private *priv, u8 *dev_addr);
int orinoco_hw_allocate_fid(struct orinoco_private *priv);
int orinoco_get_bitratemode(int bitrate, int automatic);
Expand Down
33 changes: 6 additions & 27 deletions trunk/drivers/net/wireless/orinoco/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
#include <linux/device.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/suspend.h>
#include <linux/if_arp.h>
#include <linux/wireless.h>
Expand Down Expand Up @@ -162,8 +161,6 @@ static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
| HERMES_EV_WTERR | HERMES_EV_INFO \
| HERMES_EV_INFDROP)

static const struct ethtool_ops orinoco_ethtool_ops;

/********************************************************************/
/* Data types */
/********************************************************************/
Expand Down Expand Up @@ -1994,7 +1991,9 @@ int orinoco_init(struct orinoco_private *priv)
goto out;
}

err = determine_fw_capabilities(priv);
err = determine_fw_capabilities(priv, wiphy->fw_version,
sizeof(wiphy->fw_version),
&wiphy->hw_version);
if (err != 0) {
dev_err(dev, "Incompatible firmware, aborting\n");
goto out;
Expand All @@ -2010,7 +2009,9 @@ int orinoco_init(struct orinoco_private *priv)
priv->do_fw_download = 0;

/* Check firmware version again */
err = determine_fw_capabilities(priv);
err = determine_fw_capabilities(priv, wiphy->fw_version,
sizeof(wiphy->fw_version),
&wiphy->hw_version);
if (err != 0) {
dev_err(dev, "Incompatible firmware, aborting\n");
goto out;
Expand Down Expand Up @@ -2212,7 +2213,6 @@ int orinoco_if_add(struct orinoco_private *priv,
dev->ieee80211_ptr = wdev;
dev->netdev_ops = &orinoco_netdev_ops;
dev->watchdog_timeo = HZ; /* 1 second timeout */
dev->ethtool_ops = &orinoco_ethtool_ops;
dev->wireless_handlers = &orinoco_handler_def;
#ifdef WIRELESS_SPY
dev->wireless_data = &priv->wireless_data;
Expand Down Expand Up @@ -2349,27 +2349,6 @@ void orinoco_down(struct orinoco_private *priv)
}
EXPORT_SYMBOL(orinoco_down);

static void orinoco_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct orinoco_private *priv = ndev_priv(dev);

strncpy(info->driver, DRIVER_NAME, sizeof(info->driver) - 1);
strncpy(info->version, DRIVER_VERSION, sizeof(info->version) - 1);
strncpy(info->fw_version, priv->fw_name, sizeof(info->fw_version) - 1);
if (dev->dev.parent)
strncpy(info->bus_info, dev_name(dev->dev.parent),
sizeof(info->bus_info) - 1);
else
snprintf(info->bus_info, sizeof(info->bus_info) - 1,
"PCMCIA %p", priv->hw.iobase);
}

static const struct ethtool_ops orinoco_ethtool_ops = {
.get_drvinfo = orinoco_get_drvinfo,
.get_link = ethtool_op_get_link,
};

/********************************************************************/
/* Module initialization */
/********************************************************************/
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/orinoco/orinoco.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ struct orinoco_private {

/* Capabilities of the hardware/firmware */
fwtype_t firmware_type;
char fw_name[32];
int ibss_port;
int nicbuf_size;
u16 channel_mask;
Expand Down

0 comments on commit 6a9e4e3

Please sign in to comment.