Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102452
b: refs/heads/master
c: 5da4b55
h: refs/heads/master
v: v3
  • Loading branch information
Mohamed Abbas authored and John W. Linville committed May 7, 2008
1 parent c85425b commit 3791dd5
Show file tree
Hide file tree
Showing 10 changed files with 544 additions and 227 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: 7eafd25d9559bd0f652449c222d38d63412e3d4a
refs/heads/master: 5da4b55f78fb2ed40926b775d4f7c791594ecbd7
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlwifi/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-$(CONFIG_IWLCORE) += iwlcore.o
iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o
iwlcore-objs := iwl-core.o iwl-eeprom.o iwl-hcmd.o iwl-power.o
iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
iwlcore-$(CONFIG_IWLWIFI_LEDS) += iwl-led.o
iwlcore-$(CONFIG_IWLWIFI_RFKILL) += iwl-rfkill.o
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ struct iwl4965_spectrum_notification {
#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le16(1 << 0)
#define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le16(1 << 2)
#define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le16(1 << 3)
#define IWL_POWER_FAST_PD __constant_cpu_to_le16(1 << 4)

struct iwl4965_powertable_cmd {
__le16 flags;
Expand Down
15 changes: 13 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,6 @@ int iwl4965_hw_nic_init(struct iwl_priv *priv)
u32 val;
u8 val_link;

iwl4965_power_init_handle(priv);

/* nic_init */
spin_lock_irqsave(&priv->lock, flags);

Expand Down Expand Up @@ -1433,6 +1431,17 @@ int iwl4965_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl4965_tx_queue *txq)
return 0;
}

/* set card power command */
static int iwl4965_set_power(struct iwl_priv *priv,
void *cmd)
{
int ret = 0;

ret = iwl_send_cmd_pdu_async(priv, POWER_TABLE_CMD,
sizeof(struct iwl4965_powertable_cmd),
cmd, NULL);
return ret;
}
int iwl4965_hw_reg_set_txpower(struct iwl_priv *priv, s8 power)
{
IWL_ERROR("TODO: Implement iwl4965_hw_reg_set_txpower!\n");
Expand Down Expand Up @@ -4336,6 +4345,8 @@ static struct iwl_lib_ops iwl4965_lib = {
.release_semaphore = iwlcore_eeprom_release_semaphore,
},
.radio_kill_sw = iwl4965_radio_kill_sw,
.set_power = iwl4965_set_power,
.update_chain_flags = iwl4965_update_chain_flags,
};

static struct iwl_ops iwl4965_ops = {
Expand Down
29 changes: 3 additions & 26 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "iwl-prph.h"
#include "iwl-debug.h"
#include "iwl-led.h"
#include "iwl-power.h"

/* configuration for the iwl4965 */
extern struct iwl_cfg iwl4965_agn_cfg;
Expand Down Expand Up @@ -257,31 +258,6 @@ enum iwl_pwr_src {
IWL_PWR_SRC_VAUX,
};

struct iwl4965_power_vec_entry {
struct iwl4965_powertable_cmd cmd;
u8 no_dtim;
};
#define IWL_POWER_RANGE_0 (0)
#define IWL_POWER_RANGE_1 (1)

#define IWL_POWER_MODE_CAM 0x00 /* Continuously Aware Mode, always on */
#define IWL_POWER_INDEX_3 0x03
#define IWL_POWER_INDEX_5 0x05
#define IWL_POWER_AC 0x06
#define IWL_POWER_BATTERY 0x07
#define IWL_POWER_LIMIT 0x07
#define IWL_POWER_MASK 0x0F
#define IWL_POWER_ENABLED 0x10
#define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK)

struct iwl4965_power_mgr {
spinlock_t lock;
struct iwl4965_power_vec_entry pwr_range_0[IWL_POWER_AC];
struct iwl4965_power_vec_entry pwr_range_1[IWL_POWER_AC];
u8 active_index;
u32 dtim_val;
};

#define IEEE80211_DATA_LEN 2304
#define IEEE80211_4ADDR_LEN 30
#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
Expand Down Expand Up @@ -674,6 +650,7 @@ extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
extern int iwl4965_rx_queue_update_write_ptr(struct iwl_priv *priv,
struct iwl4965_rx_queue *q);
extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr);
extern void iwl4965_update_chain_flags(struct iwl_priv *priv);
int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src);

int iwl4965_init_geos(struct iwl_priv *priv);
Expand Down Expand Up @@ -1100,7 +1077,7 @@ struct iwl_priv {
u64 bytes;
} tx_stats[3], rx_stats[3];

struct iwl4965_power_mgr power_data;
struct iwl_power_mgr power_data;

struct iwl4965_notif_statistics statistics;
unsigned long last_statistics_time;
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct iwl_priv; /* FIXME: remove */
#include "iwl-4965.h" /* FIXME: remove */
#include "iwl-core.h"
#include "iwl-rfkill.h"
#include "iwl-power.h"


MODULE_DESCRIPTION("iwl core");
Expand Down Expand Up @@ -263,8 +264,10 @@ int iwlcore_low_level_notify(struct iwl_priv *priv,
if (ret)
IWL_ERROR("Unable to initialize RFKILL system. "
"Ignoring error: %d\n", ret);
iwl_power_initialize(priv);
break;
case IWLCORE_START_EVT:
iwl_power_update_mode(priv, 1);
break;
case IWLCORE_STOP_EVT:
break;
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ struct iwl_lib_ops {
struct {
int (*set_pwr_src)(struct iwl_priv *priv, enum iwl_pwr_src src);
} apm_ops;
/* power */
int (*set_power)(struct iwl_priv *priv, void *cmd);
void (*update_chain_flags)(struct iwl_priv *priv);
/* eeprom operations (as defined in iwl-eeprom.h) */
struct iwl_eeprom_ops eeprom_ops;
};
Expand Down
Loading

0 comments on commit 3791dd5

Please sign in to comment.