All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about: linux-linaro-2.6.38.7 booting the ubuntu 10.10 filesystem
From: Russell King - ARM Linux @ 2011-10-22 13:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CALQsFO+AbEH-LtEYCY7wDZW=7U=wYZrQcMPeoDio_BdkByWTcw@mail.gmail.com>

On Sat, Oct 22, 2011 at 05:35:52PM +0800, David Yang wrote:
>  I found in my timer driver,I didn't implement the "init_sched_clock"
> function.

Have you selected HAVE_SCHED_CLOCK ?

^ permalink raw reply

* Re: [PATCH 0/3] ARM 4Kstacks: introduction
From: Russell King - ARM Linux @ 2011-10-22 13:36 UTC (permalink / raw)
  To: Ming Lei
  Cc: Arnd Bergmann, linux-arm-kernel, Tim Bird, Joe Perches,
	linux kernel, Andi Kleen, Thomas Gleixner
In-Reply-To: <CACVXFVMb9p8PiTYWGTNn-FtQts0sRgmK+BQ6kaJ6-D89CAT=xQ@mail.gmail.com>

On Sat, Oct 22, 2011 at 04:50:15PM +0800, Ming Lei wrote:
> On Wed, Oct 19, 2011 at 6:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 18 October 2011 17:26:44 Tim Bird wrote:
> >> Even inside Sony, usage of 4K stacks is limited
> >> to some very special cases, where memory is exceedingly
> >> tight (we have one system with 4M of RAM).  And we
> >> don't mind lopping off features or coding around
> >> problem areas to support our special case.
> >
> > I would imagine that in those cases, you can gain more by reducing the
> > number of threads in the system. What is the highest number of
> > concurrent threads that you expect in a limited use case with no
> > networking or block devices?
> 
> If system run for some time, sometimes it may be difficult for
> memory allocator to allocate 2 continuous page frames even  there are
> many spare page frames in system because of
> fragment issue, so the patch does make sense.

If memory fragmentation is an issue for this, it probably means that we
need to switch to a software page size of 8K (or maybe 16K) rather than
stick with the hardware 4K size.  That would be a much more reliable
solution, especially as the L1 page table is 16K (if you're suffering
from memory fragmentation, the first thing which'd get you is the L1
page table allocation, not the kernel stack allocation.)

> Anyway, it provides one option for user to apply 4k stack to avoid
> such kind of process creation failure.

I refer you to the comments made by people who've tried running with 4K
stacks on x86, and their _vast_ experience of doing this.  If they say
that it causes stack overflows, then it's a problem.

The possibility of a kernel stack overflow is not something that should
be taken lightly - an overflow of the kernel stack means that the thread
data will be corrupted, so destroying the ability for debug information
to be emitted.

^ permalink raw reply

* Re: [PATCH 1/4] nl80211: Add probe response offload attribute
From: Johannes Berg @ 2011-10-22 13:36 UTC (permalink / raw)
  To: Guy Eilam; +Cc: linux-wireless
In-Reply-To: <1319290457.3956.3.camel@jlt3.sipsolutions.net>

On Sat, 2011-10-22 at 15:34 +0200, Johannes Berg wrote:
> On Sat, 2011-10-22 at 15:11 +0200, Guy Eilam wrote:
> 
> > +enum nl80211_probe_resp_offload_support_attr {
> > +	NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS,
> > +	NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2,
> > +	NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P,
> > +};
> 
> I think doing = 1<<N here would be nicer to use in drivers & userspace.

Hm, also: should we call this WPS or WSC, and do we need to distinguish
WPS and WPS2? My AP mode patch called it WSC in a different context but
I can change, we just should be consistent.

> > + * @get_probe_resp_offload: Get probe response offload support from driver.
> 
> and this seems unnecessary -- why not just put a u32 value into struct
> wiphy?

Oh, and probably a regular WIPHY flag that indicates whether the
attribute should be added at all so that it can also be 0 but present
(presence with 0 value indicates something other than not present).

johannes


^ permalink raw reply

* [PATCH 0/3] ARM 4Kstacks: introduction
From: Russell King - ARM Linux @ 2011-10-22 13:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACVXFVMb9p8PiTYWGTNn-FtQts0sRgmK+BQ6kaJ6-D89CAT=xQ@mail.gmail.com>

On Sat, Oct 22, 2011 at 04:50:15PM +0800, Ming Lei wrote:
> On Wed, Oct 19, 2011 at 6:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 18 October 2011 17:26:44 Tim Bird wrote:
> >> Even inside Sony, usage of 4K stacks is limited
> >> to some very special cases, where memory is exceedingly
> >> tight (we have one system with 4M of RAM). ?And we
> >> don't mind lopping off features or coding around
> >> problem areas to support our special case.
> >
> > I would imagine that in those cases, you can gain more by reducing the
> > number of threads in the system. What is the highest number of
> > concurrent threads that you expect in a limited use case with no
> > networking or block devices?
> 
> If system run for some time, sometimes it may be difficult for
> memory allocator to allocate 2 continuous page frames even  there are
> many spare page frames in system because of
> fragment issue, so the patch does make sense.

If memory fragmentation is an issue for this, it probably means that we
need to switch to a software page size of 8K (or maybe 16K) rather than
stick with the hardware 4K size.  That would be a much more reliable
solution, especially as the L1 page table is 16K (if you're suffering
from memory fragmentation, the first thing which'd get you is the L1
page table allocation, not the kernel stack allocation.)

> Anyway, it provides one option for user to apply 4k stack to avoid
> such kind of process creation failure.

I refer you to the comments made by people who've tried running with 4K
stacks on x86, and their _vast_ experience of doing this.  If they say
that it causes stack overflows, then it's a problem.

The possibility of a kernel stack overflow is not something that should
be taken lightly - an overflow of the kernel stack means that the thread
data will be corrupted, so destroying the ability for debug information
to be emitted.

^ permalink raw reply

* Re: [PATCH] test/testdisplay:add cursor test
From: Lan, Hai @ 2011-10-22 13:34 UTC (permalink / raw)
  To: Paul Menzel, intel-gfx@lists.freedesktop.org
In-Reply-To: <1319289956.3496.43.camel@mattotaupa>

> what does this test do? For the unknowledgeable user what is supposed to
> happen, that means, when is the test successful and when not?
> 
I wrote this patch to test whether the cursor can work OK. It needs the tester to watch the screen.
If the tester can see the white cursor move from left to right, it can prove that the cursor works OK.
If not, the cursor driver is wrong.
Thanks

Hai Lan

^ permalink raw reply

* Re: [PATCH 1/4] nl80211: Add probe response offload attribute
From: Johannes Berg @ 2011-10-22 13:34 UTC (permalink / raw)
  To: Guy Eilam; +Cc: linux-wireless
In-Reply-To: <1319289112-21896-1-git-send-email-guy@wizery.com>

On Sat, 2011-10-22 at 15:11 +0200, Guy Eilam wrote:

> +enum nl80211_probe_resp_offload_support_attr {
> +	NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS,
> +	NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2,
> +	NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P,
> +};

I think doing = 1<<N here would be nicer to use in drivers & userspace.

> + * @get_probe_resp_offload: Get probe response offload support from driver.

and this seems unnecessary -- why not just put a u32 value into struct
wiphy?

johannes


^ permalink raw reply

* Re: What's cooking in git.git (Oct 2011, #08; Fri, 21)
From: Jakub Narebski @ 2011-10-22 13:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Kato Kazuyoshi
In-Reply-To: <m3r5256h76.fsf@localhost.localdomain>

Jakub Narebski <jnareb@gmail.com> writes:
> Junio C Hamano <gitster@pobox.com> writes:

> > * kk/gitweb-side-by-side-diff (2011-10-17) 2 commits
> >  - gitweb: add a feature to show side-by-side diff
> >  - gitweb: change format_diff_line() to remove leading SP from $diff_class
> > 
> > Fun.
> > Will keep in 'pu' until the planned re-roll comes.
> 
> I think this needs some more work, not only re-roll...
> 
> 
> BTW. the bottom commit could be I think replaced by mine
> 
>    - gitweb: Refactor diff body line classification

Nb. that needs a easy but non-trivial merge conflict resolution,
see e.g.

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The following changes since commit 8963314c77af9a4eda5dcbdbab3d4001af83ad81:

  Sync with maint (2011-10-21 11:24:34 -0700)

are available in the git repository at:

  git://repo.or.cz/git/jnareb-git.git gitweb/side-by-side-diff

Jakub Narebski (1):
      gitweb: Refactor diff body line classification

Kato Kazuyoshi (1):
      gitweb: add a feature to show side-by-side diff

 gitweb/gitweb.perl       |  144 ++++++++++++++++++++++++++++++++++------------
 gitweb/static/gitweb.css |   15 +++++
 2 files changed, 123 insertions(+), 36 deletions(-)

-- 
Jakub Narebski

^ permalink raw reply

* Re: SCSI HA problems
From: James Bottomley @ 2011-10-22 13:31 UTC (permalink / raw)
  To: Michael Robbert; +Cc: linux-scsi@vger.kernel.org
In-Reply-To: <3915A3F8-ECF9-469B-869F-EA4C8421476E@mines.edu>

On Fri, 2011-10-21 at 18:08 -0600, Michael Robbert wrote:
> I want some technical advice from the SCSI/SAS/SATA experts. We are
> trying to setup a low cost HA storage system with multiple servers
> that have SAS HBAs, SAS JBOD, and desktop SATA disks. When we first
> set it up everything appeared to work. I created RAID6 on one host and
> put it into a corosync/pacemaker config. I was then able to migrate
> the RAID from one host to another. A short while later a failover
> failed and I noticed that some of the drives became inaccessible on
> one of the hosts. The kernel was showing timeouts to the device. 
> 
> Oct 21 17:55:34 haraid-12-1 kernel: sd 1:0:3:0: timing out command, waited 10s
> 
> So, my question is this, is this setup technically possible or are the
> 2 HBAs going to conflict with each other when talking over the same
> SAS bus to the SATA drives?

Well, yes, but the devil is in the details.  Firstly it's only possible
with SAS; SATA controllers don't really do multi-initiator and SATA
disks don't have the cluster commands that SAS disks do.  It is
theoretically possible with a SAS controller and SATA disk provided the
cluster software doesn't use any of the SCSI commands for clustering.

The reason your setup likely doesn't work is because of the expander.
SAS expanders are complex beasts:  Any port can be device, table or
subtractively routed.  You don't usually see it, but a JBOD ships with a
subtractive port for the HBA connection and a device port for everything
else.  You can't just plug another HBA into a random device port because
the routing won't get device replies back to you (hence the timeout).

The way I've got this set up at home uses a 12x expander with 4x
subtractive and 9x table routing phys which group in clusters of up to
four for ports.  I can plug the second HBA into one of the table routed
ports because the SCSI transport class installs the correct route
tables, so I know it works for aic9xxx and mvsas.

James



^ permalink raw reply

* Re: [PATCH] tg3: fix tigon3_dma_hwbug_workaround()
From: Ari Savolainen @ 2011-10-22 13:30 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: RongQing Li, David Miller, richardcochran, netdev, linux-kernel
In-Reply-To: <CAEbykaVif3Mi50aDzY5p09iHC3DgtbYFQBGPAWiLa8hhyk5w8A@mail.gmail.com>

I tested the patch. It works. The panics are gone.

Thanks,
Ari

2011/10/22 Ari Savolainen <ari.m.savolainen@gmail.com>:
> I tried a similar patch earlier and got another panic with that. I was
> quite tired at that time and may have made a mistake. I'll test Eric's
> patch either later today or tomorrow.
>
> Ari
>
> 2011/10/22 Eric Dumazet <eric.dumazet@gmail.com>:
>> Ari got kernel panics using tg3 NIC, and bisected to 2669069aacc9 "tg3:
>> enable transmit time stamping."
>>
>> This is because tigon3_dma_hwbug_workaround() might alloc a new skb and
>> free the original. We panic when skb_tx_timestamp() is called on freed
>> skb.
>>
>> Reported-by: Ari Savolainen <ari.m.savolainen@gmail.com>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>> ---
>>  drivers/net/tg3.c |    8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
>> index 4a1374d..6149dc5 100644
>> --- a/drivers/net/tg3.c
>> +++ b/drivers/net/tg3.c
>> @@ -6029,12 +6029,12 @@ static void tg3_tx_skb_unmap(struct tg3_napi *tnapi, u32 entry, int last)
>>
>>  /* Workaround 4GB and 40-bit hardware DMA bugs. */
>>  static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
>> -                                      struct sk_buff *skb,
>> +                                      struct sk_buff **pskb,
>>                                       u32 *entry, u32 *budget,
>>                                       u32 base_flags, u32 mss, u32 vlan)
>>  {
>>        struct tg3 *tp = tnapi->tp;
>> -       struct sk_buff *new_skb;
>> +       struct sk_buff *new_skb, *skb = *pskb;
>>        dma_addr_t new_addr = 0;
>>        int ret = 0;
>>
>> @@ -6076,7 +6076,7 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi,
>>        }
>>
>>        dev_kfree_skb(skb);
>> -
>> +       *pskb = new_skb;
>>        return ret;
>>  }
>>
>> @@ -6305,7 +6305,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
>>                 */
>>                entry = tnapi->tx_prod;
>>                budget = tg3_tx_avail(tnapi);
>> -               if (tigon3_dma_hwbug_workaround(tnapi, skb, &entry, &budget,
>> +               if (tigon3_dma_hwbug_workaround(tnapi, &skb, &entry, &budget,
>>                                                base_flags, mss, vlan))
>>                        goto out_unlock;
>>        }
>>
>>
>>
>

^ permalink raw reply

* Re: Setting negative value in dBm for power output (txpower)
From: Johannes Berg @ 2011-10-22 13:30 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: Patryk Żółtowski, linux-wireless
In-Reply-To: <CA+XFjiq6EJNczcotbk3R5YQXa-iY_2FY8KK4UN69XxSTm8LtoQ@mail.gmail.com>

On Sat, 2011-10-22 at 00:02 +0200, Gábor Stefanik wrote:
> 2011/10/21 Patryk Żółtowski <patryk.zoltowski@gmail.com>:
> > I'm doing a research and I'm wondering if it's possible to hack
> > wireless drivers to allow setting  txpower to smaller value than 1mW
> > (e.g. 0.1mW = -10dBM, or even 0.01mW). I've checked source code and in
> > net/mac80211/cfg.c there is the following check:
> >
> >  if (mbm < 0 || (mbm % 100))
> >                     return -EOPNOTSUPP;
> 
> The "mbm % 100" part is even weirder; why do we even use millibels if
> we only allow whole-decibel values?

This is really just historic -- nobody has so far cared about TX power
enough to clean up the APIs for it etc. The distinction between
"automatic", "fixed" and "limited" (auto <= some value) is also not
really done very well here.

johannes


^ permalink raw reply

* RE: [PATCH 00/36] Staging: cx25821: Clean up patch series
From: Palash Bandyopadhyay @ 2011-10-22 12:50 UTC (permalink / raw)
  To: Leonid V. Fedorenchik, Greg Kroah-Hartman
  Cc: Mauro Carvalho Chehab, Namhyung Kim, Joe Perches, Ilia Mirkin,
	Youquan Song, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <1319262236-6498-1-git-send-email-leonidsbox@gmail.com>

Thanks Leonid!

  Change in patch #18 is also ok.

Regards,
Palash

________________________________________
From: Leonid V. Fedorenchik [leonidsbox@gmail.com]
Sent: Friday, October 21, 2011 10:43 PM
To: Greg Kroah-Hartman
Cc: Mauro Carvalho Chehab; Namhyung Kim; Palash Bandyopadhyay; Joe Perches; Ilia Mirkin; Youquan Song; Leonid V. Fedorenchik; devel@linuxdriverproject.org; linux-kernel@vger.kernel.org
Subject: [PATCH 00/36] Staging: cx25821: Clean up patch series

This patch series fixes some style issues in drivers/staging/cx25821
Mostly I was hoping to improve readability and fix some issues found by
checkpatch.pl script.

There is one question, however, in patch no. 18:
I deleted part of the comment that contradicts to the code and in this
case maybe I should edit the code to match the comment instead. I am not
sure if in this case it makes sense to check if width > 0.

Leonid V. Fedorenchik (36):
      Staging: cx25821: cx25821-alsa.c: Line up comments
      Staging: cx25821: cx25821-alsa.c: Add braces to else clause
      Staging: cx25821: cx25821-alsa.c: Fix indent
      Staging: cx25821: cx25821-alsa.c: Change line endings
      Staging: cx25821: cx25821-audio-upstream.c: Fix indent
      Staging: cx25821: cx25821-audio-upstream.c: Move operators
      Staging: cx25821: cx25821-audio-upstream.c: Change line endings
      Staging: cx25821: cx25821-audio.h: Line up defines
      Staging: cx25821: cx25821-audio.h: Fix multiline defines
      Staging: cx25821: cx25821-cards.c: Fix indent
      Staging: cx25821: cx25821-core.c: Delete empty line
      Staging: cx25821: cx25821-core.c: Fix indent
      Staging: cx25821: cx25821-core.c: Change line endings
      Staging: cx25821: cx25821-i2c.c: Change line endings
      Staging: cx25821: cx25821-medusa-defines.h: Fix typo
      Staging: cx25821: cx25821-medusa-defines.h: Line up defines
      Staging: cx25821: cx25821-medusa-reg.h: Line up defines
      Staging: cx25821: cx25821-medusa-video.c: Fix comment
      Staging: cx25821: cx25821-medusa-video.c: Move operators
      Staging: cx25821: cx25821-medusa-video.c: Change line endings
      Staging: cx25821: cx25821-video-upstream-ch2.c: Line up comments
      Staging: cx25821: cx25821-video-upstream-ch2.c: Fix indent
      Staging: cx25821: cx25821-video-upsstream-ch2.c: Move operators
      Staging: cx25821: cx25821-video-upstream-ch2.c: Remove braces
      Staging: cx25821: cx25821-video-upstream-ch2.c: Change line endings
      Staging: cx25821: cx25821-video-upstream.c: Remove braces
      Staging: cx25821: cx25821-video-upstream.c: Fix indent
      Staging: cx25821: cx25821-video-upstream.c: Change line endings
      Staging: cx25821: cx25821-video.c: Delete empty line
      Staging: cx25821: cx25821-video.c: Change spaces
      Staging: cx25821: cx25821-video.c: Fix assignment
      Staging: cx25821: cx25821-video.c: Fix definitions
      Staging: cx25821: cx25821-video.c: Move operators
      Staging: cx25821: cx25821-video.c: Fix indent
      Staging: cx25821: cx25821-video.c: Change line endings
      Staging: cx25821: cx25821.h: Line up defines

 drivers/staging/cx25821/cx25821-alsa.c             |   73 ++--
 drivers/staging/cx25821/cx25821-audio-upstream.c   |  102 ++--
 drivers/staging/cx25821/cx25821-audio.h            |   39 +-
 drivers/staging/cx25821/cx25821-cards.c            |    2 +-
 drivers/staging/cx25821/cx25821-core.c             |   57 +--
 drivers/staging/cx25821/cx25821-i2c.c              |   10 +-
 drivers/staging/cx25821/cx25821-medusa-defines.h   |    6 +-
 drivers/staging/cx25821/cx25821-medusa-reg.h       |  518 ++++++++++----------
 drivers/staging/cx25821/cx25821-medusa-video.c     |  410 ++++++----------
 .../staging/cx25821/cx25821-video-upstream-ch2.c   |  126 ++---
 drivers/staging/cx25821/cx25821-video-upstream.c   |  146 +++----
 drivers/staging/cx25821/cx25821-video.c            |  145 +++---
 drivers/staging/cx25821/cx25821.h                  |    4 +-
 13 files changed, 745 insertions(+), 893 deletions(-)
Conexant E-mail Firewall (Conexant.Com) made the following annotations
---------------------------------------------------------------------
********************** Legal Disclaimer **************************** 

"This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you." 

********************************************************************** 

---------------------------------------------------------------------


^ permalink raw reply

* [PATCH] jme: fix irq storm after suspend/resume
From: Clemens Buchacher @ 2011-10-22 12:56 UTC (permalink / raw)
  To: Guo-Fu Tseng; +Cc: netdev, linux-kernel, Adrian Chadd, Mohammed Shafi

If the device is down during suspend/resume, interrupts are enabled
without a registered interrupt handler, causing a storm of
unhandled interrupts until the IRQ is disabled because "nobody
cared".

Instead, check that the device is up before touching it in the
suspend/resume code.

Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112

Helped-by: Adrian Chadd <adrian@freebsd.org>
Helped-by: Mohammed Shafi <shafi.wireless@gmail.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---

Unfortunately, bugzilla.kernel.org is still down. There is at least
one other person who reported the issue, and I don't have their
email address. So for now, I am the only one who tested this fix.

The patch applies to current tip (2efd7c0) of Linus' tree. I also
tested it based on v3.0 and it worked the same.

Many thanks to Adrian and Mohammed for helping me debug this issue.
See this thread for the history:
 http://mid.gmane.org/20110827113253.GA1444@ecki

 drivers/net/jme.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 3ac262f..7a8a3b6 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -3131,6 +3131,9 @@ jme_suspend(struct device *dev)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct jme_adapter *jme = netdev_priv(netdev);
 
+	if (!netif_running(netdev))
+		return 0;
+
 	atomic_dec(&jme->link_changing);
 
 	netif_device_detach(netdev);
@@ -3171,6 +3174,9 @@ jme_resume(struct device *dev)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct jme_adapter *jme = netdev_priv(netdev);
 
+	if (!netif_running(netdev))
+		return 0;
+
 	jme_clear_pm(jme);
 	jme_phy_on(jme);
 	if (test_bit(JME_FLAG_SSET, &jme->flags))
-- 
1.7.7


^ permalink raw reply related

* Re: [PATCH] test/testdisplay:add cursor test
From: Paul Menzel @ 2011-10-22 13:25 UTC (permalink / raw)
  To: intel-gfx
In-Reply-To: <1319335385-29991-1-git-send-email-hai.lan@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 3907 bytes --]

