* Re: [PATCH] ath9k_htc: fix panic on packet injection using airbase-ng tool.
From: Luis R. Rodriguez @ 2010-08-11 15:41 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: linville, linux-wireless, stable
In-Reply-To: <1281538663-14475-1-git-send-email-rmanoharan@atheros.com>
On Wed, Aug 11, 2010 at 7:57 AM, Rajkumar Manoharan
<rmanoharan@atheros.com> wrote:
> This should fix the oops which occurs during the packet injection
> on monitor interface.
>
> EIP is at ath9k_htc_tx_start+0x69/0x220 [ath9k_htc]
> [<f84dc8ea>] ? invoke_tx_handlers+0xa5a/0xee0 [mac80211]
> [<f82c84f4>] ? ath9k_htc_tx+0x44/0xe0 [ath9k_htc]
> [<f84db7b8>] ? __ieee80211_tx+0xf8/0x190 [mac80211]
> [<f84dce0d>] ? ieee80211_tx+0x9d/0x1a0 [mac80211]
> [<f84dcfac>] ? ieee80211_xmit+0x9c/0x1c0 [mac80211]
> [<f84dd1b5>] ? ieee80211_monitor_start_xmit+0x85/0xb0 [mac80211]
> [<c04c30cd>] ? dev_hard_start_xmit+0x1ad/0x210
> [<c04b97c2>] ? __alloc_skb+0x52/0x130
> [<c04d7cd5>] ? sch_direct_xmit+0x105/0x170
> [<c04c5e9f>] ? dev_queue_xmit+0x37f/0x4b0
> [<c0567e1e>] ? packet_snd+0x21e/0x250
> [<c05684a2>] ? packet_sendmsg+0x32/0x40
> [<c04b4c63>] ? sock_aio_write+0x113/0x130
> [<c0207934>] ? do_sync_write+0xc4/0x100
> [<c0167740>] ? autoremove_wake_function+0x0/0x50
> [<c02f4414>] ? security_file_permission+0x14/0x20
> [<c0207ad4>] ? rw_verify_area+0x64/0xe0
> [<c01e6458>] ? handle_mm_fault+0x338/0x390
> [<c0207cd5>] ? vfs_write+0x185/0x1a0
> [<c058db20>] ? do_page_fault+0x160/0x3a0
> [<c0208512>] ? sys_write+0x42/0x70
> [<c01033ec>] ? syscall_call+0x7/0xb
>
> Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Nice, you cc'd stable on the e-mail but did not add it to the commit
log. If you add it to the commit log once Linus pulls this patch in to
his tree then the stable@kernel.org list will be e-mailed notifying
them of this and then the stable team can apply the patch to stable.
John mind pegging the commit log entry, this time around?
Luis
> ---
> drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 15 ++++++++++-----
> 1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> index bd0b4ac..2a6e45a 100644
> --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> @@ -78,18 +78,23 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
> struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
> struct ieee80211_sta *sta = tx_info->control.sta;
> struct ath9k_htc_sta *ista;
> - struct ath9k_htc_vif *avp;
> struct ath9k_htc_tx_ctl tx_ctl;
> enum htc_endpoint_id epid;
> u16 qnum;
> __le16 fc;
> u8 *tx_fhdr;
> - u8 sta_idx;
> + u8 sta_idx, vif_idx;
>
> hdr = (struct ieee80211_hdr *) skb->data;
> fc = hdr->frame_control;
>
> - avp = (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv;
> + if (tx_info->control.vif &&
> + (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv)
> + vif_idx = ((struct ath9k_htc_vif *)
> + tx_info->control.vif->drv_priv)->index;
> + else
> + vif_idx = priv->nvifs;
> +
> if (sta) {
> ista = (struct ath9k_htc_sta *) sta->drv_priv;
> sta_idx = ista->index;
> @@ -106,7 +111,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
> memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr));
>
> tx_hdr.node_idx = sta_idx;
> - tx_hdr.vif_idx = avp->index;
> + tx_hdr.vif_idx = vif_idx;
>
> if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
> tx_ctl.type = ATH9K_HTC_AMPDU;
> @@ -169,7 +174,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
> tx_ctl.type = ATH9K_HTC_NORMAL;
>
> mgmt_hdr.node_idx = sta_idx;
> - mgmt_hdr.vif_idx = avp->index;
> + mgmt_hdr.vif_idx = vif_idx;
> mgmt_hdr.tidno = 0;
> mgmt_hdr.flags = 0;
>
> --
> 1.7.2.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH v3 8/9] omap: hsmmc: split mmc23 power control
From: Ohad Ben-Cohen @ 2010-08-11 16:01 UTC (permalink / raw)
To: Adrian Hunter
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita Vikram, Kalle Valo
In-Reply-To: <4C6275F3.6030108@nokia.com>
On Wed, Aug 11, 2010 at 1:05 PM, Adrian Hunter <adrian.hunter@nokia.com> wrote:
> Ohad Ben-Cohen wrote:
>>
>> Prepare for mmc3 regulator power control by splitting the power
>> control functions of mmc2 and mmc3, and expecting mmc3 to have
>> a single, dedicated, regulator support.
>
> Why? Can't the controller be connected to an eMMC with 2 power
> supplies? At a glance, it is not obvious why this patch is needed.
I had ZOOM too much in mind when I did that. Removed now, thanks !
^ permalink raw reply
* loss in ath9k not reported?
From: George Nychis @ 2010-08-11 16:56 UTC (permalink / raw)
To: linux-wireless
I am trying to track down the cause of loss in the ath9k driver, and
the loss rates I see at higher layers (e.g., an iperf throughput
test), and what kind of losses are reported in the driver is
inconsistent.
For example, I enable debugging and I see over 1000 packet losses in
iperf and through another low level sequence numbering mechanism I
inserted in the driver, but when checking
"/sys/kernel/debug/ath9k/phy1/recv" ... i see that it only reports 32
CRC errors, and 1 PHY error.
So then I decided to try adding kernel debug statements in
net/mac80211/rx.c in should_drop_frame() and and any check on the
rx_status for CRC error or PHY error. This is done in the code via
if(status->flag & RX_FLAG_FAILED_FCS_CRC) or FX_FLAG_FAILED_PLCP_CRC.
However, never do I see any pieces of this code triggered, despite
there being loss on the wireless link.
Then I checked a little higher up in the ath9k driver:
drivers//net/wireless/ath/ath9k/recv.c. In ath9k_rx_accept() I check
rx_stats->rs_status against ATH9K_RXERR_CRC and ATH9K_RXERR_PHY.
Again, neither seem to be set in correlation with losses I see on the
wireless link. But for there to be an error of this type, the MAC
layer must push up packets with these errors, from what I understand.
If the MAC is doing these checks and dropping, they will not get here.
This is why I started checking for the errors at the MAC.
I know that there are losses on the wireless link, as I am inserting
sequence numbers at driver level and am noticing missing ACKs at the
transmitter.
Is there a critical piece of code I am not finding which is removing
these frames in error before I check them?
Thanks for any help, and please CC me if you respond to the list since
I am not subscribed. I would appreciate it.
- George
^ permalink raw reply
* [PATCH (for some future time)] drivers/net: Convert unbounded kzalloc calls to kcalloc
From: Joe Perches @ 2010-08-11 17:02 UTC (permalink / raw)
To: netdev, linux-wireless; +Cc: linux-kernel
These changes may be slightly safer in some instances.
There are other kzalloc calls with a multiply, but those
calls are typically "small fixed #" * sizeof(some pointer)"
and those are not converted.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/cnic.c | 2 +-
drivers/net/ehea/ehea_main.c | 4 ++--
drivers/net/mlx4/alloc.c | 2 +-
drivers/net/mlx4/en_rx.c | 2 +-
drivers/net/mlx4/profile.c | 2 +-
drivers/net/myri10ge/myri10ge.c | 4 ++--
drivers/net/niu.c | 4 ++--
drivers/net/vxge/vxge-main.c | 10 +++++-----
drivers/net/wireless/airo.c | 5 ++---
drivers/net/wireless/b43/phy_n.c | 2 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 6 +++---
drivers/net/wireless/ipw2x00/ipw2200.c | 12 ++++++------
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500usb.c | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00queue.c | 4 ++--
drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
drivers/net/wireless/rt2x00/rt73usb.c | 2 +-
drivers/net/wireless/wl12xx/wl1271_scan.c | 2 +-
21 files changed, 37 insertions(+), 38 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 0961032..2ab6a7c 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -1022,7 +1022,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev)
if (blks > cp->ethdev->ctx_tbl_len)
return -ENOMEM;
- cp->ctx_arr = kzalloc(blks * sizeof(struct cnic_ctx), GFP_KERNEL);
+ cp->ctx_arr = kcalloc(blks, sizeof(struct cnic_ctx), GFP_KERNEL);
if (cp->ctx_arr == NULL)
return -ENOMEM;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 3beba70..455d101 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -180,7 +180,7 @@ static void ehea_update_firmware_handles(void)
num_portres * EHEA_NUM_PORTRES_FW_HANDLES;
if (num_fw_handles) {
- arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL);
+ arr = kcalloc(num_fw_handles, sizeof(*arr), GFP_KERNEL);
if (!arr)
goto out; /* Keep the existing array */
} else
@@ -265,7 +265,7 @@ static void ehea_update_bcmc_registrations(void)
}
if (num_registrations) {
- arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC);
+ arr = kcalloc(num_registrations, sizeof(*arr), GFP_ATOMIC);
if (!arr)
goto out; /* Keep the existing array */
} else
diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
index 8c85156..537997f 100644
--- a/drivers/net/mlx4/alloc.c
+++ b/drivers/net/mlx4/alloc.c
@@ -188,7 +188,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE;
buf->npages = buf->nbufs;
buf->page_shift = PAGE_SHIFT;
- buf->page_list = kzalloc(buf->nbufs * sizeof *buf->page_list,
+ buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list),
GFP_KERNEL);
if (!buf->page_list)
return -ENOMEM;
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 8e2fcb7..efc3fad 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -322,7 +322,7 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
ring->lro.ip_summed_aggr = CHECKSUM_UNNECESSARY;
ring->lro.max_desc = mdev->profile.num_lro;
ring->lro.max_aggr = MAX_SKB_FRAGS;
- ring->lro.lro_arr = kzalloc(mdev->profile.num_lro *
+ ring->lro.lro_arr = kcalloc(mdev->profile.num_lro,
sizeof(struct net_lro_desc),
GFP_KERNEL);
if (!ring->lro.lro_arr) {
diff --git a/drivers/net/mlx4/profile.c b/drivers/net/mlx4/profile.c
index 5caf011..e749f82 100644
--- a/drivers/net/mlx4/profile.c
+++ b/drivers/net/mlx4/profile.c
@@ -85,7 +85,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
struct mlx4_resource tmp;
int i, j;
- profile = kzalloc(MLX4_RES_NUM * sizeof *profile, GFP_KERNEL);
+ profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL);
if (!profile)
return -ENOMEM;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index d771d16..323fbc1 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -3729,8 +3729,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
* slices. We give up on MSI-X if we can only get a single
* vector. */
- mgp->msix_vectors = kzalloc(mgp->num_slices *
- sizeof(*mgp->msix_vectors), GFP_KERNEL);
+ mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
+ GFP_KERNEL);
if (mgp->msix_vectors == NULL)
goto disable_msix;
for (i = 0; i < mgp->num_slices; i++) {
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index b9b9508..fc58f9c 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -4507,7 +4507,7 @@ static int niu_alloc_channels(struct niu *np)
np->dev->real_num_tx_queues = np->num_tx_rings;
- np->rx_rings = kzalloc(np->num_rx_rings * sizeof(struct rx_ring_info),
+ np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info),
GFP_KERNEL);
err = -ENOMEM;
if (!np->rx_rings)
@@ -4541,7 +4541,7 @@ static int niu_alloc_channels(struct niu *np)
return err;
}
- np->tx_rings = kzalloc(np->num_tx_rings * sizeof(struct tx_ring_info),
+ np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info),
GFP_KERNEL);
err = -ENOMEM;
if (!np->tx_rings)
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index c7c5605..f5334b2 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -2159,8 +2159,8 @@ start:
/* Alarm MSIX Vectors count */
vdev->intr_cnt++;
- vdev->entries = kzalloc(vdev->intr_cnt * sizeof(struct msix_entry),
- GFP_KERNEL);
+ vdev->entries = kcalloc(vdev->intr_cnt, sizeof(struct msix_entry),
+ GFP_KERNEL);
if (!vdev->entries) {
vxge_debug_init(VXGE_ERR,
"%s: memory allocation failed",
@@ -2169,9 +2169,9 @@ start:
goto alloc_entries_failed;
}
- vdev->vxge_entries =
- kzalloc(vdev->intr_cnt * sizeof(struct vxge_msix_entry),
- GFP_KERNEL);
+ vdev->vxge_entries = kcalloc(vdev->intr_cnt,
+ sizeof(struct vxge_msix_entry),
+ GFP_KERNEL);
if (!vdev->vxge_entries) {
vxge_debug_init(VXGE_ERR, "%s: memory allocation failed",
VXGE_DRIVER_NAME);
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 1d05445..7d26506 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2723,9 +2723,8 @@ static int airo_networks_allocate(struct airo_info *ai)
if (ai->networks)
return 0;
- ai->networks =
- kzalloc(AIRO_MAX_NETWORK_COUNT * sizeof(BSSListElement),
- GFP_KERNEL);
+ ai->networks = kcalloc(AIRO_MAX_NETWORK_COUNT, sizeof(BSSListElement),
+ GFP_KERNEL);
if (!ai->networks) {
airo_print_warn("", "Out of memory allocating beacons");
return -ENOMEM;
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 5a72570..e288c55 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1182,7 +1182,7 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
len = bw << 1;
}
- samples = kzalloc(len * sizeof(struct b43_c32), GFP_KERNEL);
+ samples = kcalloc(len, sizeof(struct b43_c32), GFP_KERNEL);
if (!samples) {
b43err(dev->wl, "allocation for samples generation failed\n");
return 0;
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index c24c5ef..2e07f1e 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1921,9 +1921,9 @@ static int ipw2100_net_init(struct net_device *dev)
bg_band->band = IEEE80211_BAND_2GHZ;
bg_band->n_channels = geo->bg_channels;
- bg_band->channels =
- kzalloc(geo->bg_channels *
- sizeof(struct ieee80211_channel), GFP_KERNEL);
+ bg_band->channels = kcalloc(geo->bg_channels,
+ sizeof(struct ieee80211_channel),
+ GFP_KERNEL);
/* translate geo->bg to bg_band.channels */
for (i = 0; i < geo->bg_channels; i++) {
bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index cb2552a..0f25083 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11467,9 +11467,9 @@ static int ipw_net_init(struct net_device *dev)
bg_band->band = IEEE80211_BAND_2GHZ;
bg_band->n_channels = geo->bg_channels;
- bg_band->channels =
- kzalloc(geo->bg_channels *
- sizeof(struct ieee80211_channel), GFP_KERNEL);
+ bg_band->channels = kcalloc(geo->bg_channels,
+ sizeof(struct ieee80211_channel),
+ GFP_KERNEL);
/* translate geo->bg to bg_band.channels */
for (i = 0; i < geo->bg_channels; i++) {
bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
@@ -11502,9 +11502,9 @@ static int ipw_net_init(struct net_device *dev)
a_band->band = IEEE80211_BAND_5GHZ;
a_band->n_channels = geo->a_channels;
- a_band->channels =
- kzalloc(geo->a_channels *
- sizeof(struct ieee80211_channel), GFP_KERNEL);
+ a_band->channels = kcalloc(geo->a_channels,
+ sizeof(struct ieee80211_channel),
+ GFP_KERNEL);
/* translate geo->bg to a_band.channels */
for (i = 0; i < geo->a_channels; i++) {
a_band->channels[i].band = IEEE80211_BAND_2GHZ;
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 5063e01..8e3fbdf 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1481,7 +1481,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index c2a555d..1d174e4 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1795,7 +1795,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index cdaf93f..8ddaae4 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1698,7 +1698,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index b66e0fd..8c00fbd 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2865,7 +2865,7 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index b0498e7..2d018ce 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -333,7 +333,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
if (*offset)
return 0;
- data = kzalloc(lines * MAX_LINE_LENGTH, GFP_KERNEL);
+ data = kcalloc(lines, MAX_LINE_LENGTH, GFP_KERNEL);
if (!data)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index a3401d3..9c609be 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -755,7 +755,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
* Allocate all queue entries.
*/
entry_size = sizeof(*entries) + qdesc->priv_size;
- entries = kzalloc(queue->limit * entry_size, GFP_KERNEL);
+ entries = kcalloc(queue->limit, entry_size, GFP_KERNEL);
if (!entries)
return -ENOMEM;
@@ -891,7 +891,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
*/
rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim;
- queue = kzalloc(rt2x00dev->data_queues * sizeof(*queue), GFP_KERNEL);
+ queue = kcalloc(rt2x00dev->data_queues, sizeof(*queue), GFP_KERNEL);
if (!queue) {
ERROR(rt2x00dev, "Queue allocation failed.\n");
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index e539c6c..f226582 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2654,7 +2654,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index aa9de18..99985a2 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2084,7 +2084,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c
index fec43ee..30dc100 100644
--- a/drivers/net/wireless/wl12xx/wl1271_scan.c
+++ b/drivers/net/wireless/wl12xx/wl1271_scan.c
@@ -248,7 +248,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
wl->scan.req = req;
- wl->scan.scanned_ch = kzalloc(req->n_channels *
+ wl->scan.scanned_ch = kcalloc(req->n_channels,
sizeof(*wl->scan.scanned_ch),
GFP_KERNEL);
wl1271_scan_stm(wl);
^ permalink raw reply related
* Re: ath5k : Channel 149 thru 161 not working with compat-wireless-2.6.34.1
From: Bob Copeland @ 2010-08-11 17:31 UTC (permalink / raw)
To: Gopal Raman; +Cc: linux-wireless
In-Reply-To: <loom.20100810T035826-791@post.gmane.org>
On Mon, Aug 9, 2010 at 9:59 PM, Gopal Raman <graman@arubanetworks.com> wrote:
> Can someone confirm that they can see frames in channels 149 thru 161 ? If the
> driver works on these channels, it must be something to do with my h/w
It could also have to do with your regulatory domain -- check that as well.
I only have one 5ghz device, so I can't say whether it works for me or not.
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* [PATCH] staging/wlan-ng: Explicitly set some fields in cfg80211 interface
From: Karl Relton @ 2010-08-11 17:16 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, linux-wireless
Greg
Now that the wlan-ng driver has been switched to cfg80211 in mainline,
can this small patch be forwarded also, to catch up with some new fields
that have gone into the cfg80211 api also in this cycle.
Thanks
Karl
Explicitly set some fields in cfg80211 interface
Signed-off-by: Karl Relton <karllinuxtest.relton@ntlworld.com>
---
The cfg80211 api has introduced a few new fields. Rather than assume
what cfg80211 api does by default, set these explicitly.
--- a/drivers/staging/wlan-ng/cfg80211.c 2010-08-11 18:04:27.000000000
+0100
+++ b/drivers/staging/wlan-ng/cfg80211.c 2010-07-07 10:17:27.000000000
+0100
@@ -214,6 +214,7 @@ int prism2_get_key(struct wiphy *wiphy,
} else return -ENOENT;
params.key_len = len;
params.key = wlandev->wep_keys[key_index];
+ params.seq_len = 0;
callback(cookie, ¶ms);
return 0;
@@ -709,6 +710,8 @@ struct wiphy *wlan_create_wiphy(struct d
priv->band.n_channels = ARRAY_SIZE(prism2_channels);
priv->band.bitrates = priv->rates;
priv->band.n_bitrates = ARRAY_SIZE(prism2_rates);
+ priv->band.band = IEEE80211_BAND_2GHZ;
+ priv->band.ht_cap.ht_supported = false;
wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band;
set_wiphy_dev(wiphy, dev);
^ permalink raw reply
* Re: [ath9k-devel] Multiple interfaces with one card
From: Bob Copeland @ 2010-08-11 17:56 UTC (permalink / raw)
To: Hakan Coskun
Cc: Luis R. Rodriguez, ath9k-devel@lists.ath9k.org, linux-wireless
In-Reply-To: <9A3B6D8B-F99D-4822-9680-121FCC710AB9@cs.tu-berlin.de>
On Fri, Aug 6, 2010 at 2:59 PM, Hakan Coskun <coskun@cs.tu-berlin.de> wrote:
> thank you for your really quick reply. We are already using wireless-testing for our development. The ath9k extensions will be commited soon. At the moment, we are using the eclipse to index the code and walk through the files. This is working quite good. But how can we see during runtime, what is happening. Should we use something like kgdb to trace the operation or what is your approach you take for development. Can you give us any hints ?
>
IMHO the best way to do this is a combination of mac80211 tracepoints and
ftrace, the function tracer, via trace-cmd. Something like:
# trace-cmd record -p function -l ieee\* -e mac80211 sleep 300
...should get you five minutes worth of useful traces. Of course command can
be anything you like.
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* [PATCH v4 0/8] native support for wl1271 on ZOOM
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
This patch series adds native support for wl1271 on ZOOM.
Changes since v3:
- slot is marked nonremovable
- no explicit slot ocr mask
- dont split hsmmc mmc23 power control
Patches are based on linux-next (as of Aug 7th), and tested
on ZOOM2.
Please note that I am going to have a very limited email access
in the next three weeks, so I might not respond right away.
Thanks,
Ohad Ben-Cohen (8):
wireless: wl1271: make wl12xx.h common to both spi and sdio
wireless: wl1271: support return value for the set power func
wireless: wl1271: add platform driver to get board data
wireless: wl1271: take irq info from private board data
wireless: wl1271: make ref_clock configurable by board
omap: hsmmc: remove unused variable
omap: zoom: add fixed regulator device for wlan
omap: zoom: add mmc3/wl1271 device support
arch/arm/mach-omap2/board-zoom-peripherals.c | 69 +++++++++++++++
drivers/mmc/host/omap_hsmmc.c | 1 -
drivers/net/wireless/wl12xx/wl1251_sdio.c | 2 +-
drivers/net/wireless/wl12xx/wl1251_spi.c | 2 +-
drivers/net/wireless/wl12xx/wl1271.h | 15 +++-
drivers/net/wireless/wl12xx/wl1271_boot.c | 9 +-
drivers/net/wireless/wl12xx/wl1271_boot.h | 1 -
drivers/net/wireless/wl12xx/wl1271_io.h | 8 +-
drivers/net/wireless/wl12xx/wl1271_main.c | 4 +-
drivers/net/wireless/wl12xx/wl1271_sdio.c | 120 +++++++++++++++++++++++---
drivers/net/wireless/wl12xx/wl1271_spi.c | 8 ++-
include/linux/spi/wl12xx.h | 34 -------
include/linux/wl12xx.h | 35 ++++++++
13 files changed, 245 insertions(+), 63 deletions(-)
delete mode 100644 include/linux/spi/wl12xx.h
create mode 100644 include/linux/wl12xx.h
^ permalink raw reply
* [PATCH v4 1/8] wireless: wl1271: make wl12xx.h common to both spi and sdio
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
Move wl12xx.h outside of the spi-specific location,
so it can be shared with both spi and sdio solutions.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/net/wireless/wl12xx/wl1251_sdio.c | 2 +-
drivers/net/wireless/wl12xx/wl1251_spi.c | 2 +-
drivers/net/wireless/wl12xx/wl1271_spi.c | 2 +-
include/linux/spi/wl12xx.h | 34 -----------------------------
include/linux/wl12xx.h | 34 +++++++++++++++++++++++++++++
5 files changed, 37 insertions(+), 37 deletions(-)
delete mode 100644 include/linux/spi/wl12xx.h
create mode 100644 include/linux/wl12xx.h
diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c
index b901b61..a319df1 100644
--- a/drivers/net/wireless/wl12xx/wl1251_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c
@@ -24,7 +24,7 @@
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/platform_device.h>
-#include <linux/spi/wl12xx.h>
+#include <linux/wl12xx.h>
#include <linux/irq.h>
#include "wl1251.h"
diff --git a/drivers/net/wireless/wl12xx/wl1251_spi.c b/drivers/net/wireless/wl12xx/wl1251_spi.c
index 27fdfaa..a6faf3e 100644
--- a/drivers/net/wireless/wl12xx/wl1251_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1251_spi.c
@@ -26,7 +26,7 @@
#include <linux/slab.h>
#include <linux/crc7.h>
#include <linux/spi/spi.h>
-#include <linux/spi/wl12xx.h>
+#include <linux/wl12xx.h>
#include "wl1251.h"
#include "wl1251_reg.h"
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c
index 4cb99c5..c3fdab7 100644
--- a/drivers/net/wireless/wl12xx/wl1271_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
@@ -25,7 +25,7 @@
#include <linux/module.h>
#include <linux/crc7.h>
#include <linux/spi/spi.h>
-#include <linux/spi/wl12xx.h>
+#include <linux/wl12xx.h>
#include <linux/slab.h>
#include "wl1271.h"
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h
deleted file mode 100644
index a223ecb..0000000
--- a/include/linux/spi/wl12xx.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * This file is part of wl12xx
- *
- * Copyright (C) 2009 Nokia Corporation
- *
- * Contact: Kalle Valo <kalle.valo@nokia.com>
- *
- * 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 published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef _LINUX_SPI_WL12XX_H
-#define _LINUX_SPI_WL12XX_H
-
-struct wl12xx_platform_data {
- void (*set_power)(bool enable);
- /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
- int irq;
- bool use_eeprom;
-};
-
-#endif
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
new file mode 100644
index 0000000..137ac89
--- /dev/null
+++ b/include/linux/wl12xx.h
@@ -0,0 +1,34 @@
+/*
+ * This file is part of wl12xx
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * Contact: Kalle Valo <kalle.valo@nokia.com>
+ *
+ * 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 published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef _LINUX_WL12XX_H
+#define _LINUX_WL12XX_H
+
+struct wl12xx_platform_data {
+ void (*set_power)(bool enable);
+ /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
+ int irq;
+ bool use_eeprom;
+};
+
+#endif
--
1.7.0.4
^ permalink raw reply related
* [PATCH v4 2/8] wireless: wl1271: support return value for the set power func
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
Make it possible for the set power method to indicate a
success/failure return value. This is needed to support
more complex power on/off operations such as bringing up
(and down) sdio functions.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/net/wireless/wl12xx/wl1271.h | 2 +-
drivers/net/wireless/wl12xx/wl1271_io.h | 8 +++++---
drivers/net/wireless/wl12xx/wl1271_main.c | 4 +++-
drivers/net/wireless/wl12xx/wl1271_sdio.c | 4 +++-
drivers/net/wireless/wl12xx/wl1271_spi.c | 4 +++-
5 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index dd3cee6..faa5925 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -313,7 +313,7 @@ struct wl1271_if_operations {
bool fixed);
void (*reset)(struct wl1271 *wl);
void (*init)(struct wl1271 *wl);
- void (*power)(struct wl1271 *wl, bool enable);
+ int (*power)(struct wl1271 *wl, bool enable);
struct device* (*dev)(struct wl1271 *wl);
void (*enable_irq)(struct wl1271 *wl);
void (*disable_irq)(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_io.h b/drivers/net/wireless/wl12xx/wl1271_io.h
index bc806c7..4a5b92c 100644
--- a/drivers/net/wireless/wl12xx/wl1271_io.h
+++ b/drivers/net/wireless/wl12xx/wl1271_io.h
@@ -144,10 +144,12 @@ static inline void wl1271_power_off(struct wl1271 *wl)
clear_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
}
-static inline void wl1271_power_on(struct wl1271 *wl)
+static inline int wl1271_power_on(struct wl1271 *wl)
{
- wl->if_ops->power(wl, true);
- set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
+ int ret = wl->if_ops->power(wl, true);
+ if (ret == 0)
+ set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
+ return ret;
}
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 9d68f00..e6e0852 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -621,7 +621,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
int ret = 0;
msleep(WL1271_PRE_POWER_ON_SLEEP);
- wl1271_power_on(wl);
+ ret = wl1271_power_on(wl);
+ if (ret < 0)
+ goto out;
msleep(WL1271_POWER_ON_SLEEP);
wl1271_io_reset(wl);
wl1271_io_init(wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index 7059b5c..c41293a 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -152,7 +152,7 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
}
-static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
+static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
{
struct sdio_func *func = wl_to_func(wl);
@@ -167,6 +167,8 @@ static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
sdio_disable_func(func);
sdio_release_host(func);
}
+
+ return 0;
}
static struct wl1271_if_operations sdio_ops = {
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c
index c3fdab7..de56d8d 100644
--- a/drivers/net/wireless/wl12xx/wl1271_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
@@ -312,10 +312,12 @@ static irqreturn_t wl1271_irq(int irq, void *cookie)
return IRQ_HANDLED;
}
-static void wl1271_spi_set_power(struct wl1271 *wl, bool enable)
+static int wl1271_spi_set_power(struct wl1271 *wl, bool enable)
{
if (wl->set_power)
wl->set_power(enable);
+
+ return 0;
}
static struct wl1271_if_operations spi_ops = {
--
1.7.0.4
^ permalink raw reply related
* [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
Dynamically create and register a platform driver, that will
be used to to receive board-specific information like irq and
reference clock numbers.
The driver is created dynamically in order to avoid the 1-device
limitation of a fixed platform driver name.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/net/wireless/wl12xx/wl1271.h | 12 ++++
drivers/net/wireless/wl12xx/wl1271_sdio.c | 103 +++++++++++++++++++++++++++--
2 files changed, 108 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index faa5925..013eabb 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -31,6 +31,7 @@
#include <linux/list.h>
#include <linux/bitops.h>
#include <net/mac80211.h>
+#include <linux/platform_device.h>
#include "wl1271_conf.h"
#include "wl1271_ini.h"
@@ -319,8 +320,19 @@ struct wl1271_if_operations {
void (*disable_irq)(struct wl1271 *wl);
};
+/* exact size needed for "wl1271_plat.x" */
+#define WL12XX_PLAT_NAME_LEN 14
+
+struct wl12xx_plat_instance {
+ struct platform_driver pdriver;
+ char name[WL12XX_PLAT_NAME_LEN];
+ struct wl12xx_platform_data *pdata;
+ struct completion data_ready;
+};
+
struct wl1271 {
struct platform_device *plat_dev;
+ struct wl12xx_plat_instance *pinstance;
struct ieee80211_hw *hw;
bool mac80211_registered;
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index c41293a..68b512b 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -28,7 +28,11 @@
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/mmc/card.h>
+#include <linux/mmc/host.h>
+#include <linux/wl12xx.h>
#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/completion.h>
#include "wl1271.h"
#include "wl12xx_80211.h"
@@ -182,10 +186,84 @@ static struct wl1271_if_operations sdio_ops = {
.disable_irq = wl1271_sdio_disable_interrupts
};
+static int wl1271_plat_probe(struct platform_device *pdev)
+{
+ struct wl12xx_platform_data *pdata;
+ struct platform_driver *pdriver;
+ struct wl12xx_plat_instance *pinstance;
+
+ pdata = pdev->dev.platform_data;
+ if (!pdata) {
+ wl1271_error("no platform data");
+ return -ENODEV;
+ }
+
+ pdriver = container_of(pdev->dev.driver, struct platform_driver,
+ driver);
+ pinstance = container_of(pdriver, struct wl12xx_plat_instance, pdriver);
+
+ pinstance->pdata = pdata;
+
+ complete(&pinstance->data_ready);
+
+ return 0;
+}
+
+static struct wl12xx_platform_data *wl1271_get_data(struct wl1271 *wl, int id)
+{
+ int ret;
+ struct wl12xx_plat_instance *pinstance;
+
+ #define WL1271_PLAT_NAME "wl1271_plat.%d"
+
+ pinstance = kzalloc(sizeof(*pinstance), GFP_KERNEL);
+ if (!pinstance)
+ return ERR_PTR(-ENOMEM);
+
+ init_completion(&pinstance->data_ready);
+
+ pinstance->pdriver.probe = wl1271_plat_probe;
+
+ ret = snprintf(pinstance->name, sizeof(pinstance->name),
+ WL1271_PLAT_NAME, id);
+ if (ret >= WL12XX_PLAT_NAME_LEN) {
+ wl1271_error("truncated plat drv name\n");
+ goto out_free;
+ }
+
+ pinstance->pdriver.driver.name = pinstance->name;
+ pinstance->pdriver.driver.owner = THIS_MODULE;
+
+ ret = platform_driver_register(&pinstance->pdriver);
+ if (ret < 0) {
+ wl1271_error("failed to register plat driver: %d", ret);
+ goto out_free;
+ }
+
+ ret = wait_for_completion_interruptible_timeout(&pinstance->data_ready,
+ msecs_to_jiffies(15000));
+ if (ret <= 0) {
+ wl1271_error("can't get platform device (%d)", ret);
+ ret = (ret == 0 ? -EAGAIN : ret);
+ goto unreg;
+ }
+
+ wl->pinstance = pinstance;
+
+ return pinstance->pdata;
+
+unreg:
+ platform_driver_unregister(&pinstance->pdriver);
+out_free:
+ kfree(pinstance);
+ return ERR_PTR(ret);
+}
+
static int __devinit wl1271_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
struct ieee80211_hw *hw;
+ struct wl12xx_platform_data *wlan_data;
struct wl1271 *wl;
int ret;
@@ -205,17 +283,24 @@ static int __devinit wl1271_probe(struct sdio_func *func,
/* Grab access to FN0 for ELP reg. */
func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
+ wlan_data = wl1271_get_data(wl, func->card->host->index);
+ if (IS_ERR(wlan_data)) {
+ ret = PTR_ERR(wlan_data);
+ wl1271_error("missing wlan data (needed for irq/ref_clk)!");
+ goto out_free;
+ }
+
wl->irq = gpio_to_irq(RX71_WL1271_IRQ_GPIO);
if (wl->irq < 0) {
ret = wl->irq;
wl1271_error("could not get irq!");
- goto out_free;
+ goto put_data;
}
ret = request_irq(wl->irq, wl1271_irq, 0, DRIVER_NAME, wl);
if (ret < 0) {
wl1271_error("request_irq() failed: %d", ret);
- goto out_free;
+ goto put_data;
}
set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
@@ -236,13 +321,13 @@ static int __devinit wl1271_probe(struct sdio_func *func,
return 0;
- out_irq:
+out_irq:
free_irq(wl->irq, wl);
-
-
- out_free:
+put_data:
+ platform_driver_unregister(&wl->pinstance->pdriver);
+ kfree(wl->pinstance);
+out_free:
wl1271_free_hw(wl);
-
return ret;
}
@@ -253,6 +338,10 @@ static void __devexit wl1271_remove(struct sdio_func *func)
free_irq(wl->irq, wl);
wl1271_unregister_hw(wl);
+
+ platform_driver_unregister(&wl->pinstance->pdriver);
+ kfree(wl->pinstance);
+
wl1271_free_hw(wl);
}
--
1.7.0.4
^ permalink raw reply related
* [PATCH v4 4/8] wireless: wl1271: take irq info from private board data
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
Remove the hard coded irq information, and instead take
the irq information from the board's platform data.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/net/wireless/wl12xx/wl1271_sdio.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index 68b512b..228f5af 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -38,9 +38,6 @@
#include "wl12xx_80211.h"
#include "wl1271_io.h"
-
-#define RX71_WL1271_IRQ_GPIO 42
-
#ifndef SDIO_VENDOR_ID_TI
#define SDIO_VENDOR_ID_TI 0x0097
#endif
@@ -191,6 +188,7 @@ static int wl1271_plat_probe(struct platform_device *pdev)
struct wl12xx_platform_data *pdata;
struct platform_driver *pdriver;
struct wl12xx_plat_instance *pinstance;
+ int irq;
pdata = pdev->dev.platform_data;
if (!pdata) {
@@ -198,6 +196,13 @@ static int wl1271_plat_probe(struct platform_device *pdev)
return -ENODEV;
}
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0) {
+ wl1271_error("no platform irq data");
+ return -ENODEV;
+ }
+ pdata->irq = irq;
+
pdriver = container_of(pdev->dev.driver, struct platform_driver,
driver);
pinstance = container_of(pdriver, struct wl12xx_plat_instance, pdriver);
@@ -290,12 +295,7 @@ static int __devinit wl1271_probe(struct sdio_func *func,
goto out_free;
}
- wl->irq = gpio_to_irq(RX71_WL1271_IRQ_GPIO);
- if (wl->irq < 0) {
- ret = wl->irq;
- wl1271_error("could not get irq!");
- goto put_data;
- }
+ wl->irq = wlan_data->irq;
ret = request_irq(wl->irq, wl1271_irq, 0, DRIVER_NAME, wl);
if (ret < 0) {
--
1.7.0.4
^ permalink raw reply related
* [PATCH v4 5/8] wireless: wl1271: make ref_clock configurable by board
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
The wl1271 device is using a reference clock that may change
between board to board.
Make the ref_clock parameter configurable by the board
files that set up the device, instead of having a hard coded
value in the driver source itself.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/net/wireless/wl12xx/wl1271.h | 1 +
drivers/net/wireless/wl12xx/wl1271_boot.c | 9 +++++----
drivers/net/wireless/wl12xx/wl1271_boot.h | 1 -
drivers/net/wireless/wl12xx/wl1271_sdio.c | 1 +
drivers/net/wireless/wl12xx/wl1271_spi.c | 2 ++
include/linux/wl12xx.h | 1 +
6 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index 013eabb..f0988a4 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -342,6 +342,7 @@ struct wl1271 {
void (*set_power)(bool enable);
int irq;
+ int ref_clock;
spinlock_t wl_lock;
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index f36430b..95c636a 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -457,17 +457,18 @@ int wl1271_boot(struct wl1271 *wl)
{
int ret = 0;
u32 tmp, clk, pause;
+ int ref_clock = wl->ref_clock;
wl1271_boot_hw_version(wl);
- if (REF_CLOCK == 0 || REF_CLOCK == 2 || REF_CLOCK == 4)
+ if (ref_clock == 0 || ref_clock == 2 || ref_clock == 4)
/* ref clk: 19.2/38.4/38.4-XTAL */
clk = 0x3;
- else if (REF_CLOCK == 1 || REF_CLOCK == 3)
+ else if (ref_clock == 1 || ref_clock == 3)
/* ref clk: 26/52 */
clk = 0x5;
- if (REF_CLOCK != 0) {
+ if (ref_clock != 0) {
u16 val;
/* Set clock type (open drain) */
val = wl1271_top_reg_read(wl, OCP_REG_CLK_TYPE);
@@ -516,7 +517,7 @@ int wl1271_boot(struct wl1271 *wl)
wl1271_debug(DEBUG_BOOT, "clk2 0x%x", clk);
/* 2 */
- clk |= (REF_CLOCK << 1) << 4;
+ clk |= (ref_clock << 1) << 4;
wl1271_write32(wl, DRPW_SCRATCH_START, clk);
wl1271_set_partition(wl, &part_table[PART_WORK]);
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.h b/drivers/net/wireless/wl12xx/wl1271_boot.h
index f829699..f73b0b1 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.h
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.h
@@ -46,7 +46,6 @@ struct wl1271_static_data {
/* delay between retries */
#define INIT_LOOP_DELAY 50
-#define REF_CLOCK 2
#define WU_COUNTER_PAUSE_VAL 0x3FF
#define WELP_ARM_COMMAND_VAL 0x4
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index 228f5af..2f558a6 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -296,6 +296,7 @@ static int __devinit wl1271_probe(struct sdio_func *func,
}
wl->irq = wlan_data->irq;
+ wl->ref_clock = wlan_data->board_ref_clock;
ret = request_irq(wl->irq, wl1271_irq, 0, DRIVER_NAME, wl);
if (ret < 0) {
diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c b/drivers/net/wireless/wl12xx/wl1271_spi.c
index de56d8d..ced0a9e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_spi.c
+++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
@@ -372,6 +372,8 @@ static int __devinit wl1271_probe(struct spi_device *spi)
goto out_free;
}
+ wl->ref_clock = pdata->board_ref_clock;
+
wl->irq = spi->irq;
if (wl->irq < 0) {
wl1271_error("irq missing in platform data");
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 137ac89..ef6eed9 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -29,6 +29,7 @@ struct wl12xx_platform_data {
/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
int irq;
bool use_eeprom;
+ int board_ref_clock;
};
#endif
--
1.7.0.4
^ permalink raw reply related
* [PATCH v4 6/8] omap: hsmmc: remove unused variable
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
Make this go away:
drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
drivers/mmc/host/omap_hsmmc.c:2328: warning: unused variable 'state'
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/mmc/host/omap_hsmmc.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index b032828..d50e917 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2272,7 +2272,6 @@ static int omap_hsmmc_suspend(struct device *dev)
int ret = 0;
struct platform_device *pdev = to_platform_device(dev);
struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
- pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */
if (host && host->suspended)
return 0;
--
1.7.0.4
^ permalink raw reply related
* [PATCH v4 7/8] omap: zoom: add fixed regulator device for wlan
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
Add a fixed regulator vmmc device to enable power control
of the wl1271 wlan device.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
arch/arm/mach-omap2/board-zoom-peripherals.c | 35 ++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 6b39849..de88635 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -16,6 +16,7 @@
#include <linux/gpio.h>
#include <linux/i2c/twl.h>
#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -27,6 +28,8 @@
#include "mux.h"
#include "hsmmc.h"
+#define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
+
/* Zoom2 has Qwerty keyboard*/
static int board_keymap[] = {
KEY(0, 0, KEY_E),
@@ -106,6 +109,11 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = {
.supply = "vmmc",
};
+static struct regulator_consumer_supply zoom_vmmc3_supply = {
+ .supply = "vmmc",
+ .dev_name = "mmci-omap-hs.2",
+};
+
/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
static struct regulator_init_data zoom_vmmc1 = {
.constraints = {
@@ -151,6 +159,32 @@ static struct regulator_init_data zoom_vsim = {
.consumer_supplies = &zoom_vsim_supply,
};
+static struct regulator_init_data zoom_vmmc3 = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &zoom_vmmc3_supply,
+};
+
+static struct fixed_voltage_config zoom_vwlan = {
+ .supply_name = "vwl1271",
+ .microvolts = 1800000, /* 1.8V */
+ .gpio = OMAP_ZOOM_WLAN_PMENA_GPIO,
+ .startup_delay = 70000, /* 70msec */
+ .enable_high = 1,
+ .enabled_at_boot = 0,
+ .init_data = &zoom_vmmc3,
+};
+
+static struct platform_device omap_vwlan_device = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &zoom_vwlan,
+ },
+};
+
static struct omap2_hsmmc_info mmc[] __initdata = {
{
.name = "external",
@@ -280,6 +314,7 @@ static void enable_board_wakeup_source(void)
void __init zoom_peripherals_init(void)
{
omap_i2c_init();
+ platform_device_register(&omap_vwlan_device);
usb_musb_init(&musb_board_data);
enable_board_wakeup_source();
}
--
1.7.0.4
^ permalink raw reply related
* [PATCH v4 8/8] omap: zoom: add mmc3/wl1271 device support
From: Ohad Ben-Cohen @ 2010-08-11 18:21 UTC (permalink / raw)
To: linux-wireless, linux-mmc, linux-omap
Cc: Ido Yariv, Mark Brown, linux-arm-kernel,
Chikkature Rajashekar Madhusudhan, Luciano Coelho, akpm,
San Mehat, Roger Quadros, Tony Lindgren, Nicolas Pitre,
Pandita Vikram, Kalle Valo, Ohad Ben-Cohen
In-Reply-To: <1281550913-17633-1-git-send-email-ohad@wizery.com>
Add MMC3 support on ZOOM, which has the wl1271 device hardwired to.
The wl1271 is a 4-wire, 1.8V, embedded SDIO WLAN device with an
external IRQ line, and power-controlled by a GPIO-based fixed regulator.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
arch/arm/mach-omap2/board-zoom-peripherals.c | 34 ++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index de88635..625ae56 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -17,6 +17,8 @@
#include <linux/i2c/twl.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
+#include <linux/mmc/host.h>
+#include <linux/wl12xx.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -29,6 +31,7 @@
#include "hsmmc.h"
#define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
+#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
/* Zoom2 has Qwerty keyboard*/
static int board_keymap[] = {
@@ -185,6 +188,28 @@ static struct platform_device omap_vwlan_device = {
},
};
+struct wl12xx_platform_data omap_zoom_wlan_data = {
+ /* ZOOM ref clock is 26 MHz */
+ .board_ref_clock = 1,
+};
+
+static struct resource omap_zoom_wl1271_resources[] = {
+ {
+ .start = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
+ .end = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
+ .flags = IORESOURCE_IRQ,
+ }
+};
+static struct platform_device omap_zoom_wl1271 = {
+ .name = "wl1271_plat.2",
+ .id = -1,
+ .resource = omap_zoom_wl1271_resources,
+ .num_resources = ARRAY_SIZE(omap_zoom_wl1271_resources),
+ .dev = {
+ .platform_data = &omap_zoom_wlan_data,
+ },
+};
+
static struct omap2_hsmmc_info mmc[] __initdata = {
{
.name = "external",
@@ -202,6 +227,14 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
.nonremovable = true,
.power_saving = true,
},
+ {
+ .name = "wl1271",
+ .mmc = 3,
+ .wires = 4,
+ .gpio_wp = -EINVAL,
+ .gpio_cd = -EINVAL,
+ .nonremovable = true,
+ },
{} /* Terminator */
};
@@ -313,6 +346,7 @@ static void enable_board_wakeup_source(void)
void __init zoom_peripherals_init(void)
{
+ platform_device_register(&omap_zoom_wl1271);
omap_i2c_init();
platform_device_register(&omap_vwlan_device);
usb_musb_init(&musb_board_data);
--
1.7.0.4
^ permalink raw reply related
* RE: [PATCH v4 2/8] wireless: wl1271: support return value for the set power func
From: DebBarma, Tarun Kanti @ 2010-08-11 18:35 UTC (permalink / raw)
To: Ohad Ben-Cohen, linux-wireless@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org
Cc: Ido Yariv, Mark Brown, linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar, Madhusudhan, Luciano Coelho,
akpm@linux-foundation.org, San Mehat, Roger Quadros,
Tony Lindgren, Nicolas Pitre, Pandita, Vikram, Kalle Valo
In-Reply-To: <1281550913-17633-3-git-send-email-ohad@wizery.com>
Ohad,
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Ohad Ben-Cohen
> Sent: Wednesday, August 11, 2010 11:52 PM
> To: linux-wireless@vger.kernel.org; linux-mmc@vger.kernel.org; linux-
> omap@vger.kernel.org
> Cc: Ido Yariv; Mark Brown; linux-arm-kernel@lists.infradead.org;
> Chikkature Rajashekar, Madhusudhan; Luciano Coelho; akpm@linux-
> foundation.org; San Mehat; Roger Quadros; Tony Lindgren; Nicolas Pitre;
> Pandita, Vikram; Kalle Valo; Ohad Ben-Cohen
> Subject: [PATCH v4 2/8] wireless: wl1271: support return value for the set
> power func
>
> Make it possible for the set power method to indicate a
> success/failure return value. This is needed to support
> more complex power on/off operations such as bringing up
> (and down) sdio functions.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
> drivers/net/wireless/wl12xx/wl1271.h | 2 +-
> drivers/net/wireless/wl12xx/wl1271_io.h | 8 +++++---
> drivers/net/wireless/wl12xx/wl1271_main.c | 4 +++-
> drivers/net/wireless/wl12xx/wl1271_sdio.c | 4 +++-
> drivers/net/wireless/wl12xx/wl1271_spi.c | 4 +++-
> 5 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/wl12xx/wl1271.h
> b/drivers/net/wireless/wl12xx/wl1271.h
> index dd3cee6..faa5925 100644
> --- a/drivers/net/wireless/wl12xx/wl1271.h
> +++ b/drivers/net/wireless/wl12xx/wl1271.h
> @@ -313,7 +313,7 @@ struct wl1271_if_operations {
> bool fixed);
> void (*reset)(struct wl1271 *wl);
> void (*init)(struct wl1271 *wl);
> - void (*power)(struct wl1271 *wl, bool enable);
> + int (*power)(struct wl1271 *wl, bool enable);
> struct device* (*dev)(struct wl1271 *wl);
> void (*enable_irq)(struct wl1271 *wl);
> void (*disable_irq)(struct wl1271 *wl);
> diff --git a/drivers/net/wireless/wl12xx/wl1271_io.h
> b/drivers/net/wireless/wl12xx/wl1271_io.h
> index bc806c7..4a5b92c 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_io.h
> +++ b/drivers/net/wireless/wl12xx/wl1271_io.h
> @@ -144,10 +144,12 @@ static inline void wl1271_power_off(struct wl1271
> *wl)
> clear_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
> }
>
> -static inline void wl1271_power_on(struct wl1271 *wl)
> +static inline int wl1271_power_on(struct wl1271 *wl)
> {
> - wl->if_ops->power(wl, true);
> - set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
> + int ret = wl->if_ops->power(wl, true);
Just a minor comment, need a blank line here?
> + if (ret == 0)
> + set_bit(WL1271_FLAG_GPIO_POWER, &wl->flags);
> + return ret;
> }
>
>
> diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c
> b/drivers/net/wireless/wl12xx/wl1271_main.c
> index 9d68f00..e6e0852 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_main.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
> @@ -621,7 +621,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
> int ret = 0;
>
> msleep(WL1271_PRE_POWER_ON_SLEEP);
> - wl1271_power_on(wl);
> + ret = wl1271_power_on(wl);
> + if (ret < 0)
> + goto out;
> msleep(WL1271_POWER_ON_SLEEP);
> wl1271_io_reset(wl);
> wl1271_io_init(wl);
> diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c
> b/drivers/net/wireless/wl12xx/wl1271_sdio.c
> index 7059b5c..c41293a 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
> @@ -152,7 +152,7 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl,
> int addr, void *buf,
>
> }
>
> -static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
> +static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
> {
> struct sdio_func *func = wl_to_func(wl);
>
> @@ -167,6 +167,8 @@ static void wl1271_sdio_set_power(struct wl1271 *wl,
> bool enable)
> sdio_disable_func(func);
> sdio_release_host(func);
> }
> +
> + return 0;
> }
>
> static struct wl1271_if_operations sdio_ops = {
> diff --git a/drivers/net/wireless/wl12xx/wl1271_spi.c
> b/drivers/net/wireless/wl12xx/wl1271_spi.c
> index c3fdab7..de56d8d 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_spi.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_spi.c
> @@ -312,10 +312,12 @@ static irqreturn_t wl1271_irq(int irq, void *cookie)
> return IRQ_HANDLED;
> }
>
> -static void wl1271_spi_set_power(struct wl1271 *wl, bool enable)
> +static int wl1271_spi_set_power(struct wl1271 *wl, bool enable)
> {
> if (wl->set_power)
> wl->set_power(enable);
> +
> + return 0;
> }
>
> static struct wl1271_if_operations spi_ops = {
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH (for some future time)] drivers/net: Convert unbounded kzalloc calls to kcalloc
From: Gertjan van Wingerde @ 2010-08-11 18:40 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, linux-wireless, linux-kernel
In-Reply-To: <1281546168.3976.39.camel@Joe-Laptop.home>
On 08/11/10 19:02, Joe Perches wrote:
> These changes may be slightly safer in some instances.
>
> There are other kzalloc calls with a multiply, but those
> calls are typically "small fixed #" * sizeof(some pointer)"
> and those are not converted.
>
> Signed-off-by: Joe Perches <joe@perches.com>
For the rt2x00 parts:
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/cnic.c | 2 +-
> drivers/net/ehea/ehea_main.c | 4 ++--
> drivers/net/mlx4/alloc.c | 2 +-
> drivers/net/mlx4/en_rx.c | 2 +-
> drivers/net/mlx4/profile.c | 2 +-
> drivers/net/myri10ge/myri10ge.c | 4 ++--
> drivers/net/niu.c | 4 ++--
> drivers/net/vxge/vxge-main.c | 10 +++++-----
> drivers/net/wireless/airo.c | 5 ++---
> drivers/net/wireless/b43/phy_n.c | 2 +-
> drivers/net/wireless/ipw2x00/ipw2100.c | 6 +++---
> drivers/net/wireless/ipw2x00/ipw2200.c | 12 ++++++------
> drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
> drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
> drivers/net/wireless/rt2x00/rt2500usb.c | 2 +-
> drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
> drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +-
> drivers/net/wireless/rt2x00/rt2x00queue.c | 4 ++--
> drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
> drivers/net/wireless/rt2x00/rt73usb.c | 2 +-
> drivers/net/wireless/wl12xx/wl1271_scan.c | 2 +-
> 21 files changed, 37 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
> index 0961032..2ab6a7c 100644
> --- a/drivers/net/cnic.c
> +++ b/drivers/net/cnic.c
> @@ -1022,7 +1022,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev)
> if (blks > cp->ethdev->ctx_tbl_len)
> return -ENOMEM;
>
> - cp->ctx_arr = kzalloc(blks * sizeof(struct cnic_ctx), GFP_KERNEL);
> + cp->ctx_arr = kcalloc(blks, sizeof(struct cnic_ctx), GFP_KERNEL);
> if (cp->ctx_arr == NULL)
> return -ENOMEM;
>
> diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
> index 3beba70..455d101 100644
> --- a/drivers/net/ehea/ehea_main.c
> +++ b/drivers/net/ehea/ehea_main.c
> @@ -180,7 +180,7 @@ static void ehea_update_firmware_handles(void)
> num_portres * EHEA_NUM_PORTRES_FW_HANDLES;
>
> if (num_fw_handles) {
> - arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL);
> + arr = kcalloc(num_fw_handles, sizeof(*arr), GFP_KERNEL);
> if (!arr)
> goto out; /* Keep the existing array */
> } else
> @@ -265,7 +265,7 @@ static void ehea_update_bcmc_registrations(void)
> }
>
> if (num_registrations) {
> - arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC);
> + arr = kcalloc(num_registrations, sizeof(*arr), GFP_ATOMIC);
> if (!arr)
> goto out; /* Keep the existing array */
> } else
> diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
> index 8c85156..537997f 100644
> --- a/drivers/net/mlx4/alloc.c
> +++ b/drivers/net/mlx4/alloc.c
> @@ -188,7 +188,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
> buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE;
> buf->npages = buf->nbufs;
> buf->page_shift = PAGE_SHIFT;
> - buf->page_list = kzalloc(buf->nbufs * sizeof *buf->page_list,
> + buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list),
> GFP_KERNEL);
> if (!buf->page_list)
> return -ENOMEM;
> diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
> index 8e2fcb7..efc3fad 100644
> --- a/drivers/net/mlx4/en_rx.c
> +++ b/drivers/net/mlx4/en_rx.c
> @@ -322,7 +322,7 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
> ring->lro.ip_summed_aggr = CHECKSUM_UNNECESSARY;
> ring->lro.max_desc = mdev->profile.num_lro;
> ring->lro.max_aggr = MAX_SKB_FRAGS;
> - ring->lro.lro_arr = kzalloc(mdev->profile.num_lro *
> + ring->lro.lro_arr = kcalloc(mdev->profile.num_lro,
> sizeof(struct net_lro_desc),
> GFP_KERNEL);
> if (!ring->lro.lro_arr) {
> diff --git a/drivers/net/mlx4/profile.c b/drivers/net/mlx4/profile.c
> index 5caf011..e749f82 100644
> --- a/drivers/net/mlx4/profile.c
> +++ b/drivers/net/mlx4/profile.c
> @@ -85,7 +85,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
> struct mlx4_resource tmp;
> int i, j;
>
> - profile = kzalloc(MLX4_RES_NUM * sizeof *profile, GFP_KERNEL);
> + profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL);
> if (!profile)
> return -ENOMEM;
>
> diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
> index d771d16..323fbc1 100644
> --- a/drivers/net/myri10ge/myri10ge.c
> +++ b/drivers/net/myri10ge/myri10ge.c
> @@ -3729,8 +3729,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
> * slices. We give up on MSI-X if we can only get a single
> * vector. */
>
> - mgp->msix_vectors = kzalloc(mgp->num_slices *
> - sizeof(*mgp->msix_vectors), GFP_KERNEL);
> + mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
> + GFP_KERNEL);
> if (mgp->msix_vectors == NULL)
> goto disable_msix;
> for (i = 0; i < mgp->num_slices; i++) {
> diff --git a/drivers/net/niu.c b/drivers/net/niu.c
> index b9b9508..fc58f9c 100644
> --- a/drivers/net/niu.c
> +++ b/drivers/net/niu.c
> @@ -4507,7 +4507,7 @@ static int niu_alloc_channels(struct niu *np)
>
> np->dev->real_num_tx_queues = np->num_tx_rings;
>
> - np->rx_rings = kzalloc(np->num_rx_rings * sizeof(struct rx_ring_info),
> + np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info),
> GFP_KERNEL);
> err = -ENOMEM;
> if (!np->rx_rings)
> @@ -4541,7 +4541,7 @@ static int niu_alloc_channels(struct niu *np)
> return err;
> }
>
> - np->tx_rings = kzalloc(np->num_tx_rings * sizeof(struct tx_ring_info),
> + np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info),
> GFP_KERNEL);
> err = -ENOMEM;
> if (!np->tx_rings)
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index c7c5605..f5334b2 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
> @@ -2159,8 +2159,8 @@ start:
> /* Alarm MSIX Vectors count */
> vdev->intr_cnt++;
>
> - vdev->entries = kzalloc(vdev->intr_cnt * sizeof(struct msix_entry),
> - GFP_KERNEL);
> + vdev->entries = kcalloc(vdev->intr_cnt, sizeof(struct msix_entry),
> + GFP_KERNEL);
> if (!vdev->entries) {
> vxge_debug_init(VXGE_ERR,
> "%s: memory allocation failed",
> @@ -2169,9 +2169,9 @@ start:
> goto alloc_entries_failed;
> }
>
> - vdev->vxge_entries =
> - kzalloc(vdev->intr_cnt * sizeof(struct vxge_msix_entry),
> - GFP_KERNEL);
> + vdev->vxge_entries = kcalloc(vdev->intr_cnt,
> + sizeof(struct vxge_msix_entry),
> + GFP_KERNEL);
> if (!vdev->vxge_entries) {
> vxge_debug_init(VXGE_ERR, "%s: memory allocation failed",
> VXGE_DRIVER_NAME);
> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index 1d05445..7d26506 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -2723,9 +2723,8 @@ static int airo_networks_allocate(struct airo_info *ai)
> if (ai->networks)
> return 0;
>
> - ai->networks =
> - kzalloc(AIRO_MAX_NETWORK_COUNT * sizeof(BSSListElement),
> - GFP_KERNEL);
> + ai->networks = kcalloc(AIRO_MAX_NETWORK_COUNT, sizeof(BSSListElement),
> + GFP_KERNEL);
> if (!ai->networks) {
> airo_print_warn("", "Out of memory allocating beacons");
> return -ENOMEM;
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index 5a72570..e288c55 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -1182,7 +1182,7 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
> len = bw << 1;
> }
>
> - samples = kzalloc(len * sizeof(struct b43_c32), GFP_KERNEL);
> + samples = kcalloc(len, sizeof(struct b43_c32), GFP_KERNEL);
> if (!samples) {
> b43err(dev->wl, "allocation for samples generation failed\n");
> return 0;
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index c24c5ef..2e07f1e 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -1921,9 +1921,9 @@ static int ipw2100_net_init(struct net_device *dev)
>
> bg_band->band = IEEE80211_BAND_2GHZ;
> bg_band->n_channels = geo->bg_channels;
> - bg_band->channels =
> - kzalloc(geo->bg_channels *
> - sizeof(struct ieee80211_channel), GFP_KERNEL);
> + bg_band->channels = kcalloc(geo->bg_channels,
> + sizeof(struct ieee80211_channel),
> + GFP_KERNEL);
> /* translate geo->bg to bg_band.channels */
> for (i = 0; i < geo->bg_channels; i++) {
> bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
> index cb2552a..0f25083 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
> @@ -11467,9 +11467,9 @@ static int ipw_net_init(struct net_device *dev)
>
> bg_band->band = IEEE80211_BAND_2GHZ;
> bg_band->n_channels = geo->bg_channels;
> - bg_band->channels =
> - kzalloc(geo->bg_channels *
> - sizeof(struct ieee80211_channel), GFP_KERNEL);
> + bg_band->channels = kcalloc(geo->bg_channels,
> + sizeof(struct ieee80211_channel),
> + GFP_KERNEL);
> /* translate geo->bg to bg_band.channels */
> for (i = 0; i < geo->bg_channels; i++) {
> bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
> @@ -11502,9 +11502,9 @@ static int ipw_net_init(struct net_device *dev)
>
> a_band->band = IEEE80211_BAND_5GHZ;
> a_band->n_channels = geo->a_channels;
> - a_band->channels =
> - kzalloc(geo->a_channels *
> - sizeof(struct ieee80211_channel), GFP_KERNEL);
> + a_band->channels = kcalloc(geo->a_channels,
> + sizeof(struct ieee80211_channel),
> + GFP_KERNEL);
> /* translate geo->bg to a_band.channels */
> for (i = 0; i < geo->a_channels; i++) {
> a_band->channels[i].band = IEEE80211_BAND_2GHZ;
> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
> index 5063e01..8e3fbdf 100644
> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
> @@ -1481,7 +1481,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
> index c2a555d..1d174e4 100644
> --- a/drivers/net/wireless/rt2x00/rt2500pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2500pci.c
> @@ -1795,7 +1795,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
> index cdaf93f..8ddaae4 100644
> --- a/drivers/net/wireless/rt2x00/rt2500usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2500usb.c
> @@ -1698,7 +1698,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index b66e0fd..8c00fbd 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2865,7 +2865,7 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
> index b0498e7..2d018ce 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00debug.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
> @@ -333,7 +333,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
> if (*offset)
> return 0;
>
> - data = kzalloc(lines * MAX_LINE_LENGTH, GFP_KERNEL);
> + data = kcalloc(lines, MAX_LINE_LENGTH, GFP_KERNEL);
> if (!data)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
> index a3401d3..9c609be 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
> @@ -755,7 +755,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
> * Allocate all queue entries.
> */
> entry_size = sizeof(*entries) + qdesc->priv_size;
> - entries = kzalloc(queue->limit * entry_size, GFP_KERNEL);
> + entries = kcalloc(queue->limit, entry_size, GFP_KERNEL);
> if (!entries)
> return -ENOMEM;
>
> @@ -891,7 +891,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
> */
> rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim;
>
> - queue = kzalloc(rt2x00dev->data_queues * sizeof(*queue), GFP_KERNEL);
> + queue = kcalloc(rt2x00dev->data_queues, sizeof(*queue), GFP_KERNEL);
> if (!queue) {
> ERROR(rt2x00dev, "Queue allocation failed.\n");
> return -ENOMEM;
> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
> index e539c6c..f226582 100644
> --- a/drivers/net/wireless/rt2x00/rt61pci.c
> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
> @@ -2654,7 +2654,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
> index aa9de18..99985a2 100644
> --- a/drivers/net/wireless/rt2x00/rt73usb.c
> +++ b/drivers/net/wireless/rt2x00/rt73usb.c
> @@ -2084,7 +2084,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c
> index fec43ee..30dc100 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_scan.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_scan.c
> @@ -248,7 +248,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
>
> wl->scan.req = req;
>
> - wl->scan.scanned_ch = kzalloc(req->n_channels *
> + wl->scan.scanned_ch = kcalloc(req->n_channels,
> sizeof(*wl->scan.scanned_ch),
> GFP_KERNEL);
> wl1271_scan_stm(wl);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* RE: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: DebBarma, Tarun Kanti @ 2010-08-11 18:42 UTC (permalink / raw)
To: Ohad Ben-Cohen, linux-wireless@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org
Cc: Ido Yariv, Mark Brown, linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar, Madhusudhan, Luciano Coelho,
akpm@linux-foundation.org, San Mehat, Roger Quadros,
Tony Lindgren, Nicolas Pitre, Pandita, Vikram, Kalle Valo
In-Reply-To: <1281550913-17633-4-git-send-email-ohad@wizery.com>
Ohad,
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Ohad Ben-Cohen
> Sent: Wednesday, August 11, 2010 11:52 PM
> To: linux-wireless@vger.kernel.org; linux-mmc@vger.kernel.org; linux-
> omap@vger.kernel.org
> Cc: Ido Yariv; Mark Brown; linux-arm-kernel@lists.infradead.org;
> Chikkature Rajashekar, Madhusudhan; Luciano Coelho; akpm@linux-
> foundation.org; San Mehat; Roger Quadros; Tony Lindgren; Nicolas Pitre;
> Pandita, Vikram; Kalle Valo; Ohad Ben-Cohen
> Subject: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board
> data
>
> Dynamically create and register a platform driver, that will
> be used to to receive board-specific information like irq and
> reference clock numbers.
>
> The driver is created dynamically in order to avoid the 1-device
> limitation of a fixed platform driver name.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
> drivers/net/wireless/wl12xx/wl1271.h | 12 ++++
> drivers/net/wireless/wl12xx/wl1271_sdio.c | 103
> +++++++++++++++++++++++++++--
> 2 files changed, 108 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/wl12xx/wl1271.h
> b/drivers/net/wireless/wl12xx/wl1271.h
> index faa5925..013eabb 100644
> --- a/drivers/net/wireless/wl12xx/wl1271.h
> +++ b/drivers/net/wireless/wl12xx/wl1271.h
> @@ -31,6 +31,7 @@
> #include <linux/list.h>
> #include <linux/bitops.h>
> #include <net/mac80211.h>
> +#include <linux/platform_device.h>
>
> #include "wl1271_conf.h"
> #include "wl1271_ini.h"
> @@ -319,8 +320,19 @@ struct wl1271_if_operations {
> void (*disable_irq)(struct wl1271 *wl);
> };
>
> +/* exact size needed for "wl1271_plat.x" */
> +#define WL12XX_PLAT_NAME_LEN 14
> +
> +struct wl12xx_plat_instance {
> + struct platform_driver pdriver;
> + char name[WL12XX_PLAT_NAME_LEN];
> + struct wl12xx_platform_data *pdata;
> + struct completion data_ready;
> +};
> +
> struct wl1271 {
> struct platform_device *plat_dev;
> + struct wl12xx_plat_instance *pinstance;
> struct ieee80211_hw *hw;
> bool mac80211_registered;
>
> diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c
> b/drivers/net/wireless/wl12xx/wl1271_sdio.c
> index c41293a..68b512b 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
> @@ -28,7 +28,11 @@
> #include <linux/mmc/sdio_func.h>
> #include <linux/mmc/sdio_ids.h>
> #include <linux/mmc/card.h>
> +#include <linux/mmc/host.h>
> +#include <linux/wl12xx.h>
> #include <linux/gpio.h>
> +#include <linux/platform_device.h>
> +#include <linux/completion.h>
>
> #include "wl1271.h"
> #include "wl12xx_80211.h"
> @@ -182,10 +186,84 @@ static struct wl1271_if_operations sdio_ops = {
> .disable_irq = wl1271_sdio_disable_interrupts
> };
>
> +static int wl1271_plat_probe(struct platform_device *pdev)
> +{
> + struct wl12xx_platform_data *pdata;
> + struct platform_driver *pdriver;
> + struct wl12xx_plat_instance *pinstance;
> +
What about checking for pdev here before extracting pdata?
> + pdata = pdev->dev.platform_data;
> + if (!pdata) {
> + wl1271_error("no platform data");
> + return -ENODEV;
> + }
> +
> + pdriver = container_of(pdev->dev.driver, struct platform_driver,
> + driver);
> + pinstance = container_of(pdriver, struct wl12xx_plat_instance,
> pdriver);
> +
> + pinstance->pdata = pdata;
> +
> + complete(&pinstance->data_ready);
> +
> + return 0;
> +}
> +
> +static struct wl12xx_platform_data *wl1271_get_data(struct wl1271 *wl,
> int id)
> +{
> + int ret;
> + struct wl12xx_plat_instance *pinstance;
> +
> + #define WL1271_PLAT_NAME "wl1271_plat.%d"
> +
> + pinstance = kzalloc(sizeof(*pinstance), GFP_KERNEL);
> + if (!pinstance)
> + return ERR_PTR(-ENOMEM);
> +
> + init_completion(&pinstance->data_ready);
> +
> + pinstance->pdriver.probe = wl1271_plat_probe;
> +
> + ret = snprintf(pinstance->name, sizeof(pinstance->name),
> + WL1271_PLAT_NAME, id);
> + if (ret >= WL12XX_PLAT_NAME_LEN) {
> + wl1271_error("truncated plat drv name\n");
> + goto out_free;
> + }
> +
> + pinstance->pdriver.driver.name = pinstance->name;
> + pinstance->pdriver.driver.owner = THIS_MODULE;
> +
> + ret = platform_driver_register(&pinstance->pdriver);
> + if (ret < 0) {
> + wl1271_error("failed to register plat driver: %d", ret);
> + goto out_free;
> + }
> +
> + ret = wait_for_completion_interruptible_timeout(&pinstance-
> >data_ready,
> + msecs_to_jiffies(15000));
> + if (ret <= 0) {
> + wl1271_error("can't get platform device (%d)", ret);
> + ret = (ret == 0 ? -EAGAIN : ret);
> + goto unreg;
> + }
> +
> + wl->pinstance = pinstance;
> +
> + return pinstance->pdata;
> +
> +unreg:
> + platform_driver_unregister(&pinstance->pdriver);
> +out_free:
> + kfree(pinstance);
> + return ERR_PTR(ret);
> +}
> +
> static int __devinit wl1271_probe(struct sdio_func *func,
> const struct sdio_device_id *id)
> {
> struct ieee80211_hw *hw;
> + struct wl12xx_platform_data *wlan_data;
> struct wl1271 *wl;
> int ret;
>
> @@ -205,17 +283,24 @@ static int __devinit wl1271_probe(struct sdio_func
> *func,
> /* Grab access to FN0 for ELP reg. */
> func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
>
> + wlan_data = wl1271_get_data(wl, func->card->host->index);
> + if (IS_ERR(wlan_data)) {
> + ret = PTR_ERR(wlan_data);
> + wl1271_error("missing wlan data (needed for irq/ref_clk)!");
> + goto out_free;
> + }
> +
> wl->irq = gpio_to_irq(RX71_WL1271_IRQ_GPIO);
> if (wl->irq < 0) {
> ret = wl->irq;
> wl1271_error("could not get irq!");
> - goto out_free;
> + goto put_data;
> }
>
> ret = request_irq(wl->irq, wl1271_irq, 0, DRIVER_NAME, wl);
> if (ret < 0) {
> wl1271_error("request_irq() failed: %d", ret);
> - goto out_free;
> + goto put_data;
> }
>
> set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
> @@ -236,13 +321,13 @@ static int __devinit wl1271_probe(struct sdio_func
> *func,
>
> return 0;
>
> - out_irq:
> +out_irq:
> free_irq(wl->irq, wl);
> -
> -
> - out_free:
> +put_data:
> + platform_driver_unregister(&wl->pinstance->pdriver);
> + kfree(wl->pinstance);
> +out_free:
> wl1271_free_hw(wl);
> -
> return ret;
> }
>
> @@ -253,6 +338,10 @@ static void __devexit wl1271_remove(struct sdio_func
> *func)
> free_irq(wl->irq, wl);
>
> wl1271_unregister_hw(wl);
> +
> + platform_driver_unregister(&wl->pinstance->pdriver);
> + kfree(wl->pinstance);
> +
> wl1271_free_hw(wl);
> }
>
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH 1/5] mac80211: use cipher suite selectors
From: Gertjan van Wingerde @ 2010-08-11 18:43 UTC (permalink / raw)
To: John W. Linville, Johannes Berg; +Cc: linux-wireless@vger.kernel.org
>From: Johannes Berg <johannes.berg@intel.com>
>
>Currently, mac80211 translates the cfg80211
>cipher suite selectors into ALG_* values.
>That isn't all too useful, and some drivers
>benefit from the distinction between WEP40
>and WEP104 as well. Therefore, convert it
>all to use the cipher suite selectors.
>
>Signed-off-by: Johannes Berg <johannes.berg@intel.com>
For the rt2x00 parts:
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
Gertjan.
^ permalink raw reply
* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Felipe Balbi @ 2010-08-11 18:47 UTC (permalink / raw)
To: ext DebBarma, Tarun Kanti
Cc: Ohad Ben-Cohen, linux-wireless@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Ido Yariv,
Mark Brown, linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar, Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita, Vikram, Kalle Valo
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0324110ABD@dbde02.ent.ti.com>
hi,
On Wed, Aug 11, 2010 at 08:42:18PM +0200, ext DebBarma, Tarun Kanti wrote:
>> @@ -182,10 +186,84 @@ static struct wl1271_if_operations sdio_ops = {
>> .disable_irq = wl1271_sdio_disable_interrupts
>> };
>>
>> +static int wl1271_plat_probe(struct platform_device *pdev)
>> +{
>> + struct wl12xx_platform_data *pdata;
>> + struct platform_driver *pdriver;
>> + struct wl12xx_plat_instance *pinstance;
>> +
>What about checking for pdev here before extracting pdata?
why ? if probe is called pdev is guaranteed to be valid, no ?
>> + pdata = pdev->dev.platform_data;
>> + if (!pdata) {
>> + wl1271_error("no platform data");
>> + return -ENODEV;
>> + }
>> +
>> + pdriver = container_of(pdev->dev.driver, struct platform_driver,
>> + driver);
but you shouldn't fiddle with the driver structure here. What are you
actually trying to achieve here ? What's pinstance supposed to do ? are
you trying to handle cases where you might have several wl12xx chips on
the same board ? If that's the case you should have several platform
devices, one for each chip. They'll only have different ids.
--
balbi
DefectiveByDesign.org
^ permalink raw reply
* RE: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: DebBarma, Tarun Kanti @ 2010-08-11 18:52 UTC (permalink / raw)
To: felipe.balbi@nokia.com
Cc: Ohad Ben-Cohen, linux-wireless@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Ido Yariv,
Mark Brown, linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar, Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita, Vikram, Kalle Valo
In-Reply-To: <20100811184742.GA21778@nokia.com>
> -----Original Message-----
> From: Felipe Balbi [mailto:felipe.balbi@nokia.com]
> Sent: Thursday, August 12, 2010 12:18 AM
> To: DebBarma, Tarun Kanti
> Cc: Ohad Ben-Cohen; linux-wireless@vger.kernel.org; linux-
> mmc@vger.kernel.org; linux-omap@vger.kernel.org; Ido Yariv; Mark Brown;
> linux-arm-kernel@lists.infradead.org; Chikkature Rajashekar, Madhusudhan;
> Coelho Luciano (Nokia-MS/Helsinki); akpm@linux-foundation.org; San Mehat;
> Quadros Roger (Nokia-MS/Helsinki); Tony Lindgren; Nicolas Pitre; Pandita,
> Vikram; Kalle Valo
> Subject: Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get
> board data
>
> hi,
>
> On Wed, Aug 11, 2010 at 08:42:18PM +0200, ext DebBarma, Tarun Kanti wrote:
> >> @@ -182,10 +186,84 @@ static struct wl1271_if_operations sdio_ops = {
> >> .disable_irq = wl1271_sdio_disable_interrupts
> >> };
> >>
> >> +static int wl1271_plat_probe(struct platform_device *pdev)
> >> +{
> >> + struct wl12xx_platform_data *pdata;
> >> + struct platform_driver *pdriver;
> >> + struct wl12xx_plat_instance *pinstance;
> >> +
> >What about checking for pdev here before extracting pdata?
>
> why ? if probe is called pdev is guaranteed to be valid, no ?
>
True; however if we go by that argument than we can also assume pdata is valid, so that we would not need the below check.
Still, I would go ahead and find out if there is any scenario where pdev can go wrong during device registration. Thanks.
> >> + pdata = pdev->dev.platform_data;
> >> + if (!pdata) {
> >> + wl1271_error("no platform data");
> >> + return -ENODEV;
> >> + }
> >> +
> >> + pdriver = container_of(pdev->dev.driver, struct platform_driver,
> >> + driver);
>
> but you shouldn't fiddle with the driver structure here. What are you
> actually trying to achieve here ? What's pinstance supposed to do ? are
> you trying to handle cases where you might have several wl12xx chips on
> the same board ? If that's the case you should have several platform
> devices, one for each chip. They'll only have different ids.
>
> --
> balbi
>
> DefectiveByDesign.org
^ permalink raw reply
* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Felipe Balbi @ 2010-08-11 18:57 UTC (permalink / raw)
To: ext DebBarma, Tarun Kanti
Cc: Balbi Felipe (Nokia-MS/Helsinki), Ohad Ben-Cohen,
linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Ido Yariv, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar, Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita, Vikram, Kalle Valo
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0324110AC1@dbde02.ent.ti.com>
Hi,
On Wed, Aug 11, 2010 at 08:52:54PM +0200, ext DebBarma, Tarun Kanti wrote:
>True; however if we go by that argument than we can also assume pdata
>is valid, so that we would not need the below check.
of course not. You can have devices that just play well with default
values or devices where you don't need the flexibility of platform data.
That's why we check.
platform_device pointers on the other hand, are guaranteed to be always
true, if it isn't then you should oops, you deserve to oops because
something is really really wrong.
>Still, I would go ahead and find out if there is any scenario where
>pdev can go wrong during device registration. Thanks.
if that scenario ever happens, it's either a bug on your implementation
or driver-core. In both cases you deserve to oops so we catch such
problems at early stages.
--
balbi
DefectiveByDesign.org
^ permalink raw reply
* Compat-wireless release for 2010-08-11 is baked
From: Compat-wireless cronjob account @ 2010-08-11 19:09 UTC (permalink / raw)
To: linux-wireless
>From git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/compat
8a5dfc1..82eaf99 master -> origin/master
>From git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
dcf085f..38c112b history -> origin/history
+ 81e09f5...e71de56 master -> origin/master (forced update)
45d7f32..3d30701 stable -> origin/stable
* [new tag] next-20100811 -> next-20100811
compat-wireless code metrics
494636 - Total upstream lines of code being pulled
1699 - backport code changes
1460 - backport code additions
239 - backport code deletions
5979 - backport from compat module
7678 - total backport code
1.5523 - % of code consists of backport work
1218 - Crap changes not yet posted
1179 - Crap additions not yet posted
39 - Crap deletions not yet posted
0.2462 - % of crap code
Base tree: linux-next.git
Base tree version: next-20100811
compat-wireless release: compat-wireless-2010-08-03-4-g7746bc0
^ permalink raw reply
* [PATCH 1/2] ipw2100: register pm_qos request on hardware activation
From: Christoph Fritz @ 2010-08-11 19:31 UTC (permalink / raw)
To: John W. Linville
Cc: James Bottomley, Zhu Yi, David S. Miller, Joe Perches,
Rafael J. Wysocki, linux-wireless, netdev,
linux-kernel@vger.kernel.org
Function pm_qos_add_request() has to be called before first
pm_qos_update_request(). This was found out due to a change in pm_qos
(commit 82f682514a5df89ffb3890627eebf0897b7a84ec "pm_qos: Get rid of
the allocation in pm_qos_add_request()"). The warning call trace is below.
This patch is similar to c128ec29208d410568469bd8bb373b4cdc10912a "e1000e:
register pm_qos request on hardware activation".
WARNING: at kernel/pm_qos_params.c:264 pm_qos_update_request+0x5e/0x70()
pm_qos_update_request() called for unknown object
Call Trace:
[<c1024088>] ? warn_slowpath_common+0x78/0xb0
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1024153>] ? warn_slowpath_fmt+0x33/0x40
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<f89fe15f>] ? ipw2100_up+0x3f/0xf10 [ipw2100]
[<c11961c9>] ? vsnprintf+0xc9/0x530
[<f89ff36c>] ? ipw2100_net_init+0x2c/0x1c0 [ipw2100]
[<c12f542d>] ? register_netdevice+0x7d/0x3c0
[<f89f9b00>] ? ipw2100_irq_tasklet+0x910/0x9a0 [ipw2100]
[<c12f579f>] ? register_netdev+0x2f/0x40
[<f89fd471>] ? ipw2100_pci_init_one+0xd21/0x1060 [ipw2100]
[<c11a5ebb>] ? local_pci_probe+0xb/0x10
[<c11a6d49>] ? pci_device_probe+0x69/0x90
[<c1224704>] ? driver_probe_device+0x74/0x180
[<c10dd15a>] ? sysfs_create_dir+0x6a/0xb0
[<c1224889>] ? __driver_attach+0x79/0x80
[<c1224810>] ? __driver_attach+0x0/0x80
[<c1223fa2>] ? bus_for_each_dev+0x52/0x80
[<c1224586>] ? driver_attach+0x16/0x20
[<c1224810>] ? __driver_attach+0x0/0x80
[<c122395f>] ? bus_add_driver+0x17f/0x250
[<c11a5ec0>] ? pci_device_shutdown+0x0/0x20
[<c11a6c80>] ? pci_device_remove+0x0/0x40
[<c1224b13>] ? driver_register+0x63/0x120
[<c11a6f96>] ? __pci_register_driver+0x36/0xa0
[<f84f9048>] ? ipw2100_init+0x48/0x67 [ipw2100]
[<c1001122>] ? do_one_initcall+0x32/0x170
[<c1087078>] ? __vunmap+0xb8/0xf0
[<f84f9000>] ? ipw2100_init+0x0/0x67 [ipw2100]
[<c10510c1>] ? sys_init_module+0x161/0x1000
[<c108f847>] ? sys_close+0x67/0xe0
[<c13647c1>] ? syscall_call+0x7/0xb
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 16bbfa3..df8e535 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1909,6 +1909,9 @@ static int ipw2100_net_init(struct net_device *dev)
int ret;
int i;
+ pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
+
ret = ipw2100_up(priv, 1);
if (ret)
return ret;
@@ -1962,6 +1965,12 @@ static int ipw2100_net_init(struct net_device *dev)
return 0;
}
+/* Called by unregister_netdev() */
+static void ipw2100_net_uninit(struct net_device *dev)
+{
+ pm_qos_remove_request(&ipw2100_pm_qos_req);
+}
+
static void ipw2100_reset_adapter(struct work_struct *work)
{
struct ipw2100_priv *priv =
@@ -6092,11 +6101,12 @@ static void ipw2100_rf_kill(struct work_struct *work)
static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
static const struct net_device_ops ipw2100_netdev_ops = {
+ .ndo_init = ipw2100_net_init,
+ .ndo_uninit = ipw2100_net_uninit,
.ndo_open = ipw2100_open,
.ndo_stop = ipw2100_close,
.ndo_start_xmit = libipw_xmit,
.ndo_change_mtu = libipw_change_mtu,
- .ndo_init = ipw2100_net_init,
.ndo_tx_timeout = ipw2100_tx_timeout,
.ndo_set_mac_address = ipw2100_set_address,
.ndo_validate_addr = eth_validate_addr,
@@ -6669,8 +6679,6 @@ static int __init ipw2100_init(void)
if (ret)
goto out;
- pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
- PM_QOS_DEFAULT_VALUE);
#ifdef CONFIG_IPW2100_DEBUG
ipw2100_debug_level = debug;
ret = driver_create_file(&ipw2100_pci_driver.driver,
@@ -6692,7 +6700,6 @@ static void __exit ipw2100_exit(void)
&driver_attr_debug_level);
#endif
pci_unregister_driver(&ipw2100_pci_driver);
- pm_qos_remove_request(&ipw2100_pm_qos_req);
}
module_init(ipw2100_init);
--
1.7.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox