Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Ohad Ben-Cohen @ 2010-08-12  6:40 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: DebBarma, Tarun Kanti, felipe.balbi@nokia.com, Kalle Valo,
	Pandita, Vikram, akpm@linux-foundation.org,
	Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
	linux-wireless@vger.kernel.org, Mark Brown,
	linux-mmc@vger.kernel.org, Nicolas Pitre, San Mehat,
	Chikkature Rajashekar, Madhusudhan,
	Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
	Ido Yariv, linux-arm-kernel@lists.infradead.org
In-Reply-To: <20100811212513.GC827@n2100.arm.linux.org.uk>

On Thu, Aug 12, 2010 at 12:25 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
>I've outlined a far simpler and easiler solution
> which avoids this kind of abuse, and given suggestions on how to extend
> it to support multiple instances.
>

Do you mean:
http://www.spinics.net/lists/arm-kernel/msg95338.html
?

I was under the impression you eventually discarded that approach in that post.

Please tell me if you still support it,

Thanks,
Ohad.

^ permalink raw reply

* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board  data
From: Felipe Balbi @ 2010-08-12  5:27 UTC (permalink / raw)
  To: ext Ohad Ben-Cohen
  Cc: Balbi Felipe (Nokia-MS/Helsinki), ext DebBarma, Tarun Kanti,
	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: <AANLkTikLbiJ8PsUbSnmYrfY6oNW4okejf-UdyQyfYbUz@mail.gmail.com>

Hi,

On Wed, Aug 11, 2010 at 10:10:38PM +0200, ext Ohad Ben-Cohen wrote:
>Think of several wl1271 devices, each of which is represented by two
>devices; an SDIO function, and a platform device. The SDIO function
>stands for a specific MMC controller the device is hardwired to, and
>the platform device stands for the external irq line that the device
>is hardwired to.
>
>We must couple the SDIO function with the correct platform device,
>otherwise it will start getting the wrong interrupts. So after the
>SDIO function is probed, it registers a platform driver with the
>unique name that represents the platform device that it is coupled
>with. When the platform device is probed, it needs to deliver its
>platform data info to the specific SDIO function that it is bound
>with.
>
>To avoid using some global data structure in that driver, we allocate
>a unique platform driver per each device, which makes it possible for
>the platform driver probe to find the SDIO function context by means
>of container_of.
>
>Alternatively, we can also use some global structure in that file,
>most probably idr, which would also make it possible to reach the SDIO
>function contexts without going through the driver structure. The idr
>indexes would then be the MMC controller index, which should match
>the platform device id.
>
>I'll try this out, it might actually look nicer.

you need no globals and you don't need to fiddle with driver structures 
either.

Just make an sdio driver that platform_device_alloc() and pass in a 
platform_data, builds struct resources etc for each device found on the 
sdio bus. Similarly for the SPI-connected wifi chip.

You should never fiddle with internal structures. If you want to look at 
an example implementation, take a look at drivers/mfd/twl-core.c, there 
we use an i2c driver to instantiate several platform_devices. Nobody 
fiddles with driver structures and all the drivers are logically 
separated into their own source files.

-- 
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-12  5:21 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: <5A47E75E594F054BAF48C5E4FC4B92AB0324110AC7@dbde02.ent.ti.com>

Hi,

On Wed, Aug 11, 2010 at 09:27:18PM +0200, ext DebBarma, Tarun Kanti wrote:
>Sounds perfect!
>What that means is _probe() function makes sense only for cases where 
>we have valid platform data because we are returning right at the top 
>if pdata is not valid. If this is the case I was curious to know why 
>not framework make another check for valid pdata before calling 
>_probe() instead of coming all the way to _probe() and then returning!

because pdata is completely optional. pdev OTOH isn't. Without a matched 
platform_device, your probe() won't get called.

-- 
balbi

DefectiveByDesign.org

^ permalink raw reply

* Re: [PATCH 3/5] mac80211: remove unused status flag checks
From: Juuso Oikarinen @ 2010-08-12  4:57 UTC (permalink / raw)
  To: ext Johannes Berg; +Cc: John Linville, linux-wireless@vger.kernel.org
In-Reply-To: <1281530356.3674.3.camel@jlt3.sipsolutions.net>

On Wed, 2010-08-11 at 14:39 +0200, ext Johannes Berg wrote:
> On Wed, 2010-08-11 at 15:12 +0300, Juuso Oikarinen wrote:
> 
> > > > The decryption code verifies whether or not
> > > > a given frame was decrypted and verified by
> > > > hardware. This is unnecessary, as the crypto
> > > > RX handler already does it long before the
> > > > decryption code is even invoked, so remove
> > > > that code to avoid confusion.
> > > > 
> > > > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> > > > ---
> > > >  net/mac80211/wpa.c |   26 ++++++--------------------
> > > >  1 file changed, 6 insertions(+), 20 deletions(-)
> > > > 
> > > 
> > > This patch for some reason seems to break wl1271 WPA - association
> > > succeeds but encrypted data transfer fails.
> > > 
> > > I still don't know why, but I'm looking into it.
> > > 
> > 
> > It appears, that in function ieee80211_rx_h_decrypt we go here:
> > 
> > 	if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
> > 		rx->key = stakey;
> > 		/* Skip decryption if the frame is not protected. */
> > 		if (!ieee80211_has_protected(hdr->frame_control))
> > 			return RX_CONTINUE;
> > 
> > And here, as the frame is protected, we go out of the if, and end up in
> > tkip_decrypt, which with this patch no longer checks whether the frame
> > is already decrypted.
> > 
> > The frame then ends up dropped.
> 
> Err, you're right, sorry about that. There are too many paths here. How
> about this patch?
> 
> johannes
> 
> --- wireless-testing.orig/net/mac80211/rx.c	2010-08-11 14:37:13.000000000 +0200
> +++ wireless-testing/net/mac80211/rx.c	2010-08-11 14:38:13.000000000 +0200
> @@ -873,6 +873,9 @@ ieee80211_rx_h_decrypt(struct ieee80211_
>  
>  	if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
>  		rx->key = stakey;
> +		if ((status->flag & RX_FLAG_DECRYPTED) &&
> +		    (status->flag & RX_FLAG_IV_STRIPPED))
> +			return RX_CONTINUE;
>  		/* Skip decryption if the frame is not protected. */
>  		if (!ieee80211_has_protected(fc))
>  			return RX_CONTINUE;
> 
> 

This appears to work.

-Juus


^ permalink raw reply

* drivers/net/wireless: Restore upper case words in wiphy_<level> messages
From: Joe Perches @ 2010-08-12  2:11 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless, John W. Linville
In-Reply-To: <201008112131.01906.chunkeey@googlemail.com>

Commit c96c31e499b70964cfc88744046c998bb710e4b8
"(drivers/net/wireless: Use wiphy_<level>)"
inadvertently changed some upper case words to
lower case.  Restore the original case.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/adm8211.c                 |    8 +++---
 drivers/net/wireless/at76c50x-usb.c            |   22 +++++++-------
 drivers/net/wireless/ath/ar9170/main.c         |    4 +-
 drivers/net/wireless/mac80211_hwsim.c          |    2 +-
 drivers/net/wireless/mwl8k.c                   |   34 ++++++++++++------------
 drivers/net/wireless/p54/eeprom.c              |    6 ++--
 drivers/net/wireless/p54/fwio.c                |    2 +-
 drivers/net/wireless/p54/led.c                 |    4 +-
 drivers/net/wireless/p54/p54pci.c              |    2 +-
 drivers/net/wireless/p54/txrx.c                |    2 +-
 drivers/net/wireless/rtl818x/rtl8180_dev.c     |    6 ++--
 drivers/net/wireless/rtl818x/rtl8187_dev.c     |    4 +-
 drivers/net/wireless/rtl818x/rtl8187_rtl8225.c |    4 +-
 13 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 382ae72..f9aa1bc 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -732,7 +732,7 @@ static int adm8211_rf_set_channel(struct ieee80211_hw *dev, unsigned int chan)
 
 	/* Nothing to do for ADMtek BBP */
 	} else if (priv->bbp_type != ADM8211_TYPE_ADMTEK)