Dear Hai,


Am Samstag, den 22.10.2011, 22:03 -0400 schrieb Hai Lan:

what does this test do? For the unknowledgeable user what is supposed to
happen, that means, when is the test successful and when not?

> Signed-off-by: Hai Lan <hai.lan@intel.com>
> ---
>  tests/testdisplay.c |   32 +++++++++++++++++++++++++-------
>  1 files changed, 25 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/testdisplay.c b/tests/testdisplay.c
> index 01f31dc..174d5c7 100644
> --- a/tests/testdisplay.c
> +++ b/tests/testdisplay.c
> @@ -75,7 +75,7 @@ struct udev_monitor *uevent_monitor;
>  drmModeRes *resources;
>  int fd, modes;
>  int dump_info = 0, test_all_modes =0, test_preferred_mode = 0, force_mode = 0,
> -	test_plane, enable_tiling;
> +	test_plane, enable_tiling, test_cursor;
>  int sleep_between_modes = 5;
>  uint32_t depth = 24;
>  
> @@ -823,7 +823,7 @@ set_mode(struct connector *c)
>  		cairo_surface_t *surface;
>  		cairo_status_t status;
>  		cairo_t *cr;
> -		uint32_t handle;
> +		uint32_t handle,cursor_handle;

Missing space?

