提交 4c897253 编写于 作者: T Tomas Winkler 提交者: John W. Linville

iwlwifi: 3945 remove duplicated code from iwl-3945-commands.h

This patch remove trivial (renames) commands and defines
from iwl-3945-commands.h
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Acked-by: NSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 600c0e11
......@@ -82,11 +82,11 @@ static inline int iwl3945_brightness_to_idx(enum led_brightness brightness)
/* Send led command */
static int iwl_send_led_cmd(struct iwl3945_priv *priv,
struct iwl3945_led_cmd *led_cmd)
struct iwl_led_cmd *led_cmd)
{
struct iwl3945_host_cmd cmd = {
.id = REPLY_LEDS_CMD,
.len = sizeof(struct iwl3945_led_cmd),
.len = sizeof(struct iwl_led_cmd),
.data = led_cmd,
.meta.flags = CMD_ASYNC,
.meta.u.callback = iwl3945_led_cmd_callback,
......@@ -101,7 +101,7 @@ static int iwl_send_led_cmd(struct iwl3945_priv *priv,
static int iwl3945_led_pattern(struct iwl3945_priv *priv, int led_id,
unsigned int idx)
{
struct iwl3945_led_cmd led_cmd = {
struct iwl_led_cmd led_cmd = {
.id = led_id,
.interval = IWL_DEF_LED_INTRVL
};
......@@ -115,11 +115,10 @@ static int iwl3945_led_pattern(struct iwl3945_priv *priv, int led_id,
}
#if 1
/* Set led on command */
static int iwl3945_led_on(struct iwl3945_priv *priv, int led_id)
{
struct iwl3945_led_cmd led_cmd = {
struct iwl_led_cmd led_cmd = {
.id = led_id,
.on = IWL_LED_SOLID,
.off = 0,
......@@ -131,7 +130,7 @@ static int iwl3945_led_on(struct iwl3945_priv *priv, int led_id)
/* Set led off command */
static int iwl3945_led_off(struct iwl3945_priv *priv, int led_id)
{
struct iwl3945_led_cmd led_cmd = {
struct iwl_led_cmd led_cmd = {
.id = led_id,
.on = 0,
.off = 0,
......@@ -140,8 +139,6 @@ static int iwl3945_led_off(struct iwl3945_priv *priv, int led_id)
IWL_DEBUG_LED("led off %d\n", led_id);
return iwl_send_led_cmd(priv, &led_cmd);
}
#endif
/*
* brightness call back function for Tx/Rx LED
......
......@@ -328,18 +328,18 @@ struct iwl3945_cmd_meta {
*/
struct iwl3945_cmd {
struct iwl3945_cmd_meta meta;
struct iwl3945_cmd_header hdr;
struct iwl_cmd_header hdr;
union {
struct iwl3945_addsta_cmd addsta;
struct iwl3945_led_cmd led;
struct iwl_led_cmd led;
u32 flags;
u8 val8;
u16 val16;
u32 val32;
struct iwl3945_bt_cmd bt;
struct iwl_bt_cmd bt;
struct iwl3945_rxon_time_cmd rxon_time;
struct iwl_powertable_cmd powertable;
struct iwl3945_qosparam_cmd qosparam;
struct iwl_qosparam_cmd qosparam;
struct iwl3945_tx_cmd tx;
struct iwl3945_tx_beacon_cmd tx_beacon;
struct iwl3945_rxon_assoc_cmd rxon_assoc;
......@@ -466,7 +466,7 @@ union iwl3945_qos_capabity {
struct iwl3945_qos_info {
int qos_active;
union iwl3945_qos_capabity qos_cap;
struct iwl3945_qosparam_cmd def_qos_parm;
struct iwl_qosparam_cmd def_qos_parm;
};
#define STA_PS_STATUS_WAKE 0
......
......@@ -75,6 +75,12 @@
#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8)
#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF)
/* Tx rates */
#define IWL_CCK_RATES 4
#define IWL_OFDM_RATES 8
#define IWL_MAX_RATES (IWL_CCK_RATES + IWL_OFDM_RATES)
enum {
REPLY_ALIVE = 0x1,
REPLY_ERROR = 0x2,
......@@ -784,6 +790,8 @@ struct iwl_qosparam_cmd {
#define IWL_AP_ID 0
#define IWL_MULTICAST_ID 1
#define IWL_STA_ID 2
#define IWL3945_BROADCAST_ID 24
#define IWL3945_STATION_COUNT 25
#define IWL4965_BROADCAST_ID 31
#define IWL4965_STATION_COUNT 32
#define IWL5000_BROADCAST_ID 15
......@@ -792,6 +800,8 @@ struct iwl_qosparam_cmd {
#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
#define IWL_INVALID_STATION 255
#define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2);
#define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8);
#define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8);
#define STA_FLG_RTS_MIMO_PROT_MSK cpu_to_le32(1 << 17)
#define STA_FLG_AGG_MPDU_8US_MSK cpu_to_le32(1 << 18)
......@@ -2181,6 +2191,7 @@ struct iwl_ssid_ie {
u8 ssid[32];
} __attribute__ ((packed));
#define PROBE_OPTION_MAX_API1 0x4
#define PROBE_OPTION_MAX 0x14
#define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF)
#define IWL_GOOD_CRC_TH cpu_to_le16(1)
......
......@@ -1139,7 +1139,7 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv)
static int iwl3945_send_bt_config(struct iwl3945_priv *priv)
{
struct iwl3945_bt_cmd bt_cmd = {
struct iwl_bt_cmd bt_cmd = {
.flags = 3,
.lead_time = 0xAA,
.max_kill = 1,
......@@ -1148,7 +1148,7 @@ static int iwl3945_send_bt_config(struct iwl3945_priv *priv)
};
return iwl3945_send_cmd_pdu(priv, REPLY_BT_CONFIG,
sizeof(struct iwl3945_bt_cmd), &bt_cmd);
sizeof(bt_cmd), &bt_cmd);
}
static int iwl3945_send_scan_abort(struct iwl3945_priv *priv)
......@@ -1343,7 +1343,8 @@ static int iwl3945_clear_sta_key_info(struct iwl3945_priv *priv, u8 sta_id)
spin_lock_irqsave(&priv->sta_lock, flags);
memset(&priv->stations[sta_id].keyinfo, 0, sizeof(struct iwl3945_hw_key));
memset(&priv->stations[sta_id].sta.key, 0, sizeof(struct iwl3945_keyinfo));
memset(&priv->stations[sta_id].sta.key, 0,
sizeof(struct iwl4965_keyinfo));
priv->stations[sta_id].sta.key.key_flags = STA_KEY_FLG_NO_ENC;
priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
......@@ -1672,11 +1673,11 @@ static u16 iwl3945_fill_probe_req(struct iwl3945_priv *priv,
* QoS support
*/
static int iwl3945_send_qos_params_command(struct iwl3945_priv *priv,
struct iwl3945_qosparam_cmd *qos)
struct iwl_qosparam_cmd *qos)
{
return iwl3945_send_cmd_pdu(priv, REPLY_QOS_PARAM,
sizeof(struct iwl3945_qosparam_cmd), qos);
sizeof(struct iwl_qosparam_cmd), qos);
}
static void iwl3945_reset_qos(struct iwl3945_priv *priv)
......@@ -2581,7 +2582,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
* We'll tell device about this padding later.
*/
len = priv->hw_setting.tx_cmd_len +
sizeof(struct iwl3945_cmd_header) + hdr_len;
sizeof(struct iwl_cmd_header) + hdr_len;
len_org = len;
len = (len + 3) & ~3;
......@@ -3110,8 +3111,8 @@ static void iwl3945_rx_reply_scan(struct iwl3945_priv *priv,
{
#ifdef CONFIG_IWL3945_DEBUG
struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data;
struct iwl3945_scanreq_notification *notif =
(struct iwl3945_scanreq_notification *)pkt->u.raw;
struct iwl_scanreq_notification *notif =
(struct iwl_scanreq_notification *)pkt->u.raw;
IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status);
#endif
......@@ -3122,8 +3123,8 @@ static void iwl3945_rx_scan_start_notif(struct iwl3945_priv *priv,
struct iwl3945_rx_mem_buffer *rxb)
{
struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data;
struct iwl3945_scanstart_notification *notif =
(struct iwl3945_scanstart_notification *)pkt->u.raw;
struct iwl_scanstart_notification *notif =
(struct iwl_scanstart_notification *)pkt->u.raw;
priv->scan_start_tsf = le32_to_cpu(notif->tsf_low);
IWL_DEBUG_SCAN("Scan start: "
"%d [802.11%s] "
......@@ -3139,8 +3140,8 @@ static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv,
struct iwl3945_rx_mem_buffer *rxb)
{
struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data;
struct iwl3945_scanresults_notification *notif =
(struct iwl3945_scanresults_notification *)pkt->u.raw;
struct iwl_scanresults_notification *notif =
(struct iwl_scanresults_notification *)pkt->u.raw;
IWL_DEBUG_SCAN("Scan ch.res: "
"%d [802.11%s] "
......@@ -3164,7 +3165,7 @@ static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv,
struct iwl3945_rx_mem_buffer *rxb)
{
struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data;
struct iwl3945_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
IWL_DEBUG_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
scan_notif->scanned_channels,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册