-		wiphy_debug(dev->wiphy, "unsupported bbp type %d\n",
+		wiphy_debug(dev->wiphy, "unsupported BBP type %d\n",
 			    priv->bbp_type);
 
 	ADM8211_RESTORE();
@@ -1032,7 +1032,7 @@ static int adm8211_hw_init_bbp(struct ieee80211_hw *dev)
 			break;
 		}
 	} else
-		wiphy_debug(dev->wiphy, "unsupported bbp %d\n", priv->bbp_type);
+		wiphy_debug(dev->wiphy, "unsupported BBP %d\n", priv->bbp_type);
 
 	ADM8211_CSR_WRITE(SYNRF, 0);
 
@@ -1525,7 +1525,7 @@ static int adm8211_start(struct ieee80211_hw *dev)
 	retval = request_irq(priv->pdev->irq, adm8211_interrupt,
 			     IRQF_SHARED, "adm8211", dev);
 	if (retval) {
-		wiphy_err(dev->wiphy, "failed to register irq handler\n");
+		wiphy_err(dev->wiphy, "failed to register IRQ handler\n");
 		goto fail;
 	}
 
@@ -1902,7 +1902,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 		goto err_free_eeprom;
 	}
 
-	wiphy_info(dev->wiphy, "hwaddr %pM, rev 0x%02x\n",
+	wiphy_info(dev->wiphy, "hwaddr %pM, Rev 0x%02x\n",
 		   dev->wiphy->perm_addr, pdev->revision);
 
 	return 0;
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index b1c2667..1128fa8 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -655,7 +655,7 @@ static int at76_get_hw_config(struct at76_priv *priv)
 exit:
 	kfree(hwcfg);
 	if (ret < 0)
-		wiphy_err(priv->hw->wiphy, "cannot get hw config (error %d)\n",
+		wiphy_err(priv->hw->wiphy, "cannot get HW Config (error %d)\n",
 			  ret);
 
 	return ret;
@@ -960,7 +960,7 @@ static void at76_dump_mib_mac_addr(struct at76_priv *priv)
 			   sizeof(struct mib_mac_addr));
 	if (ret < 0) {
 		wiphy_err(priv->hw->wiphy,
-			  "at76_get_mib (mac_addr) failed: %d\n", ret);
+			  "at76_get_mib (MAC_ADDR) failed: %d\n", ret);
 		goto exit;
 	}
 
@@ -989,7 +989,7 @@ static void at76_dump_mib_mac_wep(struct at76_priv *priv)
 			   sizeof(struct mib_mac_wep));
 	if (ret < 0) {
 		wiphy_err(priv->hw->wiphy,
-			  "at76_get_mib (mac_wep) failed: %d\n", ret);
+			  "at76_get_mib (MAC_WEP) failed: %d\n", ret);
 		goto exit;
 	}
 
@@ -1026,7 +1026,7 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv)
 			   sizeof(struct mib_mac_mgmt));
 	if (ret < 0) {
 		wiphy_err(priv->hw->wiphy,
-			  "at76_get_mib (mac_mgmt) failed: %d\n", ret);
+			  "at76_get_mib (MAC_MGMT) failed: %d\n", ret);
 		goto exit;
 	}
 
@@ -1062,7 +1062,7 @@ static void at76_dump_mib_mac(struct at76_priv *priv)
 	ret = at76_get_mib(priv->udev, MIB_MAC, m, sizeof(struct mib_mac));
 	if (ret < 0) {
 		wiphy_err(priv->hw->wiphy,
-			  "at76_get_mib (mac) failed: %d\n", ret);
+			  "at76_get_mib (MAC) failed: %d\n", ret);
 		goto exit;
 	}
 
@@ -1099,7 +1099,7 @@ static void at76_dump_mib_phy(struct at76_priv *priv)
 	ret = at76_get_mib(priv->udev, MIB_PHY, m, sizeof(struct mib_phy));
 	if (ret < 0) {
 		wiphy_err(priv->hw->wiphy,
-			  "at76_get_mib (phy) failed: %d\n", ret);
+			  "at76_get_mib (PHY) failed: %d\n", ret);
 		goto exit;
 	}
 
@@ -1132,7 +1132,7 @@ static void at76_dump_mib_local(struct at76_priv *priv)
 	ret = at76_get_mib(priv->udev, MIB_LOCAL, m, sizeof(struct mib_local));
 	if (ret < 0) {
 		wiphy_err(priv->hw->wiphy,
-			  "at76_get_mib (local) failed: %d\n", ret);
+			  "at76_get_mib (LOCAL) failed: %d\n", ret);
 		goto exit;
 	}
 
@@ -1158,7 +1158,7 @@ static void at76_dump_mib_mdomain(struct at76_priv *priv)
 			   sizeof(struct mib_mdomain));
 	if (ret < 0) {
 		wiphy_err(priv->hw->wiphy,
-			  "at76_get_mib (mdomain) failed: %d\n", ret);
+			  "at76_get_mib (MDOMAIN) failed: %d\n", ret);
 		goto exit;
 	}
 
@@ -1229,7 +1229,7 @@ static int at76_submit_rx_urb(struct at76_priv *priv)
 	struct sk_buff *skb = priv->rx_skb;
 
 	if (!priv->rx_urb) {
-		wiphy_err(priv->hw->wiphy, "%s: priv->rx_urb is null\n",
+		wiphy_err(priv->hw->wiphy, "%s: priv->rx_urb is NULL\n",
 			  __func__);
 		return -EFAULT;
 	}
@@ -1792,7 +1792,7 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 		wiphy_err(priv->hw->wiphy, "error in tx submit urb: %d\n", ret);
 		if (ret == -EINVAL)
 			wiphy_err(priv->hw->wiphy,
-				  "-einval: tx urb %p hcpriv %p complete %p\n",
+				  "-EINVAL: tx urb %p hcpriv %p complete %p\n",
 				  priv->tx_urb,
 				  priv->tx_urb->hcpriv, priv->tx_urb->complete);
 	}