>  		if (test_all_modes)
>  			c->mode = c->connector->modes[j];
> @@ -872,7 +872,6 @@ set_mode(struct connector *c)
>  				   handle, &fb_id);
>  		cairo_surface_destroy(surface);
>  		gem_close(fd, handle);
> -
>  		if (ret) {
>  			fprintf(stderr, "failed to add fb (%dx%d): %s\n",
>  				width, height, strerror(errno));
> @@ -888,6 +887,21 @@ set_mode(struct connector *c)
>  			continue;
>  		}
>  
> +		if (test_cursor) {
> +			cursor_handle = gem_create(fd,64*64*4);
> +			char * cursor_buff = gem_mmap(fd, cursor_handle, 64*64*4, PROT_READ | PROT_WRITE);
> +			for(int i=0;i<64*64*4;i++)
> +				*(cursor_buff+i)=0xff;
> +
> +			drmModeSetCursor(fd,c->crtc,cursor_handle,64,64);
> +			for(int i=0;i<10;i++) {
> +				drmModeMoveCursor(fd,c->crtc,i*100, 0);
> +				sleep(1);
> +			}
> +			drmModeSetCursor(fd,c->crtc,0,64,64);
> +			gem_close(fd, cursor_handle);
> +		}
> +
>  		if (test_plane)
>  			enable_plane(c);
>  
> @@ -931,7 +945,7 @@ static int update_display(void)
>  		dump_planes();
>  	}
>  
> -	if (test_preferred_mode || test_all_modes || force_mode) {
> +	if (test_preferred_mode || test_all_modes || force_mode || test_cursor) {
>  		/* Find any connected displays */
>  		for (c = 0; c < resources->count_connectors; c++) {
>  			connectors[c].id = resources->connectors[c];
> @@ -944,11 +958,11 @@ static int update_display(void)
>  
>  extern char *optarg;
>  extern int optind, opterr, optopt;
> -static char optstr[] = "hiaf:s:d:pmt";
> +static char optstr[] = "hiaf:s:d:pmtc";
>  
>  static void usage(char *name)
>  {
> -	fprintf(stderr, "usage: %s [-hiafs]\n", name);
> +	fprintf(stderr, "usage: %s [-hiaf:s:d:pmtc]\n", name);
>  	fprintf(stderr, "\t-i\tdump info\n");
>  	fprintf(stderr, "\t-a\ttest all modes\n");
>  	fprintf(stderr, "\t-s\t<duration>\tsleep between each mode test\n");
> @@ -959,6 +973,7 @@ static void usage(char *name)
>  	fprintf(stderr, "\t-f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n");
>  	fprintf(stderr, "\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n");
>  	fprintf(stderr, "\t\ttest force mode\n");
> +	fprintf(stderr, "\t-c\ttest cursor\n");
>  	fprintf(stderr, "\tDefault is to test all modes.\n");
>  	exit(0);
>  }
> @@ -1048,6 +1063,9 @@ int main(int argc, char **argv)
>  		case 't':
>  			enable_tiling = 1;
>  			break;
> +		case 'c':
> +			test_cursor = 1;
> +			break;
>  		default:
>  			fprintf(stderr, "unknown option %c\n", c);
>  			/* fall through */
> @@ -1057,7 +1075,7 @@ int main(int argc, char **argv)
>  		}
>  	}
>  	if (!test_all_modes && !force_mode && !dump_info &&
> -	    !test_preferred_mode)
> +	    !test_preferred_mode && !test_cursor)
>  		test_all_modes = 1;
>  
>  	for (i = 0; i < ARRAY_SIZE(modules); i++) {


Thanks,

Paul

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* Re: [PATCH 48/49] USB: pxa168: xls: irq: Remove IRQF_DISABLED
From: Tanmay Upadhyay @ 2011-10-22 13:16 UTC (permalink / raw)
  To: Yong Zhang
  Cc: linux-kernel, tglx, Jayachandran C, Greg Kroah-Hartman,
	Alan Stern, linux-usb
In-Reply-To: <1319277421-9203-49-git-send-email-yong.zhang0@gmail.com>


On Saturday 22 October 2011 03:27 PM, Yong Zhang wrote:
> Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
> We run all interrupt handlers with interrupts disabled
> and we even check and yell when an interrupt handler
> returns with interrupts enabled (see commit [b738a50a:
> genirq: Warn when handler enables interrupts]).
>
> So now this flag is a NOOP and can be removed.
>
> Signed-off-by: Yong Zhang<yong.zhang0@gmail.com>

Acked-by: Tanmay Upadhyay<tanmay.upadhyay@einfochips.com>

Thanks for updating USB driver for PXA168!

Thanks,

Tanmay


> Cc: Tanmay Upadhyay<tanmay.upadhyay@einfochips.com>
> Cc: Jayachandran C<jayachandranc@netlogicmicro.com>
> Cc: Greg Kroah-Hartman<gregkh@suse.de>
> ---
>   drivers/usb/host/ehci-pxa168.c |    2 +-
>   drivers/usb/host/ohci-xls.c    |    2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-pxa168.c b/drivers/usb/host/ehci-pxa168.c
> index ac0c16e..f0b776d 100644
> --- a/drivers/usb/host/ehci-pxa168.c
> +++ b/drivers/usb/host/ehci-pxa168.c
> @@ -304,7 +304,7 @@ static int __devinit ehci_pxa168_drv_probe(struct platform_device *pdev)
>   	hcd->has_tt = 1;
>   	ehci->sbrn = 0x20;
>
> -	err = usb_add_hcd(hcd, irq, IRQF_SHARED | IRQF_DISABLED);
> +	err = usb_add_hcd(hcd, irq, IRQF_SHARED);
>   	if (err)
>   		goto err5;
>
> diff --git a/drivers/usb/host/ohci-xls.c b/drivers/usb/host/ohci-xls.c
> index a3a9c6f..38b6bda 100644
> --- a/drivers/usb/host/ohci-xls.c
> +++ b/drivers/usb/host/ohci-xls.c
> @@ -56,7 +56,7 @@ static int ohci_xls_probe_internal(const struct hc_driver *driver,
>   		goto err3;
>   	}
>
> -	retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
> +	retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
>   	if (retval != 0)
>   		goto err4;
>   	return retval;

^ permalink raw reply

* Re: [PATCH] freetype_2.4.3.bb; Change order of configuration.
From: Paul Menzel @ 2011-10-22 13:14 UTC (permalink / raw)
  To: openembedded-devel
In-Reply-To: <1319286535-2935-1-git-send-email-ulf_samuelsson@telia.com>

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

Am Samstag, den 22.10.2011, 14:28 +0200 schrieb ulf_samuelsson@telia.com:
> From: Ulf Samuelsson <ulf_samuelsson@telia.com>
> 
> Build of freetype-native is broken on Ubuntu 11.10 x64 - possible others.

It works for me without problem with Debian Squeeze (32-bit). So what is
the error message in the first place?

> Problem fixed in openembedded-core 2.4.4 recipe

It seems it was not present since the beginning, i. e. version 2.3.12.

> Backporting the change will allow the build to complete.
> 
> openembedded-core-contrib/meta/recipes-graphics/freetype
> 
> Signed-Off-By: Ulf Samuelsson <ulf.samuelsson@telia.com>
> ---
>  recipes/freetype/freetype_2.4.3.bb |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/recipes/freetype/freetype_2.4.3.bb b/recipes/freetype/freetype_2.4.3.bb
> index 66d2e51..dfc1b43 100644
> --- a/recipes/freetype/freetype_2.4.3.bb
> +++ b/recipes/freetype/freetype_2.4.3.bb
> @@ -1,7 +1,7 @@
>  DESCRIPTION = "Freetype font rendering library"
>  SECTION = "libs"
>  LICENSE = "freetype GPLv2"
> -PR = "r1"
> +PR = "r2"
>  DEPENDS = "zlib"
>  
>  SRC_URI = "\
> @@ -23,9 +23,9 @@ LDFLAGS_append = " -Wl,-rpath-link -Wl,${STAGING_DIR_TARGET}${libdir}"
>  
>  do_configure() {
>  	cd builds/unix
> -	gnu-configize --force
> -	aclocal -I .
>  	libtoolize --force --copy
> +	aclocal -I .
> +	gnu-configize --force
>  	autoconf
>  	cd ${S}
>  	oe_runconf


Thanks,

Paul

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply

* [PATCH] usb: fix unaligned access
From: Fabian van der Werf @ 2011-10-22 13:19 UTC (permalink / raw)
  To: barebox

---
 drivers/usb/core/usb.c      |   12 +++++++-----
 drivers/usb/host/ehci-hcd.c |    9 +++++++--
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 7039a2c..369a393 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -50,6 +50,7 @@
 #include <driver.h>
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
+#include <asm/unaligned.h>
 #include <xfuncs.h>
 #include <init.h>
 
@@ -1071,6 +1072,7 @@ static int usb_hub_configure(struct usb_device *dev)
 	struct usb_hub_status *hubsts;
 	int i;
 	struct usb_hub_device *hub;
+	unsigned short hub_chars;
 
 	hub = xzalloc(sizeof (*hub));
 	dev->hub = hub;
@@ -1100,8 +1102,8 @@ static int usb_hub_configure(struct usb_device *dev)
 	}
 	memcpy((unsigned char *)&hub->desc, buffer, descriptor->bLength);
 	/* adjust 16bit values */
-	hub->desc.wHubCharacteristics =
-				le16_to_cpu(descriptor->wHubCharacteristics);
+	hub_chars = le16_to_cpu(get_unaligned(&descriptor->wHubCharacteristics));
+	put_unaligned(hub_chars, &hub->desc.wHubCharacteristics);
 	/* set the bitmap */
 	bitmap = (unsigned char *)&hub->desc.DeviceRemovable[0];
 	/* devices not removable by default */
@@ -1118,7 +1120,7 @@ static int usb_hub_configure(struct usb_device *dev)
 	dev->maxchild = descriptor->bNbrPorts;
 	USB_HUB_PRINTF("%d ports detected\n", dev->maxchild);
 
-	switch (hub->desc.wHubCharacteristics & HUB_CHAR_LPSM) {
+	switch (hub_chars & HUB_CHAR_LPSM) {
 	case 0x00:
 		USB_HUB_PRINTF("ganged power switching\n");
 		break;
@@ -1131,12 +1133,12 @@ static int usb_hub_configure(struct usb_device *dev)
 		break;
 	}
 
-	if (hub->desc.wHubCharacteristics & HUB_CHAR_COMPOUND)
+	if (hub_chars & HUB_CHAR_COMPOUND)
 		USB_HUB_PRINTF("part of a compound device\n");
 	else
 		USB_HUB_PRINTF("standalone hub\n");
 
-	switch (hub->desc.wHubCharacteristics & HUB_CHAR_OCPM) {
+	switch (hub_chars & HUB_CHAR_OCPM) {
 	case 0x00:
 		USB_HUB_PRINTF("global over-current protection\n");
 		break;
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 72f1c14..20c518a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <usb/ehci.h>
 #include <asm/mmu.h>
+#include <asm/unaligned.h>
 
 #include "ehci.h"
 
@@ -795,6 +796,7 @@ static int ehci_init(struct usb_host *host)
 	struct ehci_priv *ehci = to_ehci(host);
 	uint32_t reg;
 	uint32_t cmd;
+	unsigned short hub_chars;
 
 	ehci_halt(ehci);
 
@@ -819,12 +821,15 @@ static int ehci_init(struct usb_host *host)
 	reg = ehci_readl(&ehci->hccr->cr_hcsparams);
 	descriptor.hub.bNbrPorts = HCS_N_PORTS(reg);
 
+	hub_chars = get_unaligned(&descriptor.hub.wHubCharacteristics);
 	/* Port Indicators */
 	if (HCS_INDICATOR(reg))
-		descriptor.hub.wHubCharacteristics |= 0x80;
+		hub_chars |= 0x80;
 	/* Port Power Control */
 	if (HCS_PPC(reg))
-		descriptor.hub.wHubCharacteristics |= 0x01;
+		hub_chars |= 0x01;
+
+	put_unaligned(hub_chars, &descriptor.hub.wHubCharacteristics);
 
 	/* Start the host controller. */
 	cmd = ehci_readl(&ehci->hcor->or_usbcmd);
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* Re: Problem with log which are corrupted and need help with hitcount and FORWARD rules
From: Andrew Beverley @ 2011-10-22 13:20 UTC (permalink / raw)
  To: Azerty Ytreza; +Cc: netfilter
In-Reply-To: <CACMGiwZ_gWF0nKaY9yfybm5OQ3=WDD6rA2P-V8TgeOsLysCxLg@mail.gmail.com>

On Sat, 2011-10-22 at 10:43 +0200, Azerty Ytreza wrote:
> I use these rules by the past for limit number of connections during
> some seconds and block connections if they are too many attempt.
> 
> Old rules which work very well :
> ***************************************
> iptables -A INPUT -i eth1 -p tcp --dport 443 -m state --state NEW -m
> recent --set
> iptables -A INPUT -i eth1 -p tcp --dport 443 -m state --state NEW -m
> recent --update --seconds 60 --hitcount 10 -j DROP
> #ptables -A INPUT -i eth1 -p tcp --dport 443 -m state --state
> NEW,ESTABLISHED -j ACCEPT
> ***************************************
> 
> I have adapted this rules for a FORWARD rules and doesn't work :

What exactly are you trying to achieve? If you're changing to a FORWARD
rule then I assume that you are trying to adapt your rules in order to
block connections destined for a remote server, rather than the local
host?

> ***************************************
> iptables -A INPUT -i eth1 -p udp -m udp --dport 443 -m state --state
> NEW -m recent --set
> iptables -A INPUT -i eth1 -p udp -m udp --dport 443 -m recent --update
> --seconds 60 --hitcount 10 -j DROP

Do you really mean UDP?

> iptables -A FORWARD -i eth1 -p udp -m udp --dport 443 -m state --state
> NEW,ESTABLISHED -j ACCEPT

You've got a mixture of INPUT and FORWARD. Is that what you want?
Remember that packets will never transverse both the INPUT and FORWARD
chains.

> iptables -t nat -A PREROUTING -i eth1 -p udp -m udp --dport 443 -j
> DNAT --to-destination 192.168.1.2:443
> ***************************************
> 
> Someone can explain me why these rules doesn't block request when
> hitcount is reached ?
> I have try other method and put "hitcount" on the FORWARD rules
> directly but it's not work, I have an error from iptables which
> doesn't accept "--set" on a FORWARD request. I doesn't remember error
> but it's probably not the good method.
> 



^ permalink raw reply

* [PATCH 2/2] wl12xx: configure probe-resp template according to notification
From: Guy Eilam @ 2011-10-22 13:14 UTC (permalink / raw)
  To: coelho; +Cc: linux-wireless
In-Reply-To: <1319289279-21950-1-git-send-email-guy@wizery.com>

When operating in AP-mode, replace probe-response template when a
notification is recieved from mac80211. We preserve the "legacy" way of
configuring a probe-response according to beacon for IBSS mode and for
versions of hostapd that do not support this feature.

Signed-off-by: Guy Eilam <guy@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c   |   57 +++++++++++++++++++++++++++++----
 drivers/net/wireless/wl12xx/wl12xx.h |    1 +
 2 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 0a7d020..d91842d 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3311,11 +3311,33 @@ static void wl12xx_remove_vendor_ie(struct sk_buff *skb,
 	skb_trim(skb, skb->len - len);
 }
 
-static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl,
-					 struct ieee80211_vif *vif,
-					 u8 *probe_rsp_data,
-					 size_t probe_rsp_len,
-					 u32 rates)
+static int wl1271_ap_set_probe_resp_tmpl(struct wl1271 *wl, u32 rates)
+{
+	struct sk_buff *skb;
+	int ret;
+
+	skb = ieee80211_proberesp_get(wl->hw, wl->vif);
+	if (!skb)
+		return -EINVAL;
+
+	ret = wl1271_cmd_template_set(wl,
+				      CMD_TEMPL_AP_PROBE_RESPONSE,
+				      skb->data,
+				      skb->len, 0,
+				      rates);
+
+	if (!ret)
+		set_bit(WL1271_FLAG_PROBE_RESP_SET, &wl->flags);
+
+	dev_kfree_skb(skb);
+	return ret;
+}
+
+static int wl1271_ap_set_probe_resp_tmpl_legacy(struct wl1271 *wl,
+					     struct ieee80211_vif *vif,
+					     u8 *probe_rsp_data,
+					     size_t probe_rsp_len,
+					     u32 rates)
 {
 	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
 	struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
@@ -3428,6 +3450,13 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
 		wlvif->beacon_int = bss_conf->beacon_int;
 	}
 
+	if ((changed & BSS_CHANGED_AP_PROBE_RESP) && is_ap) {
+		ret = wl1271_ap_set_probe_resp_tmpl(wl,
+			wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set));
+		if (ret < 0)
+			goto out;
+	}
+
 	if ((changed & BSS_CHANGED_BEACON)) {
 		struct ieee80211_hdr *hdr;
 		u32 min_rate;
@@ -3436,8 +3465,10 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
 		struct sk_buff *beacon = ieee80211_beacon_get(wl->hw, vif);
 		u16 tmpl_id;
 
-		if (!beacon)
+		if (!beacon) {
+			ret = -EINVAL;
 			goto out;
+		}
 
 		wl1271_debug(DEBUG_MASTER, "beacon updated");
 
@@ -3458,6 +3489,13 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
 			goto out;
 		}
 
+		/*
+		 * In case we already have a probe-resp beacon set explicitly
+		 * by usermode, don't use the beacon data.
+		 */
+		if (test_bit(WL1271_FLAG_PROBE_RESP_SET, &wl->flags))
+			goto end_bcn;
+
 		/* remove TIM ie from probe response */
 		wl12xx_remove_ie(beacon, WLAN_EID_TIM, ieoffset);
 
@@ -3476,7 +3514,7 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
 		hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
 						 IEEE80211_STYPE_PROBE_RESP);
 		if (is_ap)
-			ret = wl1271_ap_set_probe_resp_tmpl(wl, vif,
+			ret = wl1271_ap_set_probe_resp_tmpl_legacy(wl, vif,
 						beacon->data,
 						beacon->len,
 						min_rate);
@@ -3486,12 +3524,15 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
 						beacon->data,
 						beacon->len, 0,
 						min_rate);
+end_bcn:
 		dev_kfree_skb(beacon);
 		if (ret < 0)
 			goto out;
 	}
 
 out:
