Commit ee8e365a authored by James Ketrenos's avatar James Ketrenos

Ran scripts/Lindent on drivers/net/wireless/ipw2{1,2}00.{c,h}

No other changes.
Signed-off-by: default avatarJames Ketrenos <jketreno@linux.intel.com>
parent d7e02edb
......@@ -174,10 +174,9 @@ that only one external action is invoked at a time.
#define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver"
#define DRV_COPYRIGHT "Copyright(c) 2003-2004 Intel Corporation"
/* Debugging stuff */
#ifdef CONFIG_IPW_DEBUG
#define CONFIG_IPW2100_RX_DEBUG /* Reception debugging */
#define CONFIG_IPW2100_RX_DEBUG /* Reception debugging */
#endif
MODULE_DESCRIPTION(DRV_DESCRIPTION);
......@@ -220,18 +219,18 @@ do { \
} while (0)
#else
#define IPW_DEBUG(level, message...) do {} while (0)
#endif /* CONFIG_IPW_DEBUG */
#endif /* CONFIG_IPW_DEBUG */
#ifdef CONFIG_IPW_DEBUG
static const char *command_types[] = {
"undefined",
"unused", /* HOST_ATTENTION */
"unused", /* HOST_ATTENTION */
"HOST_COMPLETE",
"unused", /* SLEEP */
"unused", /* HOST_POWER_DOWN */
"unused", /* SLEEP */
"unused", /* HOST_POWER_DOWN */
"unused",
"SYSTEM_CONFIG",
"unused", /* SET_IMR */
"unused", /* SET_IMR */
"SSID",
"MANDATORY_BSSID",
"AUTHENTICATION_TYPE",
......@@ -277,17 +276,16 @@ static const char *command_types[] = {
"GROUP_ORDINALS",
"SHORT_RETRY_LIMIT",
"LONG_RETRY_LIMIT",
"unused", /* SAVE_CALIBRATION */
"unused", /* RESTORE_CALIBRATION */
"unused", /* SAVE_CALIBRATION */
"unused", /* RESTORE_CALIBRATION */
"undefined",
"undefined",
"undefined",
"HOST_PRE_POWER_DOWN",
"unused", /* HOST_INTERRUPT_COALESCING */
"unused", /* HOST_INTERRUPT_COALESCING */
"undefined",
"CARD_DISABLE_PHY_OFF",
"MSDU_TX_RATES"
"undefined",
"MSDU_TX_RATES" "undefined",
"undefined",
"SET_STATION_STAT_BITS",
"CLEAR_STATIONS_STAT_BITS",
......@@ -298,7 +296,6 @@ static const char *command_types[] = {
};
#endif
/* Pre-decl until we get the code solid and then we can clean it up */
static void ipw2100_tx_send_commands(struct ipw2100_priv *priv);
static void ipw2100_tx_send_data(struct ipw2100_priv *priv);
......@@ -321,11 +318,10 @@ static void ipw2100_release_firmware(struct ipw2100_priv *priv,
static int ipw2100_ucode_download(struct ipw2100_priv *priv,
struct ipw2100_fw *fw);
static void ipw2100_wx_event_work(struct ipw2100_priv *priv);
static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device * dev);
static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev);
static struct iw_handler_def ipw2100_wx_handler_def;
static inline void read_register(struct net_device *dev, u32 reg, u32 *val)
static inline void read_register(struct net_device *dev, u32 reg, u32 * val)
{
*val = readl((void __iomem *)(dev->base_addr + reg));
IPW_DEBUG_IO("r: 0x%08X => 0x%08X\n", reg, *val);
......@@ -337,13 +333,14 @@ static inline void write_register(struct net_device *dev, u32 reg, u32 val)
IPW_DEBUG_IO("w: 0x%08X <= 0x%08X\n", reg, val);
}
static inline void read_register_word(struct net_device *dev, u32 reg, u16 *val)
static inline void read_register_word(struct net_device *dev, u32 reg,
u16 * val)
{
*val = readw((void __iomem *)(dev->base_addr + reg));
IPW_DEBUG_IO("r: 0x%08X => %04X\n", reg, *val);
}
static inline void read_register_byte(struct net_device *dev, u32 reg, u8 *val)
static inline void read_register_byte(struct net_device *dev, u32 reg, u8 * val)
{
*val = readb((void __iomem *)(dev->base_addr + reg));
IPW_DEBUG_IO("r: 0x%08X => %02X\n", reg, *val);
......@@ -355,14 +352,13 @@ static inline void write_register_word(struct net_device *dev, u32 reg, u16 val)
IPW_DEBUG_IO("w: 0x%08X <= %04X\n", reg, val);
}
static inline void write_register_byte(struct net_device *dev, u32 reg, u8 val)
{
writeb(val, (void __iomem *)(dev->base_addr + reg));
IPW_DEBUG_IO("w: 0x%08X =< %02X\n", reg, val);
}
static inline void read_nic_dword(struct net_device *dev, u32 addr, u32 *val)
static inline void read_nic_dword(struct net_device *dev, u32 addr, u32 * val)
{
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS,
addr & IPW_REG_INDIRECT_ADDR_MASK);
......@@ -376,7 +372,7 @@ static inline void write_nic_dword(struct net_device *dev, u32 addr, u32 val)
write_register(dev, IPW_REG_INDIRECT_ACCESS_DATA, val);
}
static inline void read_nic_word(struct net_device *dev, u32 addr, u16 *val)
static inline void read_nic_word(struct net_device *dev, u32 addr, u16 * val)
{
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS,
addr & IPW_REG_INDIRECT_ADDR_MASK);
......@@ -390,7 +386,7 @@ static inline void write_nic_word(struct net_device *dev, u32 addr, u16 val)
write_register_word(dev, IPW_REG_INDIRECT_ACCESS_DATA, val);
}
static inline void read_nic_byte(struct net_device *dev, u32 addr, u8 *val)
static inline void read_nic_byte(struct net_device *dev, u32 addr, u8 * val)
{
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS,
addr & IPW_REG_INDIRECT_ADDR_MASK);
......@@ -416,7 +412,7 @@ static inline void write_nic_dword_auto_inc(struct net_device *dev, u32 val)
}
static inline void write_nic_memory(struct net_device *dev, u32 addr, u32 len,
const u8 *buf)
const u8 * buf)
{
u32 aligned_addr;
u32 aligned_len;
......@@ -431,32 +427,30 @@ static inline void write_nic_memory(struct net_device *dev, u32 addr, u32 len,
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS,
aligned_addr);
for (i = dif_len; i < 4; i++, buf++)
write_register_byte(
dev, IPW_REG_INDIRECT_ACCESS_DATA + i,
*buf);
write_register_byte(dev,
IPW_REG_INDIRECT_ACCESS_DATA + i,
*buf);
len -= dif_len;
aligned_addr += 4;
}
/* read DWs through autoincrement registers */
write_register(dev, IPW_REG_AUTOINCREMENT_ADDRESS,
aligned_addr);
write_register(dev, IPW_REG_AUTOINCREMENT_ADDRESS, aligned_addr);
aligned_len = len & (~0x3);
for (i = 0; i < aligned_len; i += 4, buf += 4, aligned_addr += 4)
write_register(
dev, IPW_REG_AUTOINCREMENT_DATA, *(u32 *)buf);
write_register(dev, IPW_REG_AUTOINCREMENT_DATA, *(u32 *) buf);
/* copy the last nibble */
dif_len = len - aligned_len;
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS, aligned_addr);
for (i = 0; i < dif_len; i++, buf++)
write_register_byte(
dev, IPW_REG_INDIRECT_ACCESS_DATA + i, *buf);
write_register_byte(dev, IPW_REG_INDIRECT_ACCESS_DATA + i,
*buf);
}
static inline void read_nic_memory(struct net_device *dev, u32 addr, u32 len,
u8 *buf)
u8 * buf)
{
u32 aligned_addr;
u32 aligned_len;
......@@ -471,39 +465,38 @@ static inline void read_nic_memory(struct net_device *dev, u32 addr, u32 len,
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS,
aligned_addr);
for (i = dif_len; i < 4; i++, buf++)
read_register_byte(
dev, IPW_REG_INDIRECT_ACCESS_DATA + i, buf);
read_register_byte(dev,
IPW_REG_INDIRECT_ACCESS_DATA + i,
buf);
len -= dif_len;
aligned_addr += 4;
}
/* read DWs through autoincrement registers */
write_register(dev, IPW_REG_AUTOINCREMENT_ADDRESS,
aligned_addr);
write_register(dev, IPW_REG_AUTOINCREMENT_ADDRESS, aligned_addr);
aligned_len = len & (~0x3);
for (i = 0; i < aligned_len; i += 4, buf += 4, aligned_addr += 4)
read_register(dev, IPW_REG_AUTOINCREMENT_DATA,
(u32 *)buf);
read_register(dev, IPW_REG_AUTOINCREMENT_DATA, (u32 *) buf);
/* copy the last nibble */
dif_len = len - aligned_len;
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS,
aligned_addr);
write_register(dev, IPW_REG_INDIRECT_ACCESS_ADDRESS, aligned_addr);
for (i = 0; i < dif_len; i++, buf++)
read_register_byte(dev, IPW_REG_INDIRECT_ACCESS_DATA +
i, buf);
read_register_byte(dev, IPW_REG_INDIRECT_ACCESS_DATA + i, buf);
}
static inline int ipw2100_hw_is_adapter_in_system(struct net_device *dev)
{
return (dev->base_addr &&
(readl((void __iomem *)(dev->base_addr + IPW_REG_DOA_DEBUG_AREA_START))
(readl
((void __iomem *)(dev->base_addr +
IPW_REG_DOA_DEBUG_AREA_START))
== IPW_DATA_DOA_DEBUG_VALUE));
}
static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
void *val, u32 *len)
void *val, u32 * len)
{
struct ipw2100_ordinals *ordinals = &priv->ordinals;
u32 addr;
......@@ -529,8 +522,8 @@ static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
return -EINVAL;
}
read_nic_dword(priv->net_dev, ordinals->table1_addr + (ord << 2),
&addr);
read_nic_dword(priv->net_dev,
ordinals->table1_addr + (ord << 2), &addr);
read_nic_dword(priv->net_dev, addr, val);
*len = IPW_ORD_TAB_1_ENTRY_SIZE;
......@@ -543,8 +536,8 @@ static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
ord -= IPW_START_ORD_TAB_2;
/* get the address of statistic */
read_nic_dword(priv->net_dev, ordinals->table2_addr + (ord << 3),
&addr);
read_nic_dword(priv->net_dev,
ordinals->table2_addr + (ord << 3), &addr);
/* get the second DW of statistics ;
* two 16-bit words - first is length, second is count */
......@@ -553,10 +546,10 @@ static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
&field_info);
/* get each entry length */
field_len = *((u16 *)&field_info);
field_len = *((u16 *) & field_info);
/* get number of entries */
field_count = *(((u16 *)&field_info) + 1);
field_count = *(((u16 *) & field_info) + 1);
/* abort if no enought memory */
total_length = field_len * field_count;
......@@ -581,8 +574,8 @@ static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
return -EINVAL;
}
static int ipw2100_set_ordinal(struct ipw2100_priv *priv, u32 ord, u32 *val,
u32 *len)
static int ipw2100_set_ordinal(struct ipw2100_priv *priv, u32 ord, u32 * val,
u32 * len)
{
struct ipw2100_ordinals *ordinals = &priv->ordinals;
u32 addr;
......@@ -594,8 +587,8 @@ static int ipw2100_set_ordinal(struct ipw2100_priv *priv, u32 ord, u32 *val,
return -EINVAL;
}
read_nic_dword(priv->net_dev, ordinals->table1_addr + (ord << 2),
&addr);
read_nic_dword(priv->net_dev,
ordinals->table1_addr + (ord << 2), &addr);
write_nic_dword(priv->net_dev, addr, *val);
......@@ -612,7 +605,7 @@ static int ipw2100_set_ordinal(struct ipw2100_priv *priv, u32 ord, u32 *val,
}
static char *snprint_line(char *buf, size_t count,
const u8 *data, u32 len, u32 ofs)
const u8 * data, u32 len, u32 ofs)
{
int out, i, j, l;
char c;
......@@ -646,7 +639,7 @@ static char *snprint_line(char *buf, size_t count,
return buf;
}
static void printk_buf(int level, const u8 *data, u32 len)
static void printk_buf(int level, const u8 * data, u32 len)
{
char line[81];
u32 ofs = 0;
......@@ -662,8 +655,6 @@ static void printk_buf(int level, const u8 *data, u32 len)
}
}
#define MAX_RESET_BACKOFF 10
static inline void schedule_reset(struct ipw2100_priv *priv)
......@@ -703,7 +694,7 @@ static inline void schedule_reset(struct ipw2100_priv *priv)
#define HOST_COMPLETE_TIMEOUT (2 * HZ)
static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
struct host_command * cmd)
struct host_command *cmd)
{
struct list_head *element;
struct ipw2100_tx_packet *packet;
......@@ -713,25 +704,28 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
IPW_DEBUG_HC("Sending %s command (#%d), %d bytes\n",
command_types[cmd->host_command], cmd->host_command,
cmd->host_command_length);
printk_buf(IPW_DL_HC, (u8*)cmd->host_command_parameters,
printk_buf(IPW_DL_HC, (u8 *) cmd->host_command_parameters,
cmd->host_command_length);
spin_lock_irqsave(&priv->low_lock, flags);
if (priv->fatal_error) {
IPW_DEBUG_INFO("Attempt to send command while hardware in fatal error condition.\n");
IPW_DEBUG_INFO
("Attempt to send command while hardware in fatal error condition.\n");
err = -EIO;
goto fail_unlock;
}
if (!(priv->status & STATUS_RUNNING)) {
IPW_DEBUG_INFO("Attempt to send command while hardware is not running.\n");
IPW_DEBUG_INFO
("Attempt to send command while hardware is not running.\n");
err = -EIO;
goto fail_unlock;
}
if (priv->status & STATUS_CMD_ACTIVE) {
IPW_DEBUG_INFO("Attempt to send command while another command is pending.\n");
IPW_DEBUG_INFO
("Attempt to send command while another command is pending.\n");
err = -EBUSY;
goto fail_unlock;
}
......@@ -752,7 +746,8 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
/* initialize the firmware command packet */
packet->info.c_struct.cmd->host_command_reg = cmd->host_command;
packet->info.c_struct.cmd->host_command_reg1 = cmd->host_command1;
packet->info.c_struct.cmd->host_command_len_reg = cmd->host_command_length;
packet->info.c_struct.cmd->host_command_len_reg =
cmd->host_command_length;
packet->info.c_struct.cmd->sequence = cmd->host_command_sequence;
memcpy(packet->info.c_struct.cmd->host_command_params_reg,
......@@ -776,9 +771,11 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
* then there is a problem.
*/
err = wait_event_interruptible_timeout(
priv->wait_command_queue, !(priv->status & STATUS_CMD_ACTIVE),
HOST_COMPLETE_TIMEOUT);
err =
wait_event_interruptible_timeout(priv->wait_command_queue,
!(priv->
status & STATUS_CMD_ACTIVE),
HOST_COMPLETE_TIMEOUT);
if (err == 0) {
IPW_DEBUG_INFO("Command completion failed out after %dms.\n",
......@@ -804,13 +801,12 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
return 0;
fail_unlock:
fail_unlock:
spin_unlock_irqrestore(&priv->low_lock, flags);
return err;
}
/*
* Verify the values and data access of the hardware
* No locks needed or used. No functions called.
......@@ -825,8 +821,7 @@ static int ipw2100_verify(struct ipw2100_priv *priv)
/* Domain 0 check - all values should be DOA_DEBUG */
for (address = IPW_REG_DOA_DEBUG_AREA_START;
address < IPW_REG_DOA_DEBUG_AREA_END;
address += sizeof(u32)) {
address < IPW_REG_DOA_DEBUG_AREA_END; address += sizeof(u32)) {
read_register(priv->net_dev, address, &data1);
if (data1 != IPW_DATA_DOA_DEBUG_VALUE)
return -EIO;
......@@ -898,7 +893,6 @@ static int ipw2100_wait_for_card_state(struct ipw2100_priv *priv, int state)
return -EIO;
}
/*********************************************************************
Procedure : sw_reset_and_clock
Purpose : Asserts s/w reset, asserts clock initialization
......@@ -975,17 +969,16 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
if (priv->fatal_error) {
IPW_DEBUG_ERROR("%s: ipw2100_download_firmware called after "
"fatal error %d. Interface must be brought down.\n",
priv->net_dev->name, priv->fatal_error);
"fatal error %d. Interface must be brought down.\n",
priv->net_dev->name, priv->fatal_error);
return -EINVAL;
}
#ifdef CONFIG_PM
if (!ipw2100_firmware.version) {
err = ipw2100_get_firmware(priv, &ipw2100_firmware);
if (err) {
IPW_DEBUG_ERROR("%s: ipw2100_get_firmware failed: %d\n",
priv->net_dev->name, err);
priv->net_dev->name, err);
priv->fatal_error = IPW2100_ERR_FW_LOAD;
goto fail;
}
......@@ -994,7 +987,7 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
err = ipw2100_get_firmware(priv, &ipw2100_firmware);
if (err) {
IPW_DEBUG_ERROR("%s: ipw2100_get_firmware failed: %d\n",
priv->net_dev->name, err);
priv->net_dev->name, err);
priv->fatal_error = IPW2100_ERR_FW_LOAD;
goto fail;
}
......@@ -1005,21 +998,20 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
err = sw_reset_and_clock(priv);
if (err) {
IPW_DEBUG_ERROR("%s: sw_reset_and_clock failed: %d\n",
priv->net_dev->name, err);
priv->net_dev->name, err);
goto fail;
}
err = ipw2100_verify(priv);
if (err) {
IPW_DEBUG_ERROR("%s: ipw2100_verify failed: %d\n",
priv->net_dev->name, err);
priv->net_dev->name, err);
goto fail;
}
/* Hold ARC */
write_nic_dword(priv->net_dev,
IPW_INTERNAL_REGISTER_HALT_AND_RESET,
0x80000000);
IPW_INTERNAL_REGISTER_HALT_AND_RESET, 0x80000000);
/* allow ARC to run */
write_register(priv->net_dev, IPW_REG_RESET_REG, 0);
......@@ -1034,13 +1026,13 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
/* release ARC */
write_nic_dword(priv->net_dev,
IPW_INTERNAL_REGISTER_HALT_AND_RESET,
0x00000000);
IPW_INTERNAL_REGISTER_HALT_AND_RESET, 0x00000000);
/* s/w reset and clock stabilization (again!!!) */
err = sw_reset_and_clock(priv);
if (err) {
printk(KERN_ERR DRV_NAME ": %s: sw_reset_and_clock failed: %d\n",
printk(KERN_ERR DRV_NAME
": %s: sw_reset_and_clock failed: %d\n",
priv->net_dev->name, err);
goto fail;
}
......@@ -1049,10 +1041,9 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
err = ipw2100_fw_download(priv, &ipw2100_firmware);
if (err) {
IPW_DEBUG_ERROR("%s: Error loading firmware: %d\n",
priv->net_dev->name, err);
priv->net_dev->name, err);
goto fail;
}
#ifndef CONFIG_PM
/*
* When the .resume method of the driver is called, the other
......@@ -1084,7 +1075,7 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
return 0;
fail:
fail:
ipw2100_release_firmware(priv, &ipw2100_firmware);
return err;
}
......@@ -1105,7 +1096,6 @@ static inline void ipw2100_disable_interrupts(struct ipw2100_priv *priv)
write_register(priv->net_dev, IPW_REG_INTA_MASK, 0x0);
}
static void ipw2100_initialize_ordinals(struct ipw2100_priv *priv)
{
struct ipw2100_ordinals *ord = &priv->ordinals;
......@@ -1177,11 +1167,10 @@ static int ipw2100_get_hw_features(struct ipw2100_priv *priv)
* EEPROM_SRAM_DB_START_ADDRESS using ordinal in ordinal table 1
*/
len = sizeof(addr);
if (ipw2100_get_ordinal(
priv, IPW_ORD_EEPROM_SRAM_DB_BLOCK_START_ADDRESS,
&addr, &len)) {
if (ipw2100_get_ordinal
(priv, IPW_ORD_EEPROM_SRAM_DB_BLOCK_START_ADDRESS, &addr, &len)) {
IPW_DEBUG_INFO("failed querying ordinals at line %d\n",
__LINE__);
__LINE__);
return -EIO;
}
......@@ -1194,7 +1183,7 @@ static int ipw2100_get_hw_features(struct ipw2100_priv *priv)
priv->eeprom_version = (val >> 24) & 0xFF;
IPW_DEBUG_INFO("EEPROM version: %d\n", priv->eeprom_version);
/*
/*
* HW RF Kill enable is bit 0 in byte at offset 0x21 in firmware
*
* notice that the EEPROM bit is reverse polarity, i.e.
......@@ -1206,8 +1195,7 @@ static int ipw2100_get_hw_features(struct ipw2100_priv *priv)
priv->hw_features |= HW_FEATURE_RFKILL;
IPW_DEBUG_INFO("HW RF Kill: %ssupported.\n",
(priv->hw_features & HW_FEATURE_RFKILL) ?
"" : "not ");
(priv->hw_features & HW_FEATURE_RFKILL) ? "" : "not ");
return 0;
}
......@@ -1234,7 +1222,8 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
* fw & dino ucode
*/
if (ipw2100_download_firmware(priv)) {
printk(KERN_ERR DRV_NAME ": %s: Failed to power on the adapter.\n",
printk(KERN_ERR DRV_NAME
": %s: Failed to power on the adapter.\n",
priv->net_dev->name);
return -EIO;
}
......@@ -1293,7 +1282,8 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
i ? "SUCCESS" : "FAILED");
if (!i) {
printk(KERN_WARNING DRV_NAME ": %s: Firmware did not initialize.\n",
printk(KERN_WARNING DRV_NAME
": %s: Firmware did not initialize.\n",
priv->net_dev->name);
return -EIO;
}
......@@ -1326,7 +1316,6 @@ static inline void ipw2100_reset_fatalerror(struct ipw2100_priv *priv)
priv->fatal_error = 0;
}
/* NOTE: Our interrupt is disabled when this method is called */
static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv)
{
......@@ -1350,19 +1339,19 @@ static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv)
if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED)
break;
} while(i--);
} while (i--);
priv->status &= ~STATUS_RESET_PENDING;
if (!i) {
IPW_DEBUG_INFO("exit - waited too long for master assert stop\n");
IPW_DEBUG_INFO
("exit - waited too long for master assert stop\n");
return -EIO;
}
write_register(priv->net_dev, IPW_REG_RESET_REG,
IPW_AUX_HOST_RESET_REG_SW_RESET);
/* Reset any fatal_error conditions */
ipw2100_reset_fatalerror(priv);
......@@ -1415,7 +1404,6 @@ static int ipw2100_hw_phy_off(struct ipw2100_priv *priv)
return -EIO;
}
static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
{
struct host_command cmd = {
......@@ -1445,9 +1433,8 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
err = ipw2100_wait_for_card_state(priv, IPW_HW_STATE_ENABLED);
if (err) {
IPW_DEBUG_INFO(
"%s: card not responding to init command.\n",
priv->net_dev->name);
IPW_DEBUG_INFO("%s: card not responding to init command.\n",
priv->net_dev->name);
goto fail_up;
}
......@@ -1456,7 +1443,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
queue_delayed_work(priv->workqueue, &priv->hang_check, HZ / 2);
}
fail_up:
fail_up:
up(&priv->adapter_sem);
return err;
}
......@@ -1488,7 +1475,8 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
err = ipw2100_hw_phy_off(priv);
if (err)
printk(KERN_WARNING DRV_NAME ": Error disabling radio %d\n", err);
printk(KERN_WARNING DRV_NAME
": Error disabling radio %d\n", err);
/*
* If in D0-standby mode going directly to D3 may cause a
......@@ -1566,7 +1554,6 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
return 0;
}
static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
{
struct host_command cmd = {
......@@ -1593,19 +1580,21 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
err = ipw2100_hw_send_command(priv, &cmd);
if (err) {
printk(KERN_WARNING DRV_NAME ": exit - failed to send CARD_DISABLE command\n");
printk(KERN_WARNING DRV_NAME
": exit - failed to send CARD_DISABLE command\n");
goto fail_up;
}
err = ipw2100_wait_for_card_state(priv, IPW_HW_STATE_DISABLED);
if (err) {
printk(KERN_WARNING DRV_NAME ": exit - card failed to change to DISABLED\n");
printk(KERN_WARNING DRV_NAME
": exit - card failed to change to DISABLED\n");
goto fail_up;
}
IPW_DEBUG_INFO("TODO: implement scan state machine\n");
fail_up:
fail_up:
up(&priv->adapter_sem);
return err;
}
......@@ -1709,8 +1698,9 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
(priv->status & STATUS_RESET_PENDING)) {
/* Power cycle the card ... */
if (ipw2100_power_cycle_adapter(priv)) {
printk(KERN_WARNING DRV_NAME ": %s: Could not cycle adapter.\n",
priv->net_dev->name);
printk(KERN_WARNING DRV_NAME
": %s: Could not cycle adapter.\n",
priv->net_dev->name);
rc = 1;
goto exit;
}
......@@ -1719,8 +1709,9 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)