@@ -2310,7 +2310,7 @@ static int at76_init_new_device(struct at76_priv *priv,
 
 	priv->mac80211_registered = 1;
 
-	wiphy_info(priv->hw->wiphy, "usb %s, mac %pM, firmware %d.%d.%d-%d\n",
+	wiphy_info(priv->hw->wiphy, "USB %s, MAC %pM, firmware %d.%d.%d-%d\n",
 		   dev_name(&interface->dev), priv->mac_addr,
 		   priv->fw_version.major, priv->fw_version.minor,
 		   priv->fw_version.patch, priv->fw_version.build);
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index cabf57f..25ad97e 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -245,7 +245,7 @@ static void __ar9170_dump_txstats(struct ar9170 *ar)
 {
 	int i;
 
-	wiphy_debug(ar->hw->wiphy, "qos queue stats\n");
+	wiphy_debug(ar->hw->wiphy, "QoS queue stats\n");
 
 	for (i = 0; i < __AR9170_NUM_TXQ; i++)
 		wiphy_debug(ar->hw->wiphy,
@@ -387,7 +387,7 @@ static struct sk_buff *ar9170_get_queued_skb(struct ar9170 *ar,
 		if (mac && compare_ether_addr(ieee80211_get_DA(hdr), mac)) {
 #ifdef AR9170_QUEUE_DEBUG
 			wiphy_debug(ar->hw->wiphy,
-				    "skip frame => da %pM != %pM\n",
+				    "skip frame => DA %pM != %pM\n",
 				    mac, ieee80211_get_DA(hdr));
 			ar9170_print_txheader(ar, skb);
 #endif /* AR9170_QUEUE_DEBUG */
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 05d179a..db93969 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -486,7 +486,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
 	struct ieee80211_rx_status rx_status;
 
 	if (data->idle) {
-		wiphy_debug(hw->wiphy, "trying to tx when idle - reject\n");
+		wiphy_debug(hw->wiphy, "Trying to TX when idle - reject\n");
 		return false;
 	}
 
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 31888da..15ebb50 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -910,14 +910,14 @@ static int mwl8k_rxq_init(struct ieee80211_hw *hw, int index)
 
 	rxq->rxd = pci_alloc_consistent(priv->pdev, size, &rxq->rxd_dma);
 	if (rxq->rxd == NULL) {
-		wiphy_err(hw->wiphy, "failed to alloc rx descriptors\n");
+		wiphy_err(hw->wiphy, "failed to alloc RX descriptors\n");
 		return -ENOMEM;
 	}
 	memset(rxq->rxd, 0, size);
 
 	rxq->buf = kmalloc(MWL8K_RX_DESCS * sizeof(*rxq->buf), GFP_KERNEL);
 	if (rxq->buf == NULL) {
-		wiphy_err(hw->wiphy, "failed to alloc rx skbuff list\n");
+		wiphy_err(hw->wiphy, "failed to alloc RX skbuff list\n");
 		pci_free_consistent(priv->pdev, size, rxq->rxd, rxq->rxd_dma);
 		return -ENOMEM;
 	}
@@ -1145,14 +1145,14 @@ static int mwl8k_txq_init(struct ieee80211_hw *hw, int index)
 
 	txq->txd = pci_alloc_consistent(priv->pdev, size, &txq->txd_dma);
 	if (txq->txd == NULL) {
-		wiphy_err(hw->wiphy, "failed to alloc tx descriptors\n");
+		wiphy_err(hw->wiphy, "failed to alloc TX descriptors\n");
 		return -ENOMEM;
 	}
 	memset(txq->txd, 0, size);
 
 	txq->skb = kmalloc(MWL8K_TX_DESCS * sizeof(*txq->skb), GFP_KERNEL);
 	if (txq->skb == NULL) {
-		wiphy_err(hw->wiphy, "failed to alloc tx skbuff list\n");
+		wiphy_err(hw->wiphy, "failed to alloc TX skbuff list\n");
 		pci_free_consistent(priv->pdev, size, txq->txd, txq->txd_dma);
 		return -ENOMEM;
 	}
@@ -1573,7 +1573,7 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
 					PCI_DMA_BIDIRECTIONAL);
 
 	if (!timeout) {
-		wiphy_err(hw->wiphy, "command %s timeout after %u ms\n",
+		wiphy_err(hw->wiphy, "Command %s timeout after %u ms\n",
 			  mwl8k_cmd_name(cmd->code, buf, sizeof(buf)),
 			  MWL8K_CMD_TIMEOUT_MS);
 		rc = -ETIMEDOUT;
@@ -1584,11 +1584,11 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
 
 		rc = cmd->result ? -EINVAL : 0;
 		if (rc)
-			wiphy_err(hw->wiphy, "command %s error 0x%x\n",
+			wiphy_err(hw->wiphy, "Command %s error 0x%x\n",
 				  mwl8k_cmd_name(cmd->code, buf, sizeof(buf)),
 				  le16_to_cpu(cmd->result));
 		else if (ms > 2000)
-			wiphy_notice(hw->wiphy, "command %s took %d ms\n",
+			wiphy_notice(hw->wiphy, "Command %s took %d ms\n",
 				     mwl8k_cmd_name(cmd->code,
 						    buf, sizeof(buf)),
 				     ms);
@@ -3210,7 +3210,7 @@ static int mwl8k_start(struct ieee80211_hw *hw)
 	rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
 			 IRQF_SHARED, MWL8K_NAME, hw);
 	if (rc) {
-		wiphy_err(hw->wiphy, "failed to register irq handler\n");
+		wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
 		return -EIO;
 	}
 
@@ -3926,7 +3926,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 
 	priv->sram = pci_iomap(pdev, 0, 0x10000);
 	if (priv->sram == NULL) {
-		wiphy_err(hw->wiphy, "cannot map device sram\n");
+		wiphy_err(hw->wiphy, "Cannot map device SRAM\n");
 		goto err_iounmap;
 	}
 
@@ -3938,7 +3938,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 	if (priv->regs == NULL) {
 		priv->regs = pci_iomap(pdev, 2, 0x10000);
 		if (priv->regs == NULL) {
-			wiphy_err(hw->wiphy, "cannot map device registers\n");
+			wiphy_err(hw->wiphy, "Cannot map device registers\n");
 			goto err_iounmap;
 		}
 	}
@@ -3950,14 +3950,14 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 	/* Ask userland hotplug daemon for the device firmware */
 	rc = mwl8k_request_firmware(priv);
 	if (rc) {
-		wiphy_err(hw->wiphy, "firmware files not found\n");
+		wiphy_err(hw->wiphy, "Firmware files not found\n");
 		goto err_stop_firmware;
 	}
 
 	/* Load firmware into hardware */
 	rc = mwl8k_load_firmware(hw);
 	if (rc) {
-		wiphy_err(hw->wiphy, "cannot start firmware\n");
+		wiphy_err(hw->wiphy, "Cannot start firmware\n");
 		goto err_stop_firmware;
 	}
 
@@ -4047,7 +4047,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 	rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
 			 IRQF_SHARED, MWL8K_NAME, hw);
 	if (rc) {
-		wiphy_err(hw->wiphy, "failed to register irq handler\n");
+		wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
 		goto err_free_queues;
 	}
 
@@ -4067,7 +4067,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 		rc = mwl8k_cmd_get_hw_spec_sta(hw);
 	}
 	if (rc) {
-		wiphy_err(hw->wiphy, "cannot initialise firmware\n");
+		wiphy_err(hw->wiphy, "Cannot initialise firmware\n");
 		goto err_free_irq;
 	}
 
@@ -4081,14 +4081,14 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 	/* Turn radio off */
 	rc = mwl8k_cmd_radio_disable(hw);
 	if (rc) {
-		wiphy_err(hw->wiphy, "cannot disable\n");
+		wiphy_err(hw->wiphy, "Cannot disable\n");
 		goto err_free_irq;
 	}
 
 	/* Clear MAC address */
 	rc = mwl8k_cmd_set_mac_addr(hw, NULL, "\x00\x00\x00\x00\x00\x00");
 	if (rc) {
-		wiphy_err(hw->wiphy, "cannot clear mac address\n");
+		wiphy_err(hw->wiphy, "Cannot clear MAC address\n");
 		goto err_free_irq;
 	}
 
@@ -4098,7 +4098,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 
 	rc = ieee80211_register_hw(hw);
 	if (rc) {
-		wiphy_err(hw->wiphy, "cannot register device\n");
+		wiphy_err(hw->wiphy, "Cannot register device\n");
 		goto err_free_queues;
 	}
 
diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
index 92facc3..78347041 100644
--- a/drivers/net/wireless/p54/eeprom.c
+++ b/drivers/net/wireless/p54/eeprom.c
@@ -167,7 +167,7 @@ static int p54_generate_band(struct ieee80211_hw *dev,
 	}
 
 	if (j == 0) {
-		wiphy_err(dev->wiphy, "disabling totally damaged %d GHz band\n",
+		wiphy_err(dev->wiphy, "Disabling totally damaged %d GHz band\n",
 			  (band == IEEE80211_BAND_2GHZ) ? 2 : 5);
 
 		ret = -ENODATA;
@@ -695,12 +695,12 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
 		u8 perm_addr[ETH_ALEN];
 
 		wiphy_warn(dev->wiphy,
-			   "invalid hwaddr! using randomly generated mac addr\n");
+			   "Invalid hwaddr! Using randomly generated MAC addr\n");
 		random_ether_addr(perm_addr);
 		SET_IEEE80211_PERM_ADDR(dev, perm_addr);
 	}
 
-	wiphy_info(dev->wiphy, "hwaddr %pM, mac:isl38%02x rf:%s\n",
+	wiphy_info(dev->wiphy, "hwaddr %pM, MAC:isl38%02x RF:%s\n",
 		   dev->wiphy->perm_addr, priv->version,
 		   p54_rf_chips[priv->rxhw]);
 
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c
index 47006bc..15b20c2 100644
--- a/drivers/net/wireless/p54/fwio.c
+++ b/drivers/net/wireless/p54/fwio.c
@@ -125,7 +125,7 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
 
 	if (fw_version)
 		wiphy_info(priv->hw->wiphy,
-			   "fw rev %s - softmac protocol %x.%x\n",
+			   "FW rev %s - Softmac protocol %x.%x\n",
 			   fw_version, priv->fw_var >> 8, priv->fw_var & 0xff);
 
 	if (priv->fw_var < 0x500)
diff --git a/drivers/net/wireless/p54/led.c b/drivers/net/wireless/p54/led.c
index ea91f5c..3837e1e 100644
--- a/drivers/net/wireless/p54/led.c
+++ b/drivers/net/wireless/p54/led.c
@@ -58,7 +58,7 @@ static void p54_update_leds(struct work_struct *work)
 	err = p54_set_leds(priv);
 	if (err && net_ratelimit())
 		wiphy_err(priv->hw->wiphy,
-			  "failed to update leds (%d).\n", err);
+			  "failed to update LEDs (%d).\n", err);
 
 	if (rerun)
 		ieee80211_queue_delayed_work(priv->hw, &priv->led_work,
@@ -103,7 +103,7 @@ static int p54_register_led(struct p54_common *priv,
 	err = led_classdev_register(wiphy_dev(priv->hw->wiphy), &led->led_dev);
 	if (err)
 		wiphy_err(priv->hw->wiphy,
-			  "failed to register %s led.\n", name);
+			  "Failed to register %s LED.\n", name);
 	else
 		led->registered = 1;
 
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index 71a101f..da9adca 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -468,7 +468,7 @@ static int p54p_open(struct ieee80211_hw *dev)
 	P54P_READ(dev_int);
 
 	if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) {
-		wiphy_err(dev->wiphy, "cannot boot firmware!\n");
+		wiphy_err(dev->wiphy, "Cannot boot firmware!\n");
 		p54p_stop(dev);
 		return -ETIMEDOUT;
 	}
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 427b46f..173aec3 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -540,7 +540,7 @@ static void p54_rx_trap(struct p54_common *priv, struct sk_buff *skb)
 	case P54_TRAP_BEACON_TX:
 		break;
 	case P54_TRAP_RADAR:
-		wiphy_info(priv->hw->wiphy, "radar (freq:%d mhz)\n", freq);
+		wiphy_info(priv->hw->wiphy, "radar (freq:%d MHz)\n", freq);
 		break;
 	case P54_TRAP_NO_BEACON:
 		if (priv->vif)
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index 67b3227..490b668 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -445,7 +445,7 @@ static int rtl8180_init_rx_ring(struct ieee80211_hw *dev)
 					     &priv->rx_ring_dma);
 
 	if (!priv->rx_ring || (unsigned long)priv->rx_ring & 0xFF) {
-		wiphy_err(dev->wiphy, "cannot allocate rx ring\n");
+		wiphy_err(dev->wiphy, "Cannot allocate RX ring\n");
 		return -ENOMEM;
 	}
 
@@ -502,7 +502,7 @@ static int rtl8180_init_tx_ring(struct ieee80211_hw *dev,
 
 	ring = pci_alloc_consistent(priv->pdev, sizeof(*ring) * entries, &dma);
 	if (!ring || (unsigned long)ring & 0xFF) {
-		wiphy_err(dev->wiphy, "cannot allocate tx ring (prio = %d)\n",
+		wiphy_err(dev->wiphy, "Cannot allocate TX ring (prio = %d)\n",
 			  prio);
 		return -ENOMEM;
 	}
@@ -568,7 +568,7 @@ static int rtl8180_start(struct ieee80211_hw *dev)
 	ret = request_irq(priv->pdev->irq, rtl8180_interrupt,
 			  IRQF_SHARED, KBUILD_MODNAME, dev);
 	if (ret) {
-		wiphy_err(dev->wiphy, "failed to register irq handler\n");
+		wiphy_err(dev->wiphy, "failed to register IRQ handler\n");
 		goto err_free_rings;
 	}
 
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index efa2860..98e0351 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -573,7 +573,7 @@ static int rtl8187_cmd_reset(struct ieee80211_hw *dev)
 	} while (--i);
 
 	if (!i) {
-		wiphy_err(dev->wiphy, "reset timeout!\n");
+		wiphy_err(dev->wiphy, "Reset timeout!\n");
 		return -ETIMEDOUT;
 	}
 
@@ -1526,7 +1526,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
 	mutex_init(&priv->conf_mutex);
 	skb_queue_head_init(&priv->b_tx_status.queue);
 
-	wiphy_info(dev->wiphy, "hwaddr %pM, %s v%d + %s, rfkill mask %d\n",
+	wiphy_info(dev->wiphy, "hwaddr %pM, %s V%d + %s, rfkill mask %d\n",
 		   mac_addr, chip_name, priv->asic_rev, priv->rf->name,
 		   priv->rfkill_mask);
 
diff --git a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
index fd96f91..97eebdc 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
@@ -366,7 +366,7 @@ static void rtl8225_rf_init(struct ieee80211_hw *dev)
 		rtl8225_write(dev, 0x02, 0x044d);
 		msleep(100);
 		if (!(rtl8225_read(dev, 6) & (1 << 7)))
-			wiphy_warn(dev->wiphy, "rf calibration failed! %x\n",
+			wiphy_warn(dev->wiphy, "RF Calibration Failed! %x\n",
 				   rtl8225_read(dev, 6));
 	}
 
@@ -735,7 +735,7 @@ static void rtl8225z2_rf_init(struct ieee80211_hw *dev)
 		rtl8225_write(dev, 0x02, 0x044D);
 		msleep(100);
 		if (!(rtl8225_read(dev, 6) & (1 << 7)))
-			wiphy_warn(dev->wiphy, "rf calibration failed! %x\n",
+			wiphy_warn(dev->wiphy, "RF Calibration Failed! %x\n",
 				   rtl8225_read(dev, 6));
 	}
 



^ permalink raw reply related

* Re: [PATCH 2/2] ipw2100: add WEXT scan capabilities
From: Dan Williams @ 2010-08-11 23:32 UTC (permalink / raw)
  To: Christoph Fritz
  Cc: John W. Linville, Zhu Yi, David S. Miller, Joe Perches,
	Rafael J. Wysocki, linux-wireless, netdev,
	linux-kernel@vger.kernel.org
In-Reply-To: <1281555195.4367.3.camel@lovely.krouter>

On Wed, 2010-08-11 at 21:33 +0200, Christoph Fritz wrote:
> NetworkManager claims: "driver does not support SSID scans (scan_capa
> 0x00)". This patch adds scan capabilities.

NAK

It just doesn't.  Take a look at ipw2100_wx_set_scan(); there's no
handling of any SSID stuff in there.  The driver does not support
probe-scans; I'm not sure if the firmware does, but even if it does, the
driver doesn't send the SSID down to the firmware.

Compare this to the ipw2200.c set_scan() function.  It just does not
appear that the ipw2100 supports arbitrary SSIDs for direct scans, which
is why I didn't include this capability when I went around patching the
drivers a few years ago.

Dan


> Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
> ---
>  drivers/net/wireless/ipw2x00/ipw2100.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index df8e535..c330da4 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -6982,12 +6982,15 @@ static int ipw2100_wx_get_range(struct net_device *dev,
>  
>  	/* Event capability (kernel + driver) */
>  	range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
> -				IW_EVENT_CAPA_MASK(SIOCGIWAP));
> +				IW_EVENT_CAPA_MASK(SIOCGIWAP) |
> +				IW_EVENT_CAPA_MASK(SIOCGIWSCAN));
>  	range->event_capa[1] = IW_EVENT_CAPA_K_1;
>  
>  	range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
>  		IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
>  
> +	range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_TYPE;
> +
>  	IPW_DEBUG_WX("GET Range\n");
>  
>  	return 0;



^ permalink raw reply

* Re: [PATCH v4 2/8] wireless: wl1271: support return value for the set power func
From: Ohad Ben-Cohen @ 2010-08-11 22:19 UTC (permalink / raw)
  To: DebBarma, Tarun Kanti
  Cc: 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, Luciano Coelho,
	akpm@linux-foundation.org, San Mehat, Roger Quadros,
	Tony Lindgren, Nicolas Pitre, Pandita, Vikram, Kalle Valo
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0324110ABB@dbde02.ent.ti.com>

On Wed, Aug 11, 2010 at 9:35 PM, DebBarma, Tarun Kanti
<tarun.kanti@ti.com> wrote:
>> -     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?


Can't hurt, thanks.


>> +     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 v4 3/8] wireless: wl1271: add platform driver to get board data
From: Ohad Ben-Cohen @ 2010-08-11 22:18 UTC (permalink / raw)
  To: Vitaly Wool
  Cc: felipe.balbi, Kalle Valo, Pandita, Vikram,
	akpm@linux-foundation.org, Quadros Roger (Nokia-MS/Helsinki),
	Tony Lindgren, linux-wireless@vger.kernel.org, Nicolas Pitre,
	Mark Brown, linux-mmc@vger.kernel.org, Ido Yariv, San Mehat,
	Chikkature Rajashekar, Madhusudhan,
	Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
	ext DebBarma, Tarun Kanti, linux-arm-kernel@lists.infradead.org
In-Reply-To: <AANLkTinu8vvPRf=78n2LaX4KQMS9tQRCbg7UUHG1ZO5W@mail.gmail.com>

Hi Vitaly,

On Thu, Aug 12, 2010 at 12:34 AM, Vitaly Wool <vitalywool@gmail.com> wrote:
> On Wed, Aug 11, 2010 at 10:10 PM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
>> Think of several wl1271 devices, each of which is represented by two
>> devices; an SDIO function, and a platform device. The SDIO function
>> stands for a specific MMC controller the device is hardwired to, and
>> the platform device stands for the external irq line that the device
>> is hardwired to.
>
> my view on this is that you're hunting the false problem here. I
> wonder how likely it is that two hardwired WL12xx chips are there on
> the same board.
>
> It's theoretically possible that there's one hardwired device and one
> hot-pluggable one but the latter one can't have platform_data anyway.

We do have strange-looking setups with two hardwired devices
(especially on new bring-ups), so it would be nice not to limit the
driver to a single device. But I agree, it's far from being important.

Thanks,
Ohad.

>
> So in my opinion, we either should keep things simple and consider 2
> hardwired WL12XX's to be a very very unlikely case, or we'll end up
> discussing board_info once again.
>
> Thanks,
>   Vitaly
>

^ permalink raw reply

* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Ohad Ben-Cohen @ 2010-08-11 22:15 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: DebBarma, Tarun Kanti, felipe.balbi@nokia.com, Kalle Valo,
	Pandita, Vikram, akpm@linux-foundation.org,
	Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
	linux-wireless@vger.kernel.org, Mark Brown,
	linux-mmc@vger.kernel.org, Nicolas Pitre, San Mehat,
	Chikkature Rajashekar, Madhusudhan,
	Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
	Ido Yariv, linux-arm-kernel@lists.infradead.org
In-Reply-To: <20100811212513.GC827@n2100.arm.linux.org.uk>

On Thu, Aug 12, 2010 at 12:25 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Thu, Aug 12, 2010 at 12:57:18AM +0530, DebBarma, Tarun Kanti wrote:
>>
>> > -----Original Message-----
>> > From: Felipe Balbi [mailto:felipe.balbi@nokia.com]
>> > Sent: Thursday, August 12, 2010 12:27 AM
>> > To: 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
>> > Subject: Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get
>> > board data
>> >
>> > 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.
>> >
>> Sounds perfect!
>> What that means is _probe() function makes sense only for cases where we
>> have valid platform data because we are returning right at the top if
>> pdata is not valid. If this is the case I was curious to know why not
>> framework make another check for valid pdata before calling _probe()
>> instead of coming all the way to _probe() and then returning!
>
> Platform devices are not for passing platform data around - they're for
> declaring platform hardware devices that we want drivers to handle -
> and it depends on the driver whether having platform data is appropriate
> or not.
>
> This proposal is, IMHO, abusing the platform device/driver support to
> achieve its own goals.  I've outlined a far simpler and easiler solution
> which avoids this kind of abuse, and given suggestions on how to extend
> it to support multiple instances.

Thanks, Russell.

I'll give your suggestion a spin when I get back (I'm going to be away
for some time now with no devices with me).

^ permalink raw reply

* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Vitaly Wool @ 2010-08-11 21:34 UTC (permalink / raw)
  To: Ohad Ben-Cohen
  Cc: felipe.balbi, Kalle Valo, Pandita, Vikram,
	akpm@linux-foundation.org, Quadros Roger (Nokia-MS/Helsinki),
	Tony Lindgren, linux-wireless@vger.kernel.org, Nicolas Pitre,
	Mark Brown, linux-mmc@vger.kernel.org, Ido Yariv, San Mehat,
	Chikkature Rajashekar, Madhusudhan,
	Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
	ext DebBarma, Tarun Kanti, linux-arm-kernel@lists.infradead.org
In-Reply-To: <AANLkTikLbiJ8PsUbSnmYrfY6oNW4okejf-UdyQyfYbUz@mail.gmail.com>

Hi Ohad,

On Wed, Aug 11, 2010 at 10:10 PM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> Think of several wl1271 devices, each of which is represented by two
> devices; an SDIO function, and a platform device. The SDIO function
> stands for a specific MMC controller the device is hardwired to, and
> the platform device stands for the external irq line that the device
> is hardwired to.

my view on this is that you're hunting the false problem here. I
wonder how likely it is that two hardwired WL12xx chips are there on
the same board.

It's theoretically possible that there's one hardwired device and one
hot-pluggable one but the latter one can't have platform_data anyway.

So in my opinion, we either should keep things simple and consider 2
hardwired WL12XX's to be a very very unlikely case, or we'll end up
discussing board_info once again.

Thanks,
   Vitaly

^ permalink raw reply

* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Russell King - ARM Linux @ 2010-08-11 21:25 UTC (permalink / raw)
  To: DebBarma, Tarun Kanti
  Cc: felipe.balbi@nokia.com, Ohad Ben-Cohen, Kalle Valo,
	Pandita, Vikram, akpm@linux-foundation.org,
	Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
	linux-wireless@vger.kernel.org, Mark Brown,
	linux-mmc@vger.kernel.org, Nicolas Pitre, San Mehat,
	Chikkature Rajashekar, Madhusudhan,
	Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
	Ido Yariv, linux-arm-kernel@lists.infradead.org
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0324110AC7@dbde02.ent.ti.com>

On Thu, Aug 12, 2010 at 12:57:18AM +0530, DebBarma, Tarun Kanti wrote:
> 
> > -----Original Message-----
> > From: Felipe Balbi [mailto:felipe.balbi@nokia.com]
> > Sent: Thursday, August 12, 2010 12:27 AM
> > To: 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
> > Subject: Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get
> > board data
> > 
> > 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.
> >
> Sounds perfect!
> What that means is _probe() function makes sense only for cases where we
> have valid platform data because we are returning right at the top if
> pdata is not valid. If this is the case I was curious to know why not
> framework make another check for valid pdata before calling _probe()
> instead of coming all the way to _probe() and then returning! 

Platform devices are not for passing platform data around - they're for
declaring platform hardware devices that we want drivers to handle -
and it depends on the driver whether having platform data is appropriate
or not.

This proposal is, IMHO, abusing the platform device/driver support to
achieve its own goals.  I've outlined a far simpler and easiler solution
which avoids this kind of abuse, and given suggestions on how to extend
it to support multiple instances.

^ permalink raw reply

* Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: Russell King - ARM Linux @ 2010-08-11 21:21 UTC (permalink / raw)
  To: DebBarma, Tarun Kanti
  Cc: felipe.balbi@nokia.com, Ohad Ben-Cohen, Kalle Valo,
	Pandita, Vikram, akpm@linux-foundation.org,
	Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
	linux-wireless@vger.kernel.org, Mark Brown,
	linux-mmc@vger.kernel.org, Nicolas Pitre, San Mehat,
	Chikkature Rajashekar, Madhusudhan,
	Coelho Luciano (Nokia-MS/Helsinki), linux-omap@vger.kernel.org,
	Ido Yariv, linux-arm-kernel@lists.infradead.org
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0324110AC1@dbde02.ent.ti.com>

On Thu, Aug 12, 2010 at 12:22:54AM +0530, 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.

If pdev was ever NULL in a probe function, the kernel deserves to OOPS
so that you have a backtrace to fix the bugger.

Basically, a probe function is only called when the driver finds a
matching device to bind to - so the device _must_ already exist and
be valid.  It's basically guaranteed.  So checking for a NULL pdev is
not only a waste of space, it's a waste of CPU time and developer time
writing the check as well.

On the other hand, platform data passed in via a platform device _is_
liable to be NULL if whatever created the platform device didn't
set the platform data up.  So we can't guarantee that the platform
data will exist.  So a NULL check is appropriate here.

So, if an API in normal operation requires non-NULL data to be passed,
don't bother checking for a NULL pointer.  If you're passed a NULL
pointer in this situation, you deserve to OOPS so you get a backtrace
to fix the problem rather than silently ignoring the problem.

^ permalink raw reply

* Re: [PATCH v3 9/9] omap: zoom: add mmc3/wl1271 device support
From: Mark Brown @ 2010-08-11 21:03 UTC (permalink / raw)
  To: kishore kadiyala
  Cc: Ohad Ben-Cohen, Roger Quadros, linux-wireless@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Chikkature Rajashekar Madhusudhan,
	Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
	San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
	Kalle Valo
In-Reply-To: <AANLkTi=n=uH5ePRf8KzXWTtSdyRabpOCOgLBSD1GfwkJ@mail.gmail.com>

On Thu, Aug 12, 2010 at 01:39:38AM +0530, kishore kadiyala wrote:

> If the LDO is fixed voltage source from TWL then since regulator
> framework supports only adjustable LDO's, I think you can

The regulator framework supports fixed voltage regulators just fine.

^ permalink raw reply

* [PATCH] orinoco: Fix walking past the end of the buffer
From: Denis Kirjanov @ 2010-08-11 20:32 UTC (permalink / raw)
  To: linville; +Cc: proski, hermes, davem, linux-wireless, orinoco-devel, netdev

Fix walking past the end of the bitrate_table array
in the case when the loop counter == BITRATE_TABLE_SIZE.
Mark bitrate as invalid in this case for the orinoco_ioctl_setrate()

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---

diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c
index 077baa8..191bc03 100644
--- a/drivers/net/wireless/orinoco/hw.c
+++ b/drivers/net/wireless/orinoco/hw.c
@@ -765,9 +765,12 @@ int orinoco_hw_get_act_bitrate(struct orinoco_private *priv, int *bitrate)
 			if (bitrate_table[i].intersil_txratectrl == val)
 				break;
 
-		if (i >= BITRATE_TABLE_SIZE)
+		if (i >= BITRATE_TABLE_SIZE) {
 			printk(KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n",
 			       priv->ndev->name, val);
+			*bitrate = 100001; /* Mark as invalid */
+			break;
+		}
 
 		*bitrate = bitrate_table[i].bitrate * 100000;
 		break;

^ permalink raw reply related

* [PATCH] ipw2100: register pm_qos request before registering pci driver
From: John W. Linville @ 2010-08-11 20:22 UTC (permalink / raw)
  To: linux-wireless
  Cc: Christoph Fritz, James Bottomley, Zhu Yi, David S. Miller,
	Joe Perches, Rafael J. Wysocki, netdev, linux-kernel,
	John W. Linville
In-Reply-To: <1281555063.4367.1.camel@lovely.krouter>

It is necessary to call pm_qos_add_request prior to calling
pm_qos_update_request.  It was revealed that ipw2100 has been
doing this wrong since "pm_qos: Get rid of the allocation in
pm_qos_add_request()" (commit 82f682514a5df89ffb3890627eebf0897b7a84ec)
added a WARN that results in the following backtrace:

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

This patch moves pm_qos_add_request prior to pci_register_driver in
ipw2100 in order to avoid this problem.

Reported-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/ipw2x00/ipw2100.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 16bbfa3..1189dbb 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6665,12 +6665,13 @@ static int __init ipw2100_init(void)
 	printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
 	printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT);
 
+	pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
+			   PM_QOS_DEFAULT_VALUE);
+
 	ret = pci_register_driver(&ipw2100_pci_driver);
 	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,
-- 
1.7.2.1


^ permalink raw reply related

* Re: [PATCH 1/2] ipw2100: register pm_qos request on hardware activation
From: John W. Linville @ 2010-08-11 20:22 UTC (permalink / raw)
  To: Christoph Fritz
  Cc: James Bottomley, Zhu Yi, David S. Miller, Joe Perches,
	Rafael J. Wysocki, linux-wireless, netdev,
	linux-kernel@vger.kernel.org
In-Reply-To: <1281555063.4367.1.camel@lovely.krouter>

On Wed, Aug 11, 2010 at 09:31:03PM +0200, Christoph Fritz wrote:
> 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>

Thanks for identifying this problem!  However, I think there is a
simpler fix.  I'll include it in a follow-up email.  Could you verify
that it also addresses this issue?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [PATCH v3 9/9] omap: zoom: add mmc3/wl1271 device support
From: kishore kadiyala @ 2010-08-11 20:18 UTC (permalink / raw)
  To: Ohad Ben-Cohen
  Cc: Roger Quadros, 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, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
	Kalle Valo
In-Reply-To: <AANLkTin9ABch+_S=gYwD2HKPm8aT8etwfsE_WRRoq=2U@mail.gmail.com>

Oops didn't notice ,,,

Thanks,
Kishore

On Thu, Aug 12, 2010 at 1:42 AM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> Hi Kishore,
>
> On Wed, Aug 11, 2010 at 11:09 PM, kishore kadiyala
> <kishorek.kadiyala@gmail.com> wrote:
>> Since you specified the voltage source is fixed, and if MMC3 has any
>> dedicated regulator as MMC1 & MMC2 you can go with
>> Roger's comments.
>
> You are reading an old batch of the patches.
>
> Scroll down to v4 ;)
>
> Thanks,
> Ohad.
>
>> If the LDO is fixed voltage source from TWL then since regulator
>> framework supports only adjustable LDO's, I think you can
>> have ocr_mask defined as above in board file.
>>
>> Regards,
>> Kishore
>>>
>>> Removed, thanks!
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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 9/9] omap: zoom: add mmc3/wl1271 device support
From: Ohad Ben-Cohen @ 2010-08-11 20:12 UTC (permalink / raw)
  To: kishore kadiyala
  Cc: Roger Quadros, 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, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
	Kalle Valo