+	if (ret != 0)
+		wl1271_error("beacon info change failed: %d", ret);
 	return ret;
 }
 
@@ -3548,6 +3589,8 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
 					goto out;
 
 				clear_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags);
+				clear_bit(WL1271_FLAG_PROBE_RESP_SET,
+					    &wl->flags);
 				wl1271_debug(DEBUG_AP, "stopped AP");
 			}
 		}
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index b7036df..a117c9d 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -255,6 +255,7 @@ enum wl12xx_flags {
 	WL1271_FLAG_PENDING_WORK,
 	WL1271_FLAG_SOFT_GEMINI,
 	WL1271_FLAG_RECOVERY_IN_PROGRESS,
+	WL1271_FLAG_PROBE_RESP_SET,
 };
 
 enum wl12xx_vif_flags {
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH 1/2] wl12xx: configure the probe response offloading support
From: Guy Eilam @ 2011-10-22 13:14 UTC (permalink / raw)
  To: coelho; +Cc: linux-wireless

Configure and respond to a probe response offload query with
the relevant protocols supported currently by the driver.

Signed-off-by: Guy Eilam <guy@wizery.com>
---
 drivers/net/wireless/wl12xx/conf.h |    2 ++
 drivers/net/wireless/wl12xx/main.c |   15 +++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h
index 04bb8fb..714f9d4 100644
--- a/drivers/net/wireless/wl12xx/conf.h
+++ b/drivers/net/wireless/wl12xx/conf.h
@@ -1264,6 +1264,8 @@ struct conf_drv_settings {
 	struct conf_rate_policy_settings rate;
 	struct conf_hangover_settings hangover;
 	u8 hci_io_ds;
+	/* a bitmap of supported protocols for probe response offloading */
+	u32 probe_resp_offload;
 };
 
 #endif
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index f76be5a..0a7d020 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -373,6 +373,10 @@ static struct conf_drv_settings default_conf = {
 		.increase_time              = 1,
 		.window_size                = 16,
 	},
+	.probe_resp_offload =
+		BIT(NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS) |
+		BIT(NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2) |
+		BIT(NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P),
 };
 
 static char *fwlog_param;
@@ -4081,6 +4085,16 @@ static int wl1271_op_get_survey(struct ieee80211_hw *hw, int idx,
 	return 0;
 }
 
