Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
2e9ff56e
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2e9ff56e
编写于
3月 20, 2006
作者:
J
Jeff Garzik
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream' of
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
上级
d378aca6
cc8279f6
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
415 addition
and
375 deletion
+415
-375
Documentation/networking/README.ipw2100
Documentation/networking/README.ipw2100
+6
-6
Documentation/networking/README.ipw2200
Documentation/networking/README.ipw2200
+42
-2
drivers/net/wireless/ipw2100.c
drivers/net/wireless/ipw2100.c
+147
-73
drivers/net/wireless/ipw2100.h
drivers/net/wireless/ipw2100.h
+8
-3
drivers/net/wireless/ipw2200.c
drivers/net/wireless/ipw2200.c
+188
-262
drivers/net/wireless/ipw2200.h
drivers/net/wireless/ipw2200.h
+11
-28
net/ieee80211/ieee80211_rx.c
net/ieee80211/ieee80211_rx.c
+13
-1
未找到文件。
Documentation/networking/README.ipw2100
浏览文件 @
2e9ff56e
...
...
@@ -3,18 +3,18 @@ Intel(R) PRO/Wireless 2100 Driver for Linux in support of:
Intel(R) PRO/Wireless 2100 Network Connection
Copyright (C) 2003-200
5
, Intel Corporation
Copyright (C) 2003-200
6
, Intel Corporation
README.ipw2100
Version:
1.1.3
Date :
October 17, 2005
Version:
git-1.1.5
Date :
January 25, 2006
Index
-----------------------------------------------
0. IMPORTANT INFORMATION BEFORE USING THIS DRIVER
1. Introduction
2. Release
1.1.3
Current Features
2. Release
git-1.1.5
Current Features
3. Command Line Parameters
4. Sysfs Helper Files
5. Radio Kill Switch
...
...
@@ -89,7 +89,7 @@ potential fixes and patches, as well as links to the development mailing list
for the driver project.
2. Release
1.1.3
Current Supported Features
2. Release
git-1.1.5
Current Supported Features
-----------------------------------------------
- Managed (BSS) and Ad-Hoc (IBSS)
- WEP (shared key and open)
...
...
@@ -270,7 +270,7 @@ For installation support on the ipw2100 1.1.0 driver on Linux kernels
9. License
-----------------------------------------------
Copyright(c) 2003 - 200
5
Intel Corporation. All rights reserved.
Copyright(c) 2003 - 200
6
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License (version 2) as
...
...
Documentation/networking/README.ipw2200
浏览文件 @
2e9ff56e
...
...
@@ -10,7 +10,7 @@ both hardware adapters listed above. In this document the Intel(R)
PRO/Wireless 2915ABG Driver for Linux will be used to reference the
unified driver.
Copyright (C) 2004-200
5
, Intel Corporation
Copyright (C) 2004-200
6
, Intel Corporation
README.ipw2200
...
...
@@ -26,9 +26,11 @@ Index
1.2. Module parameters
1.3. Wireless Extension Private Methods
1.4. Sysfs Helper Files
1.5. Supported channels
2. Ad-Hoc Networking
3. Interacting with Wireless Tools
3.1. iwconfig mode
3.2. iwconfig sens
4. About the Version Numbers
5. Firmware installation
6. Support
...
...
@@ -314,6 +316,35 @@ For the device level files, see /sys/bus/pci/drivers/ipw2200:
running ifconfig and is therefore disabled by default.
1.5. Supported channels
-----------------------------------------------
Upon loading the Intel(R) PRO/Wireless 2915ABG Driver for Linux, a
message stating the detected geography code and the number of 802.11
channels supported by the card will be displayed in the log.
The geography code corresponds to a regulatory domain as shown in the
table below.
Supported channels
Code Geography 802.11bg 802.11a
--- Restricted 11 0
ZZF Custom US/Canada 11 8
ZZD Rest of World 13 0
ZZA Custom USA & Europe & High 11 13
ZZB Custom NA & Europe 11 13
ZZC Custom Japan 11 4
ZZM Custom 11 0
ZZE Europe 13 19
ZZJ Custom Japan 14 4
ZZR Rest of World 14 0
ZZH High Band 13 4
ZZG Custom Europe 13 4
ZZK Europe 13 24
ZZL Europe 11 13
2. Ad-Hoc Networking
-----------------------------------------------
...
...
@@ -353,6 +384,15 @@ When configuring the mode of the adapter, all run-time configured parameters
are reset to the value used when the module was loaded. This includes
channels, rates, ESSID, etc.
3.2 iwconfig sens
-----------------------------------------------
The 'iwconfig ethX sens XX' command will not set the signal sensitivity
threshold, as described in iwconfig documentation, but rather the number
of consecutive missed beacons that will trigger handover, i.e. roaming
to another access point. At the same time, it will set the disassociation
threshold to 3 times the given value.
4. About the Version Numbers
-----------------------------------------------
...
...
@@ -408,7 +448,7 @@ For general information and support, go to:
7. License
-----------------------------------------------
Copyright(c) 2003 - 200
5
Intel Corporation. All rights reserved.
Copyright(c) 2003 - 200
6
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as
...
...
drivers/net/wireless/ipw2100.c
浏览文件 @
2e9ff56e
/******************************************************************************
Copyright(c) 2003 - 200
5
Intel Corporation. All rights reserved.
Copyright(c) 2003 - 200
6
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
...
...
@@ -167,12 +167,12 @@ that only one external action is invoked at a time.
#include "ipw2100.h"
#define IPW2100_VERSION "git-1.
1.4
"
#define IPW2100_VERSION "git-1.
2.2
"
#define DRV_NAME "ipw2100"
#define DRV_VERSION IPW2100_VERSION
#define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver"
#define DRV_COPYRIGHT "Copyright(c) 2003-200
5
Intel Corporation"
#define DRV_COPYRIGHT "Copyright(c) 2003-200
6
Intel Corporation"
/* Debugging stuff */
#ifdef CONFIG_IPW2100_DEBUG
...
...
@@ -1418,7 +1418,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
if
(
priv
->
status
&
STATUS_ENABLED
)
return
0
;
down
(
&
priv
->
adapter_sem
);
mutex_lock
(
&
priv
->
adapter_mutex
);
if
(
rf_kill_active
(
priv
))
{
IPW_DEBUG_HC
(
"Command aborted due to RF kill active.
\n
"
);
...
...
@@ -1444,7 +1444,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
}
fail_up:
up
(
&
priv
->
adapter_sem
);
mutex_unlock
(
&
priv
->
adapter_mutex
);
return
err
;
}
...
...
@@ -1576,7 +1576,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
cancel_delayed_work
(
&
priv
->
hang_check
);
}
down
(
&
priv
->
adapter_sem
);
mutex_lock
(
&
priv
->
adapter_mutex
);
err
=
ipw2100_hw_send_command
(
priv
,
&
cmd
);
if
(
err
)
{
...
...
@@ -1595,7 +1595,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
IPW_DEBUG_INFO
(
"TODO: implement scan state machine
\n
"
);
fail_up:
up
(
&
priv
->
adapter_sem
);
mutex_unlock
(
&
priv
->
adapter_mutex
);
return
err
;
}
...
...
@@ -1888,7 +1888,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
priv
->
status
|=
STATUS_RESET_PENDING
;
spin_unlock_irqrestore
(
&
priv
->
low_lock
,
flags
);
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
/* stop timed checks so that they don't interfere with reset */
priv
->
stop_hang_check
=
1
;
cancel_delayed_work
(
&
priv
->
hang_check
);
...
...
@@ -1898,7 +1898,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
wireless_send_event
(
priv
->
net_dev
,
SIOCGIWAP
,
&
wrqu
,
NULL
);
ipw2100_up
(
priv
,
0
);
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
}
...
...
@@ -2390,15 +2390,6 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
IPW_DEBUG_DROP
(
"Dropping packet while interface is not up.
\n
"
);
return
;
}
#ifdef CONFIG_IPW2100_MONITOR
if
(
unlikely
(
priv
->
ieee
->
iw_mode
==
IW_MODE_MONITOR
&&
priv
->
config
&
CFG_CRC_CHECK
&&
status
->
flags
&
IPW_STATUS_FLAG_CRC_ERROR
))
{
IPW_DEBUG_RX
(
"CRC error in packet. Dropping.
\n
"
);
priv
->
ieee
->
stats
.
rx_errors
++
;
return
;
}
#endif
if
(
unlikely
(
priv
->
ieee
->
iw_mode
!=
IW_MODE_MONITOR
&&
!
(
priv
->
status
&
STATUS_ASSOCIATED
)))
{
...
...
@@ -2446,6 +2437,89 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
priv
->
rx_queue
.
drv
[
i
].
host_addr
=
packet
->
dma_addr
;
}
#ifdef CONFIG_IPW2100_MONITOR
static
void
isr_rx_monitor
(
struct
ipw2100_priv
*
priv
,
int
i
,
struct
ieee80211_rx_stats
*
stats
)
{
struct
ipw2100_status
*
status
=
&
priv
->
status_queue
.
drv
[
i
];
struct
ipw2100_rx_packet
*
packet
=
&
priv
->
rx_buffers
[
i
];
/* Magic struct that slots into the radiotap header -- no reason
* to build this manually element by element, we can write it much
* more efficiently than we can parse it. ORDER MATTERS HERE */
struct
ipw_rt_hdr
{
struct
ieee80211_radiotap_header
rt_hdr
;
s8
rt_dbmsignal
;
/* signal in dbM, kluged to signed */
}
*
ipw_rt
;
IPW_DEBUG_RX
(
"Handler...
\n
"
);
if
(
unlikely
(
status
->
frame_size
>
skb_tailroom
(
packet
->
skb
)
-
sizeof
(
struct
ipw_rt_hdr
)))
{
IPW_DEBUG_INFO
(
"%s: frame_size (%u) > skb_tailroom (%u)!"
" Dropping.
\n
"
,
priv
->
net_dev
->
name
,
status
->
frame_size
,
skb_tailroom
(
packet
->
skb
));
priv
->
ieee
->
stats
.
rx_errors
++
;
return
;
}
if
(
unlikely
(
!
netif_running
(
priv
->
net_dev
)))
{
priv
->
ieee
->
stats
.
rx_errors
++
;
priv
->
wstats
.
discard
.
misc
++
;
IPW_DEBUG_DROP
(
"Dropping packet while interface is not up.
\n
"
);
return
;
}
if
(
unlikely
(
priv
->
config
&
CFG_CRC_CHECK
&&
status
->
flags
&
IPW_STATUS_FLAG_CRC_ERROR
))
{
IPW_DEBUG_RX
(
"CRC error in packet. Dropping.
\n
"
);
priv
->
ieee
->
stats
.
rx_errors
++
;
return
;
}
pci_unmap_single
(
priv
->
pci_dev
,
packet
->
dma_addr
,
sizeof
(
struct
ipw2100_rx
),
PCI_DMA_FROMDEVICE
);
memmove
(
packet
->
skb
->
data
+
sizeof
(
struct
ipw_rt_hdr
),
packet
->
skb
->
data
,
status
->
frame_size
);
ipw_rt
=
(
struct
ipw_rt_hdr
*
)
packet
->
skb
->
data
;
ipw_rt
->
rt_hdr
.
it_version
=
PKTHDR_RADIOTAP_VERSION
;
ipw_rt
->
rt_hdr
.
it_pad
=
0
;
/* always good to zero */
ipw_rt
->
rt_hdr
.
it_len
=
sizeof
(
struct
ipw_rt_hdr
);
/* total hdr+data */
ipw_rt
->
rt_hdr
.
it_present
=
1
<<
IEEE80211_RADIOTAP_DBM_ANTSIGNAL
;
ipw_rt
->
rt_dbmsignal
=
status
->
rssi
+
IPW2100_RSSI_TO_DBM
;
skb_put
(
packet
->
skb
,
status
->
frame_size
+
sizeof
(
struct
ipw_rt_hdr
));
if
(
!
ieee80211_rx
(
priv
->
ieee
,
packet
->
skb
,
stats
))
{
priv
->
ieee
->
stats
.
rx_errors
++
;
/* ieee80211_rx failed, so it didn't free the SKB */
dev_kfree_skb_any
(
packet
->
skb
);
packet
->
skb
=
NULL
;
}
/* We need to allocate a new SKB and attach it to the RDB. */
if
(
unlikely
(
ipw2100_alloc_skb
(
priv
,
packet
)))
{
IPW_DEBUG_WARNING
(
"%s: Unable to allocate SKB onto RBD ring - disabling "
"adapter.
\n
"
,
priv
->
net_dev
->
name
);
/* TODO: schedule adapter shutdown */
IPW_DEBUG_INFO
(
"TODO: Shutdown adapter...
\n
"
);
}
/* Update the RDB entry */
priv
->
rx_queue
.
drv
[
i
].
host_addr
=
packet
->
dma_addr
;
}
#endif
static
int
ipw2100_corruption_check
(
struct
ipw2100_priv
*
priv
,
int
i
)
{
struct
ipw2100_status
*
status
=
&
priv
->
status_queue
.
drv
[
i
];
...
...
@@ -2577,7 +2651,7 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv)
case
P8023_DATA_VAL
:
#ifdef CONFIG_IPW2100_MONITOR
if
(
priv
->
ieee
->
iw_mode
==
IW_MODE_MONITOR
)
{
isr_rx
(
priv
,
i
,
&
stats
);
isr_rx
_monitor
(
priv
,
i
,
&
stats
);
break
;
}
#endif
...
...
@@ -3882,7 +3956,7 @@ static int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode)
#ifdef CONFIG_IPW2100_MONITOR
case
IW_MODE_MONITOR
:
priv
->
last_mode
=
priv
->
ieee
->
iw_mode
;
priv
->
net_dev
->
type
=
ARPHRD_IEEE80211
;
priv
->
net_dev
->
type
=
ARPHRD_IEEE80211
_RADIOTAP
;
break
;
#endif
/* CONFIG_IPW2100_MONITOR */
}
...
...
@@ -4138,7 +4212,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
IPW_DEBUG_RF_KILL
(
"Manual SW RF Kill set to: RADIO %s
\n
"
,
disable_radio
?
"OFF"
:
"ON"
);
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
disable_radio
)
{
priv
->
status
|=
STATUS_RF_KILL_SW
;
...
...
@@ -4156,7 +4230,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
schedule_reset
(
priv
);
}
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
1
;
}
...
...
@@ -5460,7 +5534,7 @@ static void shim__set_security(struct net_device *dev,
struct
ipw2100_priv
*
priv
=
ieee80211_priv
(
dev
);
int
i
,
force_update
=
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
goto
done
;
...
...
@@ -5533,7 +5607,7 @@ static void shim__set_security(struct net_device *dev,
if
(
!
(
priv
->
status
&
(
STATUS_ASSOCIATED
|
STATUS_ASSOCIATING
)))
ipw2100_configure_security
(
priv
,
0
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
}
static
int
ipw2100_adapter_setup
(
struct
ipw2100_priv
*
priv
)
...
...
@@ -5657,7 +5731,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
if
(
!
is_valid_ether_addr
(
addr
->
sa_data
))
return
-
EADDRNOTAVAIL
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
priv
->
config
|=
CFG_CUSTOM_MAC
;
memcpy
(
priv
->
mac_addr
,
addr
->
sa_data
,
ETH_ALEN
);
...
...
@@ -5667,12 +5741,12 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
goto
done
;
priv
->
reset_backoff
=
0
;
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
ipw2100_reset_adapter
(
priv
);
return
0
;
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -6015,8 +6089,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
strcpy
(
priv
->
nick
,
"ipw2100"
);
spin_lock_init
(
&
priv
->
low_lock
);
sema_init
(
&
priv
->
action_sem
,
1
);
sema_init
(
&
priv
->
adapter_sem
,
1
);
mutex_init
(
&
priv
->
action_mutex
);
mutex_init
(
&
priv
->
adapter_mutex
);
init_waitqueue_head
(
&
priv
->
wait_command_queue
);
...
...
@@ -6181,7 +6255,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
* member to call a function that then just turns and calls ipw2100_up.
* net_dev->init is called after name allocation but before the
* notifier chain is called */
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
err
=
register_netdev
(
dev
);
if
(
err
)
{
printk
(
KERN_WARNING
DRV_NAME
...
...
@@ -6217,12 +6291,12 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
priv
->
status
|=
STATUS_INITIALIZED
;
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
0
;
fail_unlock:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
fail:
if
(
dev
)
{
...
...
@@ -6262,7 +6336,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
struct
net_device
*
dev
;
if
(
priv
)
{
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
priv
->
status
&=
~
STATUS_INITIALIZED
;
...
...
@@ -6277,9 +6351,9 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
/* Take down the hardware */
ipw2100_down
(
priv
);
/* Release the
semaphore
so that the network subsystem can
/* Release the
mutex
so that the network subsystem can
* complete any needed calls into the driver... */
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
/* Unregister the device first - this results in close()
* being called if the device is open. If we free storage
...
...
@@ -6318,7 +6392,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
IPW_DEBUG_INFO
(
"%s: Going into suspend...
\n
"
,
dev
->
name
);
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
priv
->
status
&
STATUS_INITIALIZED
)
{
/* Take down the device; powers it off, etc. */
ipw2100_down
(
priv
);
...
...
@@ -6331,7 +6405,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
pci_disable_device
(
pci_dev
);
pci_set_power_state
(
pci_dev
,
PCI_D3hot
);
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
0
;
}
...
...
@@ -6345,7 +6419,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
if
(
IPW2100_PM_DISABLED
)
return
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
IPW_DEBUG_INFO
(
"%s: Coming out of suspend...
\n
"
,
dev
->
name
);
...
...
@@ -6371,7 +6445,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
if
(
!
(
priv
->
status
&
STATUS_RF_KILL_SW
))
ipw2100_up
(
priv
,
0
);
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
0
;
}
...
...
@@ -6535,7 +6609,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
if
(
priv
->
ieee
->
iw_mode
==
IW_MODE_INFRA
)
return
-
EOPNOTSUPP
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -6566,7 +6640,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
}
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -6607,7 +6681,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
if
(
wrqu
->
mode
==
priv
->
ieee
->
iw_mode
)
return
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -6630,7 +6704,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
}
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -6812,7 +6886,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
if
(
wrqu
->
ap_addr
.
sa_family
!=
ARPHRD_ETHER
)
return
-
EINVAL
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -6841,7 +6915,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
wrqu
->
ap_addr
.
sa_data
[
5
]
&
0xff
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -6877,7 +6951,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
int
length
=
0
;
int
err
=
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -6914,7 +6988,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
err
=
ipw2100_set_essid
(
priv
,
essid
,
length
,
0
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -6995,7 +7069,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
u32
rate
;
int
err
=
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7022,7 +7096,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
IPW_DEBUG_WX
(
"SET Rate -> %04X
\n
"
,
rate
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7042,7 +7116,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
return
0
;
}
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7074,7 +7148,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
IPW_DEBUG_WX
(
"GET Rate -> %d
\n
"
,
wrqu
->
bitrate
.
value
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7089,7 +7163,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
if
(
wrqu
->
rts
.
fixed
==
0
)
return
-
EINVAL
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7109,7 +7183,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
IPW_DEBUG_WX
(
"SET RTS Threshold -> 0x%08X
\n
"
,
value
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7160,7 +7234,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
value
=
wrqu
->
txpower
.
value
;
}
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7171,7 +7245,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
IPW_DEBUG_WX
(
"SET TX Power -> %d
\n
"
,
value
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7263,7 +7337,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
if
(
!
(
wrqu
->
retry
.
flags
&
IW_RETRY_LIMIT
))
return
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7290,7 +7364,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
IPW_DEBUG_WX
(
"SET Both Retry Limits -> %d
\n
"
,
wrqu
->
retry
.
value
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7333,7 +7407,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
struct
ipw2100_priv
*
priv
=
ieee80211_priv
(
dev
);
int
err
=
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7348,7 +7422,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
}
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7398,7 +7472,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
struct
ipw2100_priv
*
priv
=
ieee80211_priv
(
dev
);
int
err
=
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7431,7 +7505,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
IPW_DEBUG_WX
(
"SET Power Management Mode -> 0x%02X
\n
"
,
priv
->
power_mode
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7735,7 +7809,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
int
enable
=
(
parms
[
0
]
>
0
);
int
err
=
0
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7753,7 +7827,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
err
=
ipw2100_switch_mode
(
priv
,
priv
->
last_mode
);
}
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7776,7 +7850,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
struct
ipw2100_priv
*
priv
=
ieee80211_priv
(
dev
);
int
err
=
0
,
mode
=
*
(
int
*
)
extra
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7788,7 +7862,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
if
(
priv
->
power_mode
!=
mode
)
err
=
ipw2100_set_power_mode
(
priv
,
mode
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7840,7 +7914,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
struct
ipw2100_priv
*
priv
=
ieee80211_priv
(
dev
);
int
err
,
mode
=
*
(
int
*
)
extra
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7858,7 +7932,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
err
=
ipw2100_system_config
(
priv
,
0
);
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -7888,7 +7962,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
struct
ipw2100_priv
*
priv
=
ieee80211_priv
(
dev
);
int
err
,
mode
=
*
(
int
*
)
extra
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
if
(
!
(
priv
->
status
&
STATUS_INITIALIZED
))
{
err
=
-
EIO
;
goto
done
;
...
...
@@ -7905,7 +7979,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
err
=
0
;
done:
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
return
err
;
}
...
...
@@ -8210,11 +8284,11 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
if
(
priv
->
status
&
STATUS_STOPPING
)
return
;
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
IPW_DEBUG_WX
(
"enter
\n
"
);
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
wrqu
.
ap_addr
.
sa_family
=
ARPHRD_ETHER
;
...
...
@@ -8237,7 +8311,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
if
(
!
(
priv
->
status
&
STATUS_ASSOCIATED
))
{
IPW_DEBUG_WX
(
"Configuring ESSID
\n
"
);
down
(
&
priv
->
action_sem
);
mutex_lock
(
&
priv
->
action_mutex
);
/* This is a disassociation event, so kick the firmware to
* look for another AP */
if
(
priv
->
config
&
CFG_STATIC_ESSID
)
...
...
@@ -8245,7 +8319,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
0
);
else
ipw2100_set_essid
(
priv
,
NULL
,
0
,
0
);
up
(
&
priv
->
action_sem
);
mutex_unlock
(
&
priv
->
action_mutex
);
}
wireless_send_event
(
priv
->
net_dev
,
SIOCGIWAP
,
&
wrqu
,
NULL
);
...
...
drivers/net/wireless/ipw2100.h
浏览文件 @
2e9ff56e
/******************************************************************************
Copyright(c) 2003 - 200
4
Intel Corporation. All rights reserved.
Copyright(c) 2003 - 200
6
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
...
...
@@ -41,7 +41,12 @@
#include <net/ieee80211.h>
#ifdef CONFIG_IPW2100_MONITOR
#include <net/ieee80211_radiotap.h>
#endif
#include <linux/workqueue.h>
#include <linux/mutex.h>
struct
ipw2100_priv
;
struct
ipw2100_tx_packet
;
...
...
@@ -590,8 +595,8 @@ struct ipw2100_priv {
int
inta_other
;
spinlock_t
low_lock
;
struct
semaphore
action_sem
;
struct
semaphore
adapter_sem
;
struct
mutex
action_mutex
;
struct
mutex
adapter_mutex
;
wait_queue_head_t
wait_command_queue
;
};
...
...
drivers/net/wireless/ipw2200.c
浏览文件 @
2e9ff56e
此差异已折叠。
点击以展开。
drivers/net/wireless/ipw2200.h
浏览文件 @
2e9ff56e
/******************************************************************************
Copyright(c) 2003 - 200
5
Intel Corporation. All rights reserved.
Copyright(c) 2003 - 200
6
Intel Corporation. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
...
...
@@ -246,8 +246,10 @@ enum connection_manager_assoc_states {
#define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED 31
#define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1
#define IPW_MB_
DISASSOCIATE_THRESHOLD_DEFAULT 24
#define IPW_MB_
ROAMING_THRESHOLD_MIN 1
#define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8
#define IPW_MB_ROAMING_THRESHOLD_MAX 30
#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT 3*IPW_MB_ROAMING_THRESHOLD_DEFAULT
#define IPW_REAL_RATE_RX_PACKET_THRESHOLD 300
#define MACADRR_BYTE_LEN 6
...
...
@@ -618,13 +620,16 @@ struct notif_tgi_tx_key {
u8
reserved
;
}
__attribute__
((
packed
));
#define SILENCE_OVER_THRESH (1)
#define SILENCE_UNDER_THRESH (2)
struct
notif_link_deterioration
{
struct
ipw_cmd_stats
stats
;
u8
rate
;
u8
modulation
;
struct
rate_histogram
histogram
;
u8
reserved1
;
u16
reserved2
;
u8
silence_notification_type
;
/* SILENCE_OVER/UNDER_THRESH */
u16
silence_count
;
}
__attribute__
((
packed
));
struct
notif_association
{
...
...
@@ -782,7 +787,7 @@ struct ipw_sys_config {
u8
enable_cts_to_self
;
u8
enable_multicast_filtering
;
u8
bt_coexist_collision_thr
;
u8
reserved2
;
u8
silence_threshold
;
u8
accept_all_mgmt_bcpr
;
u8
accept_all_mgtm_frames
;
u8
pass_noise_stats_to_host
;
...
...
@@ -1892,6 +1897,7 @@ struct ipw_cmd_log {
#define CFG_SYS_ANTENNA_BOTH 0x00
/* NIC selects best antenna */
#define CFG_SYS_ANTENNA_A 0x01
/* force antenna A */
#define CFG_SYS_ANTENNA_B 0x03
/* force antenna B */
#define CFG_SYS_ANTENNA_SLOW_DIV 0x02
/* consider background noise */
/*
* The definitions below were lifted off the ipw2100 driver, which only
...
...
@@ -1907,27 +1913,4 @@ struct ipw_cmd_log {
#define IPW_MAX_CONFIG_RETRIES 10
static
inline
u32
frame_hdr_len
(
struct
ieee80211_hdr_4addr
*
hdr
)
{
u32
retval
;
u16
fc
;
retval
=
sizeof
(
struct
ieee80211_hdr_3addr
);
fc
=
le16_to_cpu
(
hdr
->
frame_ctl
);
/*
* Function ToDS FromDS
* IBSS 0 0
* To AP 1 0
* From AP 0 1
* WDS (bridge) 1 1
*
* Only WDS frames use Address4 among them. --YZ
*/
if
(
!
(
fc
&
IEEE80211_FCTL_TODS
)
||
!
(
fc
&
IEEE80211_FCTL_FROMDS
))
retval
-=
ETH_ALEN
;
return
retval
;
}
#endif
/* __ipw2200_h__ */
net/ieee80211/ieee80211_rx.c
浏览文件 @
2e9ff56e
...
...
@@ -1345,7 +1345,19 @@ static void update_network(struct ieee80211_network *dst,
ieee80211_network_reset
(
dst
);
dst
->
ibss_dfs
=
src
->
ibss_dfs
;
memcpy
(
&
dst
->
stats
,
&
src
->
stats
,
sizeof
(
struct
ieee80211_rx_stats
));
/* We only update the statistics if they were created by receiving
* the network information on the actual channel the network is on.
*
* This keeps beacons received on neighbor channels from bringing
* down the signal level of an AP. */
if
(
dst
->
channel
==
src
->
stats
.
received_channel
)
memcpy
(
&
dst
->
stats
,
&
src
->
stats
,
sizeof
(
struct
ieee80211_rx_stats
));
else
IEEE80211_DEBUG_SCAN
(
"Network "
MAC_FMT
" info received "
"off channel (%d vs. %d)
\n
"
,
MAC_ARG
(
src
->
bssid
),
dst
->
channel
,
src
->
stats
.
received_channel
);
dst
->
capability
=
src
->
capability
;
memcpy
(
dst
->
rates
,
src
->
rates
,
src
->
rates_len
);
dst
->
rates_len
=
src
->
rates_len
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录