In-Reply-To: <AANLkTi=n=uH5ePRf8KzXWTtSdyRabpOCOgLBSD1GfwkJ@mail.gmail.com>

Hi Kishore,

On Wed, Aug 11, 2010 at 11:09 PM, kishore kadiyala
<kishorek.kadiyala@gmail.com> wrote:
> Since you specified the voltage source is fixed, and if MMC3 has any
> dedicated regulator as MMC1 & MMC2 you can go with
> Roger's comments.

You are reading an old batch of the patches.

Scroll down to v4 ;)

Thanks,
Ohad.

> If the LDO is fixed voltage source from TWL then since regulator
> framework supports only adjustable LDO's, I think you can
> have ocr_mask defined as above in board file.
>
> Regards,
> Kishore
>>
>> Removed, thanks!
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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: Ohad Ben-Cohen @ 2010-08-11 20:10 UTC (permalink / raw)
  To: felipe.balbi
  Cc: ext DebBarma, Tarun Kanti, 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>

Hi Felipe,

On Wed, Aug 11, 2010 at 9:47 PM, Felipe Balbi <felipe.balbi@nokia.com> wrote:
>>> +       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 ?

Yes.

Think of several wl1271 devices, each of which is represented by two
devices; an SDIO function, and a platform device. The SDIO function
stands for a specific MMC controller the device is hardwired to, and
the platform device stands for the external irq line that the device
is hardwired to.