+static int wl1271_op_get_probe_resp_offload(struct ieee80211_hw *hw,
+				u32 *supp_protocols)
+{
+	struct wl1271 *wl = hw->priv;
+
+	*supp_protocols = wl->conf.probe_resp_offload;
+
+	return 0;
+}
+
 static int wl1271_allocate_sta(struct wl1271 *wl,
 			     struct wl12xx_vif *wlvif,
 			     struct ieee80211_sta *sta)
@@ -4666,6 +4680,7 @@ static const struct ieee80211_ops wl1271_ops = {
 	.tx_frames_pending = wl1271_tx_frames_pending,
 	.set_bitrate_mask = wl12xx_set_bitrate_mask,
 	.channel_switch = wl12xx_op_channel_switch,
+	.get_probe_resp_offload = wl1271_op_get_probe_resp_offload,
 	CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
 };
 
-- 
1.7.4.1


^ permalink raw reply related

* Re: [PATCH 1/3] ARM: Samsung: Move timer irq numbers to end of linux irq space
From: Grant Likely @ 2011-10-21 19:45 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: 'Changhwan Youn', 'Thomas Abraham',
	devicetree-discuss, linux-samsung-soc, linux-arm-kernel,
	rob.herring, patches, 'Nicolas Pitre'
In-Reply-To: <017001cc8fd7$c27e4ee0$477aeca0$%kim@samsung.com>

On Fri, Oct 21, 2011 at 06:56:52PM +0900, Kukjin Kim wrote:
> Changhwan Youn wrote:
> > 
> > Hi Thomas,
> > 
> > All UART_IRQ_RXD, TXD, ERR of Samsung's platforms are also statically
> > mapped to linux irq numbers 16 to 31. These interrupts also need proper
> handling.
> > 
> > Best regards,
> > Changhwan Youn
> > 
> 
> Hi all,
> 
> Hmm, I'd like to apply Thomas' device tree series for EXYNOS4 and Samsung
> stuff for upcoming merge window but there are still some comments on some
> stuff and that should be fixed before applying. In addition I need to keep
> the ordering to apply them to avoid conflicts. But as you know, v3.1 is now
> close at hand and we don't have enough time for it now :(
> 
> I will leave tomorrow morning (KST) for KS. I will talk to Grant Likely
> about this in Prague :)

One of the goals I have for the hacking summit is to get as much of
the outstanding DT patches queued up and into linux-next.

g.

> 
> Thanks.
> 
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
> 
> > On 10/10/2011 03:11 AM, Thomas Abraham wrote:
> > > All of Samsung's s5p platforms have timer irqs statically mapped from
> linux
> > > irq numbers 11 to 15. These timer irqs are moved to end of the
> statically
> > > mapped linux irq space and the hardware irqs, which were statically
> mapped
> > > starting from 32 is moved to start from 0. The NR_IRQS macro is
> consolidated
> > > for all the s5p platforms in this process.
> > >
> > > Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> > > ---
> > >  arch/arm/mach-exynos4/include/mach/entry-macro.S |    1 -
> > >  arch/arm/mach-exynos4/include/mach/irqs.h        |    3 +--
> > >  arch/arm/mach-s5p64x0/include/mach/irqs.h        |    4 +---
> > >  arch/arm/mach-s5pc100/include/mach/irqs.h        |    3 +--
> > >  arch/arm/mach-s5pv210/include/mach/irqs.h        |    3 +--
> > >  arch/arm/plat-samsung/include/plat/irqs.h        |    7 +++++--
> > >  6 files changed, 9 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/arch/arm/mach-exynos4/include/mach/entry-macro.S
> b/arch/arm/mach-
> > > exynos4/include/mach/entry-macro.S
> > > index 4c9adbd..5c4fbcc 100644
> > > --- a/arch/arm/mach-exynos4/include/mach/entry-macro.S
> > > +++ b/arch/arm/mach-exynos4/include/mach/entry-macro.S
> > > @@ -72,7 +72,6 @@
> > >  		cmpcc	\irqnr, \irqnr
> > >  		cmpne	\irqnr, \tmp
> > >  		cmpcs	\irqnr, \irqnr
> > > -		addne	\irqnr, \irqnr, #32
> > >
> > >  		.endm
> > >
> > > diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h b/arch/arm/mach-
> > exynos4/include/mach/irqs.h
> > > index dfd4b7e..43087c3 100644
> > > --- a/arch/arm/mach-exynos4/include/mach/irqs.h
> > > +++ b/arch/arm/mach-exynos4/include/mach/irqs.h
> > > @@ -163,7 +163,6 @@
> > >  #define IRQ_GPIO2_NR_GROUPS	9
> > >  #define IRQ_GPIO_END		(S5P_GPIOINT_BASE +
> > S5P_GPIOINT_COUNT)
> > >
> > > -/* Set the default NR_IRQS */
> > > -#define NR_IRQS			(IRQ_GPIO_END + 64)
> > > +#define IRQ_TIMER_BASE		(IRQ_GPIO_END + 64)
> > >
> > >  #endif /* __ASM_ARCH_IRQS_H */
> > > diff --git a/arch/arm/mach-s5p64x0/include/mach/irqs.h b/arch/arm/mach-
> > s5p64x0/include/mach/irqs.h
> > > index 53982db..bea73cc 100644
> > > --- a/arch/arm/mach-s5p64x0/include/mach/irqs.h
> > > +++ b/arch/arm/mach-s5p64x0/include/mach/irqs.h
> > > @@ -141,8 +141,6 @@
> > >
> > >  #define IRQ_EINT_GROUP(grp, x)	(IRQ_EINT_GROUP##grp##_BASE +
> > (x))
> > >
> > > -/* Set the default NR_IRQS */
> > > -
> > > -#define NR_IRQS			(IRQ_EINT_GROUP8_BASE +
> > IRQ_EINT_GROUP8_NR + 1)
> > > +#define IRQ_TIMER_BASE		(IRQ_EINT_GROUP8_BASE +
> > IRQ_EINT_GROUP8_NR + 1)
> > >
> > >  #endif /* __ASM_ARCH_IRQS_H */
> > > diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-
> > s5pc100/include/mach/irqs.h
> > > index d2eb475..3a9d300 100644
> > > --- a/arch/arm/mach-s5pc100/include/mach/irqs.h
> > > +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
> > > @@ -104,8 +104,7 @@
> > >  #define S5P_GPIOINT_BASE	(IRQ_EINT(31) + 1)
> > >  #define S5P_GPIOINT_GROUP_MAXNR	21
> > >
> > > -/* Set the default NR_IRQS */
> > > -#define NR_IRQS			(IRQ_EINT(31) +
> > S5P_GPIOINT_COUNT + 1)
> > > +#define IRQ_TIMER_BASE		(IRQ_EINT(31) +
> > S5P_GPIOINT_COUNT + 1)
> > >
> > >  /* Compatibility */
> > >  #define IRQ_LCD_FIFO		IRQ_LCD0
> > > diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-
> > s5pv210/include/mach/irqs.h
> > > index 5e0de3a..df3173a 100644
> > > --- a/arch/arm/mach-s5pv210/include/mach/irqs.h
> > > +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
> > > @@ -125,8 +125,7 @@
> > >  #define S5P_GPIOINT_BASE	(IRQ_EINT(31) + 1)
> > >  #define S5P_GPIOINT_GROUP_MAXNR	22
> > >
> > > -/* Set the default NR_IRQS */
> > > -#define NR_IRQS			(IRQ_EINT(31) +
> > S5P_GPIOINT_COUNT + 1)
> > > +#define IRQ_TIMER_BASE		(IRQ_EINT(31) +
> > S5P_GPIOINT_COUNT + 1)
> > >
> > >  /* Compatibility */
> > >  #define IRQ_LCD_FIFO		IRQ_LCD0
> > > diff --git a/arch/arm/plat-samsung/include/plat/irqs.h b/arch/arm/plat-
> > samsung/include/plat/irqs.h
> > > index 08d1a7e..b8918b3 100644
> > > --- a/arch/arm/plat-samsung/include/plat/irqs.h
> > > +++ b/arch/arm/plat-samsung/include/plat/irqs.h
> > > @@ -22,7 +22,7 @@
> > >   * mulitple of 32 to allow the common code to work
> > >   */
> > >
> > > -#define S5P_IRQ_OFFSET		(32)
> > > +#define S5P_IRQ_OFFSET		(0)
> > >
> > >  #define S5P_IRQ(x)		((x) + S5P_IRQ_OFFSET)
> > >
> > > @@ -44,13 +44,14 @@
> > >  #define S5P_IRQ_VIC2(x)		(S5P_VIC2_BASE + (x))
> > >  #define S5P_IRQ_VIC3(x)		(S5P_VIC3_BASE + (x))
> > >
> > > -#define S5P_TIMER_IRQ(x)	(11 + (x))
> > > +#define S5P_TIMER_IRQ(x)	(IRQ_TIMER_BASE + (x))
> > >
> > >  #define IRQ_TIMER0		S5P_TIMER_IRQ(0)
> > >  #define IRQ_TIMER1		S5P_TIMER_IRQ(1)
> > >  #define IRQ_TIMER2		S5P_TIMER_IRQ(2)
> > >  #define IRQ_TIMER3		S5P_TIMER_IRQ(3)
> > >  #define IRQ_TIMER4		S5P_TIMER_IRQ(4)
> > > +#define IRQ_TIMER_COUNT		(5)
> > >
> > >  #define IRQ_EINT(x)		((x) < 16 ? ((x) + S5P_EINT_BASE1) \
> > >  					: ((x) - 16 + S5P_EINT_BASE2))
> > > @@ -77,4 +78,6 @@
> > >  #define S5P_IRQ_TYPE_EDGE_RISING	(0x03)
> > >  #define S5P_IRQ_TYPE_EDGE_BOTH		(0x04)
> > >
> > > +#define NR_IRQS			(IRQ_TIMER_BASE +
> > IRQ_TIMER_COUNT)
> > > +
> > >  #endif /* __PLAT_SAMSUNG_IRQS_H */
> > > --
> > > 1.6.6.rc2
> > >
> > >
> > > _______________________________________________
> > > linux-arm-kernel mailing list
> > > linux-arm-kernel@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply

* Re: [PATCH 0/3] ARM 4Kstacks: introduction
From: Måns Rullgård @ 2011-10-22 13:13 UTC (permalink / raw)
  To: Ming Lei
  Cc: Arnd Bergmann, linux-arm-kernel, Tim Bird, Joe Perches,
	linux kernel, Andi Kleen, Russell King, Thomas Gleixner
In-Reply-To: <CACVXFVMb9p8PiTYWGTNn-FtQts0sRgmK+BQ6kaJ6-D89CAT=xQ@mail.gmail.com>

Ming Lei <tom.leiming@gmail.com> writes:

> On Wed, Oct 19, 2011 at 6:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Tuesday 18 October 2011 17:26:44 Tim Bird wrote:
>>> Even inside Sony, usage of 4K stacks is limited
>>> to some very special cases, where memory is exceedingly
>>> tight (we have one system with 4M of RAM).  And we
>>> don't mind lopping off features or coding around
>>> problem areas to support our special case.
>>
>> I would imagine that in those cases, you can gain more by reducing the
>> number of threads in the system. What is the highest number of
>> concurrent threads that you expect in a limited use case with no
>> networking or block devices?
>
> If system run for some time, sometimes it may be difficult for
> memory allocator to allocate 2 continuous page frames even  there are
> many spare page frames in system because of
> fragment issue, so the patch does make sense. Anyway,
> it provides one option for user to apply 4k stack to avoid
> such kind of process creation failure.

Can't page migration be used in these situations?

-- 
Måns Rullgård
mans@mansr.com

^ permalink raw reply

* [PATCH 0/3] ARM 4Kstacks: introduction
From: Måns Rullgård @ 2011-10-22 13:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACVXFVMb9p8PiTYWGTNn-FtQts0sRgmK+BQ6kaJ6-D89CAT=xQ@mail.gmail.com>

Ming Lei <tom.leiming@gmail.com> writes:

> On Wed, Oct 19, 2011 at 6:51 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Tuesday 18 October 2011 17:26:44 Tim Bird wrote:
>>> Even inside Sony, usage of 4K stacks is limited
>>> to some very special cases, where memory is exceedingly
>>> tight (we have one system with 4M of RAM). ?And we
>>> don't mind lopping off features or coding around
>>> problem areas to support our special case.
>>
>> I would imagine that in those cases, you can gain more by reducing the
>> number of threads in the system. What is the highest number of
>> concurrent threads that you expect in a limited use case with no
>> networking or block devices?
>
> If system run for some time, sometimes it may be difficult for
> memory allocator to allocate 2 continuous page frames even  there are
> many spare page frames in system because of
> fragment issue, so the patch does make sense. Anyway,
> it provides one option for user to apply 4k stack to avoid
> such kind of process creation failure.

Can't page migration be used in these situations?

-- 
M?ns Rullg?rd
mans at mansr.com

^ permalink raw reply

* [PATCH] test/testdisplay:add cursor test
From: Hai Lan @ 2011-10-23  2:03 UTC (permalink / raw)
  To: jbarnes; +Cc: intel-gfx

Signed-off-by: Hai Lan <hai.lan@intel.com>
---
 tests/testdisplay.c |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 01f31dc..174d5c7 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -75,7 +75,7 @@ struct udev_monitor *uevent_monitor;
 drmModeRes *resources;
 int fd, modes;
 int dump_info = 0, test_all_modes =0, test_preferred_mode = 0, force_mode = 0,
-	test_plane, enable_tiling;
+	test_plane, enable_tiling, test_cursor;
 int sleep_between_modes = 5;
 uint32_t depth = 24;
 
@@ -823,7 +823,7 @@ set_mode(struct connector *c)
 		cairo_surface_t *surface;
 		cairo_status_t status;
 		cairo_t *cr;
-		uint32_t handle;
+		uint32_t handle,cursor_handle;
 
 		if (test_all_modes)
 			c->mode = c->connector->modes[j];
@@ -872,7 +872,6 @@ set_mode(struct connector *c)
 				   handle, &fb_id);
 		cairo_surface_destroy(surface);
 		gem_close(fd, handle);
-
 		if (ret) {
 			fprintf(stderr, "failed to add fb (%dx%d): %s\n",
 				width, height, strerror(errno));
@@ -888,6 +887,21 @@ set_mode(struct connector *c)
 			continue;
 		}
 
+		if (test_cursor) {
+			cursor_handle = gem_create(fd,64*64*4);
+			char * cursor_buff = gem_mmap(fd, cursor_handle, 64*64*4, PROT_READ | PROT_WRITE);
+			for(int i=0;i<64*64*4;i++)
+				*(cursor_buff+i)=0xff;
+
+			drmModeSetCursor(fd,c->crtc,cursor_handle,64,64);
+			for(int i=0;i<10;i++) {
+				drmModeMoveCursor(fd,c->crtc,i*100, 0);
+				sleep(1);
+			}
+			drmModeSetCursor(fd,c->crtc,0,64,64);
+			gem_close(fd, cursor_handle);
+		}
+
 		if (test_plane)
 			enable_plane(c);
 
@@ -931,7 +945,7 @@ static int update_display(void)
 		dump_planes();
 	}
 
-	if (test_preferred_mode || test_all_modes || force_mode) {
+	if (test_preferred_mode || test_all_modes || force_mode || test_cursor) {
 		/* Find any connected displays */
 		for (c = 0; c < resources->count_connectors; c++) {
 			connectors[c].id = resources->connectors[c];
@@ -944,11 +958,11 @@ static int update_display(void)
 
 extern char *optarg;
 extern int optind, opterr, optopt;
-static char optstr[] = "hiaf:s:d:pmt";
+static char optstr[] = "hiaf:s:d:pmtc";
 
 static void usage(char *name)
 {
-	fprintf(stderr, "usage: %s [-hiafs]\n", name);
+	fprintf(stderr, "usage: %s [-hiaf:s:d:pmtc]\n", name);
 	fprintf(stderr, "\t-i\tdump info\n");
 	fprintf(stderr, "\t-a\ttest all modes\n");
 	fprintf(stderr, "\t-s\t<duration>\tsleep between each mode test\n");
@@ -959,6 +973,7 @@ static void usage(char *name)
 	fprintf(stderr, "\t-f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n");
 	fprintf(stderr, "\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n");
 	fprintf(stderr, "\t\ttest force mode\n");
+	fprintf(stderr, "\t-c\ttest cursor\n");
 	fprintf(stderr, "\tDefault is to test all modes.\n");
 	exit(0);
 }
@@ -1048,6 +1063,9 @@ int main(int argc, char **argv)
 		case 't':
 			enable_tiling = 1;
 			break;
+		case 'c':
+			test_cursor = 1;
+			break;
 		default:
 			fprintf(stderr, "unknown option %c\n", c);
 			/* fall through */
@@ -1057,7 +1075,7 @@ int main(int argc, char **argv)
 		}
 	}
 	if (!test_all_modes && !force_mode && !dump_info &&
-	    !test_preferred_mode)
+	    !test_preferred_mode && !test_cursor)
 		test_all_modes = 1;
 
 	for (i = 0; i < ARRAY_SIZE(modules); i++) {
-- 
1.7.0.1

^ permalink raw reply related

* [PATCH 3/4] nl80211: Pass probe response data to drivers
From: Guy Eilam @ 2011-10-22 13:11 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless
In-Reply-To: <1319289112-21896-1-git-send-email-guy@wizery.com>

Allow usermode to pass probe-response data. This data can be used as a
template probe-response offloading.

Signed-off-by: Guy Eilam <guy@wizery.com>
---
 include/linux/nl80211.h |    4 ++++
 include/net/cfg80211.h  |    4 ++++
 net/wireless/nl80211.c  |   11 +++++++++++
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index a436f74..6369631 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1114,6 +1114,8 @@ enum nl80211_commands {
  *	In addition this attribute holds a bitmap of the supported protocols
  *	for offloading using &enum nl80211_probe_resp_offload_support_attr.
  *
+ * @NL80211_ATTR_PROBE_RESP: Probe Response template data
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1344,6 +1346,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_PROBE_RESP_OFFLOAD_SUPPORT,
 
+	NL80211_ATTR_PROBE_RESP,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b5ddd62..eb8b8c5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -737,6 +737,8 @@ struct mpath_info {
  * @ap_isolate: do not forward packets between connected stations
  * @ht_opmode: HT Operation mode
  * 	(u16 = opmode, -1 = do not change)
+ * @probe_resp_len: length of probe response template (@probe_resp)
+ * @probe_resp: probe response template (AP mode only)
  */
 struct bss_parameters {
 	int use_cts_prot;
@@ -746,6 +748,8 @@ struct bss_parameters {
 	u8 basic_rates_len;
 	int ap_isolate;
 	int ht_opmode;
+	int probe_resp_len;
+	u8 *probe_resp;
 };
 
 /*
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ad90ec4..aadca02 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -197,6 +197,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_TDLS_OPERATION] = { .type = NLA_U8 },
 	[NL80211_ATTR_TDLS_SUPPORT] = { .type = NLA_FLAG },
 	[NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG },
+	[NL80211_ATTR_PROBE_RESP] = { .type = NLA_BINARY,
+				      .len = IEEE80211_MAX_DATA_LEN },
 };
 
 /* policy for the key attributes */
@@ -2978,6 +2980,15 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
 	if (info->attrs[NL80211_ATTR_BSS_HT_OPMODE])
 		params.ht_opmode =
 			nla_get_u16(info->attrs[NL80211_ATTR_BSS_HT_OPMODE]);
+	if (info->attrs[NL80211_ATTR_PROBE_RESP]) {
+		if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP)
+			return -EOPNOTSUPP;
+
+		params.probe_resp =
+			nla_data(info->attrs[NL80211_ATTR_PROBE_RESP]);
+		params.probe_resp_len =
+			nla_len(info->attrs[NL80211_ATTR_PROBE_RESP]);
+	}
 
 	if (!rdev->ops->change_bss)
 		return -EOPNOTSUPP;
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH 4/4] mac80211: Save probe response data for BSS
From: Guy Eilam @ 2011-10-22 13:11 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless
In-Reply-To: <1319289112-21896-1-git-send-email-guy@wizery.com>

Allow setting a probe response template for an interface operating in
AP mode. Low level drivers are notified about changes in the probe
response template and are able to retrieve a copy of the current probe
response. This data can, for example, be uploaded to hardware as a
template.

Signed-off-by: Guy Eilam <guy@wizery.com>
---
 include/net/mac80211.h     |   15 +++++++++++++++
 net/mac80211/cfg.c         |   35 +++++++++++++++++++++++++++++++++++
 net/mac80211/ieee80211_i.h |    1 +
 net/mac80211/iface.c       |    6 +++++-
 net/mac80211/tx.c          |   31 +++++++++++++++++++++++++++++++
 net/mac80211/util.c        |    3 ++-
 6 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 1c58fd7..050aa32 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -166,6 +166,7 @@ struct ieee80211_low_level_stats {
  *	that it is only ever disabled for station mode.
  * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface.
  * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode)
+ * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode)
  */
 enum ieee80211_bss_change {
 	BSS_CHANGED_ASSOC		= 1<<0,
@@ -184,6 +185,7 @@ enum ieee80211_bss_change {
 	BSS_CHANGED_QOS			= 1<<13,
 	BSS_CHANGED_IDLE		= 1<<14,
 	BSS_CHANGED_SSID		= 1<<15,
+	BSS_CHANGED_AP_PROBE_RESP	= 1<<16,
 
 	/* when adding here, make sure to change ieee80211_reconfig */
 };
@@ -2662,6 +2664,19 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
 }
 
 /**
+ * ieee80211_proberesp_get - retrieve a Probe Response template
+ * @hw: pointer obtained from ieee80211_alloc_hw().
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
+ *
+ * Creates a Probe Response template which can, for example, be uploaded to
+ * hardware. The destination address should be set by the caller.
+ *
+ * Can only be called in AP mode.
+ */
+struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw,
+					struct ieee80211_vif *vif);
+
+/**
  * ieee80211_pspoll_get - retrieve a PS Poll template
  * @hw: pointer obtained from ieee80211_alloc_hw().
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 3cdb4a9..e2ad3da 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1230,6 +1230,34 @@ static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev)
 }
 #endif
 
+static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata,
+				    u8 *resp, size_t resp_len)
+{
+	struct sk_buff *new, *old;
+
+	old = sdata->u.ap.probe_resp;
+
+	if (!resp || !resp_len)
+		return -EINVAL;
+
+	new = dev_alloc_skb(resp_len);
+	if (!new) {
+		printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
+		       "response template\n", sdata->name);
+		return -ENOMEM;
+	}
+
+	memcpy(skb_put(new, resp_len), resp, resp_len);
+
+	rcu_assign_pointer(sdata->u.ap.probe_resp, new);
+	synchronize_rcu();
+
+	if (old)
+		dev_kfree_skb(old);
+
+	return 0;
+}
+
 static int ieee80211_change_bss(struct wiphy *wiphy,
 				struct net_device *dev,
 				struct bss_parameters *params)
@@ -1292,6 +1320,13 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
 		changed |= BSS_CHANGED_HT;
 	}
 
+	if (params->probe_resp_len > 0) {
+		int ret = ieee80211_set_probe_resp(sdata, params->probe_resp,
+						   params->probe_resp_len);
+		if (!ret)
+			changed |= BSS_CHANGED_AP_PROBE_RESP;
+	}
+
 	ieee80211_bss_info_change_notify(sdata, changed);
 
 	return 0;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 9fa5f8a..41f2a9a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -230,6 +230,7 @@ struct beacon_data {
 
 struct ieee80211_if_ap {
 	struct beacon_data __rcu *beacon;
+	struct sk_buff __rcu *probe_resp;
 
 	struct list_head vlans;
 
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index ef741e8..74d6f79 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -450,15 +450,19 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		struct ieee80211_sub_if_data *vlan, *tmpsdata;
 		struct beacon_data *old_beacon =
 			rtnl_dereference(sdata->u.ap.beacon);
+		struct sk_buff *old_probe_resp =
+			rtnl_dereference(sdata->u.ap.probe_resp);
 
 		/* sdata_running will return false, so this will disable */
 		ieee80211_bss_info_change_notify(sdata,
 						 BSS_CHANGED_BEACON_ENABLED);
 
-		/* remove beacon */
+		/* remove beacon and probe response */
 		rcu_assign_pointer(sdata->u.ap.beacon, NULL);
+		rcu_assign_pointer(sdata->u.ap.probe_resp, NULL);
 		synchronize_rcu();
 		kfree(old_beacon);
+		kfree(old_probe_resp);
 
 		/* down all dependent devices, that is VLANs */
 		list_for_each_entry_safe(vlan, tmpsdata, &sdata->u.ap.vlans,
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index ad2ee4a..1f077e2 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2414,6 +2414,37 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
 }
 EXPORT_SYMBOL(ieee80211_beacon_get_tim);
 
+struct sk_buff *ieee80211_proberesp_get(struct ieee80211_hw *hw,
+					struct ieee80211_vif *vif)
+{
+	struct ieee80211_if_ap *ap = NULL;
+	struct sk_buff *presp = NULL, *skb = NULL;
+	struct ieee80211_hdr *hdr;
+	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+
+	if (sdata->vif.type != NL80211_IFTYPE_AP)
+		return NULL;
+
+	rcu_read_lock();
+
+	ap = &sdata->u.ap;
+	presp = rcu_dereference(ap->probe_resp);
+	if (!presp)
+		goto out;
+
+	skb = skb_copy(presp, GFP_ATOMIC);
+	if (!skb)
+		goto out;
+
+	hdr = (struct ieee80211_hdr *) skb->data;
+	memset(hdr->addr1, 0, sizeof(hdr->addr1));
+
+out:
+	rcu_read_unlock();
+	return skb;
+}
+EXPORT_SYMBOL(ieee80211_proberesp_get);
+
 struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw,
 				     struct ieee80211_vif *vif)
 {
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 7439d26..d6d3ef4 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1085,7 +1085,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 			changed |= BSS_CHANGED_IBSS;
 			/* fall through */
 		case NL80211_IFTYPE_AP:
-			changed |= BSS_CHANGED_SSID;
+			changed |= BSS_CHANGED_SSID |
+				   BSS_CHANGED_AP_PROBE_RESP;
 			/* fall through */
 		case NL80211_IFTYPE_MESH_POINT:
 			changed |= BSS_CHANGED_BEACON |
-- 
1.7.4.1


^ permalink raw reply related


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.