We must couple the SDIO function with the correct platform device,
otherwise it will start getting the wrong interrupts. So after the
SDIO function is probed, it registers a platform driver with the
unique name that represents the platform device that it is coupled
with. When the platform device is probed, it needs to deliver its
platform data info to the specific SDIO function that it is bound
with.

To avoid using some global data structure in that driver, we allocate
a unique platform driver per each device, which makes it possible for
the platform driver probe to find the SDIO function context by means
of container_of.

Alternatively, we can also use some global structure in that file,
most probably idr, which would also make it possible to reach the SDIO
function contexts without going through the driver structure. The idr
indexes would then be the MMC controller index, which should match
the platform device id.

I'll try this out, it might actually look nicer.

Thanks,
Ohad.

> 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 v3 9/9] omap: zoom: add mmc3/wl1271 device support
From: kishore kadiyala @ 2010-08-11 20:09 UTC (permalink / raw)
  To: Ohad Ben-Cohen
  Cc: Roger Quadros, 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, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
	Kalle Valo
In-Reply-To: <AANLkTik8yftwy9Toq473134vcdoFN1Z29oTc9MGEUzue@mail.gmail.com>

Ohad,

On Wed, Aug 11, 2010 at 9:08 PM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> On Wed, Aug 11, 2010 at 11:37 AM, Roger Quadros <roger.quadros@nokia.com> wrote:
>>> +               .ocr_mask       = MMC_VDD_165_195,
>>
>> Do we really need to specify ocr_mask here?

Since you specified the voltage source is fixed, and if MMC3 has any
dedicated regulator as MMC1 & MMC2 you can go with
Roger's comments.
If the LDO is fixed voltage source from TWL then since regulator
framework supports only adjustable LDO's, I think you can
have ocr_mask defined as above in board file.

Regards,
Kishore
>
> Removed, thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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] wireless: revert %pM to %pm conversion
From: Joe Perches @ 2010-08-11 19:44 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless, John W. Linville
In-Reply-To: <201008112131.01906.chunkeey@googlemail.com>

On Wed, 2010-08-11 at 21:31 +0200, Christian Lamparter wrote:
> The patch: "drivers/net/wireless: Use wiphy_<level>" not
> only replaced printk(KERN_<level> with wiphy_<level>, but
> also converted some format string characters to lower case.

Thanks Christian.

My fault, sorry.

There are more undesired newly lower cased words in
the original patch.

I now know how that happened.

I lowercased the whole string instead of just the
KERN_<level> part.

I'll fix it and resubmit on top of Christian's patch
unless John wants a single patch.



^ permalink raw reply

* [PATCH] wireless: revert %pM to %pm conversion
From: Christian Lamparter @ 2010-08-11 19:31 UTC (permalink / raw)
  To: linux-wireless; +Cc: Joe Perches, John W. Linville

The patch: "drivers/net/wireless: Use wiphy_<level>" not
only replaced printk(KERN_<level> with wiphy_<level>, but
also converted some format string characters to lower case.

This would be totally fine, if it wasn't for this tiny
little detail:

(extract from lib/vsprintf.c)
/*
 * Show a '%p' thing.  A kernel extension is that the '%p'
 * is followed by an extra set of alphanumeric characters
 * that are extended format specifiers.
 * [...]
 * - 'M' For a 6-byte MAC address, it prints the address
 *		  in the usual colon-separated hex notation
 * - 'm' For a 6-byte MAC address, it prints the hex
 *		  address without colons
 */

In case of p54, the kernel now prints:
 phy4: hwaddr 000011223344, mac:isl3892 rf:Xbow

and before the commit, it looked like this:
 phy4: hwaddr 00:00:11:22:33:44, mac:isl3892 rf:Xbow

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
---
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index a105087..382ae72 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1902,7 +1902,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 		goto err_free_eeprom;
 	}
 
-	wiphy_info(dev->wiphy, "hwaddr %pm, rev 0x%02x\n",
+	wiphy_info(dev->wiphy, "hwaddr %pM, rev 0x%02x\n",
 		   dev->wiphy->perm_addr, pdev->revision);
 
 	return 0;
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index d5140a8..b1c2667 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -2310,7 +2310,7 @@ static int at76_init_new_device(struct at76_priv *priv,
 
 	priv->mac80211_registered = 1;
 
-	wiphy_info(priv->hw->wiphy, "usb %s, mac %pm, firmware %d.%d.%d-%d\n",
+	wiphy_info(priv->hw->wiphy, "usb %s, mac %pM, firmware %d.%d.%d-%d\n",
 		   dev_name(&interface->dev), priv->mac_addr,
 		   priv->fw_version.major, priv->fw_version.minor,
 		   priv->fw_version.patch, priv->fw_version.build);
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index c67b05f..cabf57f 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -387,7 +387,7 @@ static struct sk_buff *ar9170_get_queued_skb(struct ar9170 *ar,
 		if (mac && compare_ether_addr(ieee80211_get_DA(hdr), mac)) {
 #ifdef AR9170_QUEUE_DEBUG
 			wiphy_debug(ar->hw->wiphy,
-				    "skip frame => da %pm != %pm\n",
+				    "skip frame => da %pM != %pM\n",
 				    mac, ieee80211_get_DA(hdr));
 			ar9170_print_txheader(ar, skb);
 #endif /* AR9170_QUEUE_DEBUG */
@@ -495,7 +495,7 @@ void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
 			AR9170_TX_PHY_QOS_SHIFT;
 #ifdef AR9170_QUEUE_DEBUG
 		wiphy_debug(ar->hw->wiphy,
-			    "recv tx_status for %pm, p:%08x, q:%d\n",
+			    "recv tx_status for %pM, p:%08x, q:%d\n",
 			    cmd->tx_status.dst, phy, q);
 #endif /* AR9170_QUEUE_DEBUG */
 
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 01ad7f7..05d179a 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1467,7 +1467,7 @@ static int __init init_mac80211_hwsim(void)
 			break;
 		}
 
-		wiphy_debug(hw->wiphy, "hwaddr %pm registered\n",
+		wiphy_debug(hw->wiphy, "hwaddr %pM registered\n",
 			    hw->wiphy->perm_addr);
 
 		data->debugfs = debugfs_create_dir("hwsim",
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index d761ed2..31888da 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -4102,7 +4102,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 		goto err_free_queues;
 	}
 
-	wiphy_info(hw->wiphy, "%s v%d, %pm, %s firmware %u.%u.%u.%u\n",
+	wiphy_info(hw->wiphy, "%s v%d, %pM, %s firmware %u.%u.%u.%u\n",
 		   priv->device_info->part_name,
 		   priv->hw_rev, hw->wiphy->perm_addr,
 		   priv->ap_fw ? "AP" : "STA",
diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
index d687cb7..92facc3 100644
--- a/drivers/net/wireless/p54/eeprom.c
+++ b/drivers/net/wireless/p54/eeprom.c
@@ -700,7 +700,7 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
 		SET_IEEE80211_PERM_ADDR(dev, perm_addr);
 	}
 
-	wiphy_info(dev->wiphy, "hwaddr %pm, mac:isl38%02x rf:%s\n",
+	wiphy_info(dev->wiphy, "hwaddr %pM, mac:isl38%02x rf:%s\n",
 		   dev->wiphy->perm_addr, priv->version,
 		   p54_rf_chips[priv->rxhw]);
 
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index b50c39a..67b3227 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -1107,7 +1107,7 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev,
 		goto err_iounmap;
 	}
 
-	wiphy_info(dev->wiphy, "hwaddr %pm, %s + %s\n",
+	wiphy_info(dev->wiphy, "hwaddr %pM, %s + %s\n",
 		   mac_addr, chip_name, priv->rf->name);
 
 	return 0;
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index 5738a55..efa2860 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -1526,7 +1526,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
 	mutex_init(&priv->conf_mutex);
 	skb_queue_head_init(&priv->b_tx_status.queue);
 
-	wiphy_info(dev->wiphy, "hwaddr %pm, %s v%d + %s, rfkill mask %d\n",
+	wiphy_info(dev->wiphy, "hwaddr %pM, %s v%d + %s, rfkill mask %d\n",
 		   mac_addr, chip_name, priv->asic_rev, priv->rf->name,
 		   priv->rfkill_mask);
 

^ permalink raw reply related

* [PATCH 2/2] ipw2100: add WEXT scan capabilities
From: Christoph Fritz @ 2010-08-11 19:33 UTC (permalink / raw)
  To: John W. Linville
  Cc: Zhu Yi, David S. Miller, Joe Perches, Rafael J. Wysocki,
	linux-wireless, netdev, linux-kernel@vger.kernel.org
In-Reply-To: <1281555063.4367.1.camel@lovely.krouter>

NetworkManager claims: "driver does not support SSID scans (scan_capa
0x00)". This patch adds scan capabilities.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
 drivers/net/wireless/ipw2x00/ipw2100.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index df8e535..c330da4 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6982,12 +6982,15 @@ static int ipw2100_wx_get_range(struct net_device *dev,
 
 	/* Event capability (kernel + driver) */
 	range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
-				IW_EVENT_CAPA_MASK(SIOCGIWAP));
+				IW_EVENT_CAPA_MASK(SIOCGIWAP) |
+				IW_EVENT_CAPA_MASK(SIOCGIWSCAN));
 	range->event_capa[1] = IW_EVENT_CAPA_K_1;
 
 	range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
 		IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
 
+	range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_TYPE;
+
 	IPW_DEBUG_WX("GET Range\n");
 
 	return 0;
-- 
1.7.1




^ permalink raw reply related

* RE: [PATCH v4 3/8] wireless: wl1271: add platform driver to get board data
From: DebBarma, Tarun Kanti @ 2010-08-11 19:27 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: <20100811185724.GD21778@nokia.com>


> -----Original Message-----
> From: Felipe Balbi [mailto:felipe.balbi@nokia.com]
> Sent: Thursday, August 12, 2010 12:27 AM
> To: 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
> Subject: Re: [PATCH v4 3/8] wireless: wl1271: add platform driver to get
> board data
> 
> 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.
>
Sounds perfect!
What that means is _probe() function makes sense only for cases where we have valid platform data because we are returning right at the top if pdata is not valid. If this is the case I was curious to know why not framework make another check for valid pdata before calling _probe() instead of coming all the way to _probe() and then returning! 
 
> >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

* [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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox