* Re: adding swap workarounds oom - was: Re: Out of Memory: Killed process 16498 (java).
From: Jens Axboe @ 2006-03-01 14:34 UTC (permalink / raw)
To: Andi Kleen
Cc: Andy Chittenden, Anton Altaparmakov, Andrew Morton, davej,
linux-kernel, lwoodman, Bartlomiej Zolnierkiewicz
In-Reply-To: <200603011526.39457.ak@suse.de>
On Wed, Mar 01 2006, Andi Kleen wrote:
> On Wednesday 01 March 2006 15:18, Jens Axboe wrote:
> > On Wed, Mar 01 2006, Andi Kleen wrote:
> > > On Wednesday 01 March 2006 14:41, Jens Axboe wrote:
> > > > On Wed, Mar 01 2006, Andy Chittenden wrote:
> > > > > with revised patch that does:
> > > > >
> > > > > printk("sg%d: dma=%llx, dma_len=%u/%u, pfn=%lu\n", i,
> > > > > (unsigned long long) sg->dma_address, sg->dma_length, sg->offset,
> > > > > page_to_pfn(sg->page));
> > > >
> > > > That is correct, thanks!
> > > >
> > > > > hda: DMA table too small
> > > > > ide dma table, 255 entries, bounce pfn 1310720
> > > > > sg0: dma=81c8800, dma_len=4096/0, pfn=1296369
> > > >
> > > > Still the same badness here, it's 2kb into a page so straddles two pages
> > > > for one entry.
> > >
> > > That's normal if it was in the IOMMU and a merged entry.
> > >
> > > You can try iommu=nomerge.
> > >
> > > Or maybe the higher layers are passing in physically continuous pages
> > > that get merged? Not too unlikely at boot.
> >
> > But that would have to be 1kb or 512b io going in
>
> Yes. Why not?
It's not totally out of the question, but I would say it's unlikely.
Andy, I have generated a new debug patch that also dumps the request in
question, can you apply that one? It replaces the earlier patch...
> > > > Andi, any idea what is going on here? Why is this throwing up all of a
> > > > sudden??
> > >
> > > What is throwing up exactly?
> > >
> > > There was a change recently in the merging algorithm, but it shouldn't
> > > cause any bad side effects for correct users of *_map_sg()
> >
> > That the request we end up passing to blk_rq_map_sg() and then to
> > pci_map_sg() ends up with more entries than the driver advertised. So
> > far I think only Andy reported this, and then only with your
> > blk_queue_bounce_limit() patch applied.
>
> It shouldn't end up with more, only with less.
Sure yes, but if that 'less' is still more than what the driver can
handle, then there's a problem.
> Does iommu=nomerge make a difference?
Andy?
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 0523da7..f893f98 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -221,6 +221,37 @@ int ide_build_sglist(ide_drive_t *drive,
EXPORT_SYMBOL_GPL(ide_build_sglist);
+static void dump_dma_table(ide_drive_t *drive, struct request *rq)
+{
+ ide_hwif_t *hwif = HWIF(drive);
+ request_queue_t *q = drive->queue;
+ struct bio *bio;
+ struct bio_vec *bvec;
+ int i;
+
+ printk("ide dma table, %d entries, bounce pfn %lu\n", hwif->sg_nents, q->bounce_pfn);
+ for (i = 0; i < hwif->sg_nents; i++) {
+ struct scatterlist *sg = &hwif->sg_table[i];
+
+ printk("sg%d: dma=%llx, len=%u/%u, pfn=%lu\n", i, (unsigned long long) sg->dma_address, sg->dma_length, sg->offset, page_to_pfn(sg->page));
+ }
+
+ printk("request: phys seg %d, hw seg %d, nr_sectors %lu\n", rq->nr_phys_segments, rq->nr_hw_segments, rq->nr_sectors);
+ i = 0;
+ rq_for_each_bio(bio, rq) {
+ int j;
+
+ printk(" bio%d: bytes=%u, phys seg %d, hw seg %d\n", i, bio->bi_size, bio->bi_phys_segments, bio->bi_hw_segments);
+ bio_for_each_segment(bvec, bio, j) {
+ void *addr = page_address(bvec->bv_page);
+
+ printk(" bvec%d: addr=%p, size=%u, off=%u\n", j, addr, bvec->bv_len, bvec->bv_offset);
+ }
+ i++;
+ }
+
+}
+
/**
* ide_build_dmatable - build IDE DMA table
*
@@ -311,6 +342,7 @@ use_pio_instead:
hwif->sg_table,
hwif->sg_nents,
hwif->sg_dma_direction);
+ dump_dma_table(drive, rq);
return 0; /* revert to PIO for this request */
}
--
Jens Axboe
^ permalink raw reply related
* Re: adding swap workarounds oom - was: Re: Out of Memory: Killed process 16498 (java).
From: Andi Kleen @ 2006-03-01 14:26 UTC (permalink / raw)
To: Jens Axboe
Cc: Andy Chittenden, Anton Altaparmakov, Andrew Morton, davej,
linux-kernel, lwoodman, Bartlomiej Zolnierkiewicz
In-Reply-To: <20060301141848.GW4816@suse.de>
On Wednesday 01 March 2006 15:18, Jens Axboe wrote:
> On Wed, Mar 01 2006, Andi Kleen wrote:
> > On Wednesday 01 March 2006 14:41, Jens Axboe wrote:
> > > On Wed, Mar 01 2006, Andy Chittenden wrote:
> > > > with revised patch that does:
> > > >
> > > > printk("sg%d: dma=%llx, dma_len=%u/%u, pfn=%lu\n", i,
> > > > (unsigned long long) sg->dma_address, sg->dma_length, sg->offset,
> > > > page_to_pfn(sg->page));
> > >
> > > That is correct, thanks!
> > >
> > > > hda: DMA table too small
> > > > ide dma table, 255 entries, bounce pfn 1310720
> > > > sg0: dma=81c8800, dma_len=4096/0, pfn=1296369
> > >
> > > Still the same badness here, it's 2kb into a page so straddles two pages
> > > for one entry.
> >
> > That's normal if it was in the IOMMU and a merged entry.
> >
> > You can try iommu=nomerge.
> >
> > Or maybe the higher layers are passing in physically continuous pages
> > that get merged? Not too unlikely at boot.
>
> But that would have to be 1kb or 512b io going in
Yes. Why not?
> , I would expect 4kb to
> be the base entries for any normal type of setup (with a 4kb fs). The
> 8kb could be one such merged entry, I agree.
Probably yes.
> > > Andi, any idea what is going on here? Why is this throwing up all of a
> > > sudden??
> >
> > What is throwing up exactly?
> >
> > There was a change recently in the merging algorithm, but it shouldn't
> > cause any bad side effects for correct users of *_map_sg()
>
> That the request we end up passing to blk_rq_map_sg() and then to
> pci_map_sg() ends up with more entries than the driver advertised. So
> far I think only Andy reported this, and then only with your
> blk_queue_bounce_limit() patch applied.
It shouldn't end up with more, only with less.
Does iommu=nomerge make a difference?
-Andi
^ permalink raw reply
* Re: [patch] i386: port ATI timer fix from x86_64 to i386
From: Alistair John Strachan @ 2006-03-01 13:59 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: linux-kernel, Andrew Morton, Linus Torvalds
In-Reply-To: <200602281619_MC3-1-B984-ED75@compuserve.com>
On Tuesday 28 February 2006 21:17, Chuck Ebbert wrote:
> Disable timer routing over 8254 when an ATI chipset is detected
> (autodetect is only implemented for ACPI, but these are new systems
> and should be using ACPI anyway.) Adds boot options for manually
> disabling and enabling this feature. Also adds a note to the timer
> error message caused by this change explaining that this error
> is expected on ATI chipsets.
[snip]
>
> pin1 = find_isa_irq_pin(0, mp_INT);
> apic1 = find_isa_irq_apic(0, mp_INT);
> @@ -2294,7 +2311,7 @@ static inline void check_timer(void)
> }
> clear_IO_APIC_pin(apic1, pin1);
> printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
> - "IO-APIC\n");
> + "IO-APIC (expected on ATI chipsets)\n");
> }
>
This hunk looks bogus. My understanding is that this is a BIOS bug that some
vendors have started to correct. We shouldn't acknowledge vendor BIOS bugs as
"expected", imo..
I had this message for years with my nForce2/nForce3 boards and eventually it
was repaired.
--
Cheers,
Alistair.
'No sense being pessimistic, it probably wouldn't work anyway.'
Third year Computer Science undergraduate.
1F2 55 South Clerk Street, Edinburgh, UK.
^ permalink raw reply
* Re: 2.6.16-rc5-mm1
From: J.A. Magallon @ 2006-03-01 14:22 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
In-Reply-To: <20060301023235.735c8c47.akpm@osdl.org>
[-- Attachment #1: Type: text/plain, Size: 3032 bytes --]
On Wed, 1 Mar 2006 02:32:35 -0800, Andrew Morton <akpm@osdl.org> wrote:
>
> Useful, thanks. So the second batch of /proc patches are indeed the problem.
>
> If you have (even more) time you could test
> http://www.zip.com.au/~akpm/linux/patches/stuff/2.6.16-rc5-mm2-pre1.gz.
> That's the latest of everything with the problematic sysfs patches reverted
> and Eric's recent /proc fixes.
>
I just tried rc5-mm1 and this. With this I can run java apps/applets again
without locking my system.
I also applied the patch you posted for inotify, but now I get this new one:
Mar 1 15:11:04 werewolf kernel: [ 1424.891482] BUG: warning at fs/inotify.c:410/set_dentry_child_flags()
Mar 1 15:11:04 werewolf kernel: [ 1424.891494] <b0177dae> set_dentry_child_flags+0x10b/0x113 <b0178109> remove_watch_no_event+0x138/0x171
Mar 1 15:11:04 werewolf kernel: [ 1424.891545] <b0178195> inotify_release+0x53/0x193 <b01556fa> __fput+0x91/0x181
Mar 1 15:11:04 werewolf kernel: [ 1424.891578] <b0152e37> filp_close+0x3e/0x62 <b0146011> exit_mmap+0xc5/0x116
Mar 1 15:11:04 werewolf kernel: [ 1424.891619] <b011b297> put_files_struct+0x8b/0xf8 <b011c2ee> do_exit+0x152/0x8c0
Mar 1 15:11:04 werewolf kernel: [ 1424.891660] <b011ca85> do_group_exit+0x29/0x72 <b01256dd> get_signal_to_deliver+0x27c/0x42a
Mar 1 15:11:04 werewolf kernel: [ 1424.891686] <b01025fc> do_notify_resume+0x1a0/0x670 <b02a83d4> unix_sock_destructor+0x7a/0x10a
Mar 1 15:11:04 werewolf kernel: [ 1424.891721] <b02a6e25> unix_release_sock+0x237/0x26f <b0158742> invalidate_inode_buffers+0xa/0x53
Mar 1 15:11:04 werewolf kernel: [ 1424.891748] <b016b01d> destroy_inode+0x28/0x37 <b0130383> sys_futex+0xcc/0x122
Mar 1 15:11:04 werewolf kernel: [ 1424.891781] <b0102c92> work_notifysig+0x13/0x19
It looks like there are couple more WARN_ONs spread over inotify.c.
Full patch:
--- devel/fs/inotify.c~a 2006-03-01 02:47:01.000000000 -0800
+++ devel-akpm/fs/inotify.c 2006-03-01 02:47:06.000000000 -0800
@@ -402,12 +402,8 @@
list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
spin_lock(&child->d_lock);
if (watched) {
- WARN_ON(child->d_flags &
- DCACHE_INOTIFY_PARENT_WATCHED);
child->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED;
} else {
- WARN_ON(!(child->d_flags &
- DCACHE_INOTIFY_PARENT_WATCHED));
child->d_flags&=~DCACHE_INOTIFY_PARENT_WATCHED;
}
spin_unlock(&child->d_lock);
@@ -530,7 +530,6 @@ void inotify_d_instantiate(struct dentry
if (!inode)
return;
- WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
spin_lock(&entry->d_lock);
parent = entry->d_parent;
if (inotify_inode_watched(parent->d_inode))
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.15-jam14 (gcc 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* RE: CPU Frequency change using PLL
From: Bharathi Subramanian @ 2006-03-01 14:41 UTC (permalink / raw)
To: Nori, Soma Sekhar; +Cc: Linux MIPS
In-Reply-To: <CBD77117272E1249BFDC21E33D555FDC8E0743@dbde01.ent.ti.com>
On Tue, 28 Feb 2006, Nori, Soma Sekhar wrote:
> > During my try, after changing the PLL Freq, the board is stops
> > running. I feel, it is due to change in SDRAM Refresh rate. Is it
> > right ?? Any body tried this, Kindly share exprience with me. Like
> > how to reprogram the peripherals with-out affecting the operation
> > etc..
>
> Changing the PLL feeding only to the MIPS should not freeze the
> board. You are likely messing with PLL which feeds the peripherals
> as well.
No. PLL-A (Low Freq) is feeding to peripherals and PLL-B(High Feeq)
is feeding the MIPS. To save power, I switch from PLL-B to PLL-A
during run-time. After wirte in to PLL-Reg the MIPS Hangs. No reboot.
> Changing the PLL which feeds the SDRAM will also likely cause memory
> corruption. Try putting the SDRAM in self-refresh for the duration
> of PLL stablization and then re-program the SDRAM refresh rate.
I didn't tried this Self-Refresh trick, Let me try ...
Kindly CC to me.
Thanks :)
--
Bharathi S
^ permalink raw reply
* Re: adding swap workarounds oom - was: Re: Out of Memory: Killed process 16498 (java).
From: Jens Axboe @ 2006-03-01 14:18 UTC (permalink / raw)
To: Andi Kleen
Cc: Andy Chittenden, Anton Altaparmakov, Andrew Morton, davej,
linux-kernel, lwoodman, Bartlomiej Zolnierkiewicz
In-Reply-To: <200603011505.23222.ak@suse.de>
On Wed, Mar 01 2006, Andi Kleen wrote:
> On Wednesday 01 March 2006 14:41, Jens Axboe wrote:
> > On Wed, Mar 01 2006, Andy Chittenden wrote:
> > > with revised patch that does:
> > >
> > > printk("sg%d: dma=%llx, dma_len=%u/%u, pfn=%lu\n", i,
> > > (unsigned long long) sg->dma_address, sg->dma_length, sg->offset,
> > > page_to_pfn(sg->page));
> >
> > That is correct, thanks!
> >
> > > hda: DMA table too small
> > > ide dma table, 255 entries, bounce pfn 1310720
> > > sg0: dma=81c8800, dma_len=4096/0, pfn=1296369
> >
> > Still the same badness here, it's 2kb into a page so straddles two pages
> > for one entry.
>
> That's normal if it was in the IOMMU and a merged entry.
>
> You can try iommu=nomerge.
>
> Or maybe the higher layers are passing in physically continuous pages
> that get merged? Not too unlikely at boot.
But that would have to be 1kb or 512b io going in, I would expect 4kb to
be the base entries for any normal type of setup (with a 4kb fs). The
8kb could be one such merged entry, I agree.
> > Andi, any idea what is going on here? Why is this throwing up all of a
> > sudden??
>
> What is throwing up exactly?
>
> There was a change recently in the merging algorithm, but it shouldn't
> cause any bad side effects for correct users of *_map_sg()
That the request we end up passing to blk_rq_map_sg() and then to
pci_map_sg() ends up with more entries than the driver advertised. So
far I think only Andy reported this, and then only with your
blk_queue_bounce_limit() patch applied.
--
Jens Axboe
^ permalink raw reply
* Re: adding swap workarounds oom - was: Re: Out of Memory: Killed process 16498 (java).
From: Andi Kleen @ 2006-03-01 14:05 UTC (permalink / raw)
To: Jens Axboe
Cc: Andy Chittenden, Anton Altaparmakov, Andrew Morton, davej,
linux-kernel, lwoodman, Bartlomiej Zolnierkiewicz
In-Reply-To: <20060301134123.GU4816@suse.de>
On Wednesday 01 March 2006 14:41, Jens Axboe wrote:
> On Wed, Mar 01 2006, Andy Chittenden wrote:
> > with revised patch that does:
> >
> > printk("sg%d: dma=%llx, dma_len=%u/%u, pfn=%lu\n", i,
> > (unsigned long long) sg->dma_address, sg->dma_length, sg->offset,
> > page_to_pfn(sg->page));
>
> That is correct, thanks!
>
> > hda: DMA table too small
> > ide dma table, 255 entries, bounce pfn 1310720
> > sg0: dma=81c8800, dma_len=4096/0, pfn=1296369
>
> Still the same badness here, it's 2kb into a page so straddles two pages
> for one entry.
That's normal if it was in the IOMMU and a merged entry.
You can try iommu=nomerge.
Or maybe the higher layers are passing in physically continuous pages
that get merged? Not too unlikely at boot.
>
> Andi, any idea what is going on here? Why is this throwing up all of a
> sudden??
What is throwing up exactly?
There was a change recently in the merging algorithm, but it shouldn't
cause any bad side effects for correct users of *_map_sg()
-Andi
^ permalink raw reply
* Re: FYI SELinux/AppArmor press
From: Erich Schubert @ 2006-03-01 14:12 UTC (permalink / raw)
To: cwarner; +Cc: SE Linux
In-Reply-To: <1141183226.8475.22.camel@localhost.localdomain>
Hello Christopher,
Well, I'm still not running SELinux reference policy successfully.
So anything that actually works is easier to use...
E.g. if the reference policy would include a users_extra file that
labels /root
with sysadm prefix... and if that were documented anywhere and wouldn't
have required me to dive through the source of three packages.
Now if ssh login as sysadm_r would work, I'd be mostly done.
Albeit the documented interfaces of current RefPolicy are an
improvement, I don't think that policy writing has become much easier.
The M4 syntax is still very awkward (backticks, no semicolons), and
unless you've read all the policy thoroughly (e.g. because you've
written it), you'll have a hard time finding the right macros to call.
It's also very unintuitive when to use a macro/call an interface and
when not.
The current policy language is still very much "bottom up", i.e. "these
is our output, how can we generate it a bit easier", and not "top down",
i.e. "this is how we want to write the policy, how do we get a useful
output".
> How is AppArmor easier to use? Negating the fact that I would have to
> learn something new.
I've never looked at AppArmor, I've been using "old" strict SELinux for
some time, so I'd prefer to get the "new" modular SELinux work... I had
experimented with grctl1 ACL some time, which I guess are similar to
what AppArmor does. And I've seen the benefits of labeled processes and
transitions, so I'd like to stick with them.
best regards,
Erich Schubert
--
erich@(vitavonni.de|debian.org) -- GPG Key ID: 4B3A135C (o_
There was never a good war or a bad peace. - Benjamin Franklin //\
Ein schöner Moment leuchtet das Leben hindurch. V_/_
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply
* Re: [RFC] Add kernel<->userspace ABI stability documentation
From: Gabor Gombas @ 2006-03-01 14:10 UTC (permalink / raw)
To: Lars Marowsky-Bree; +Cc: linux-kernel
In-Reply-To: <20060301135356.GC23159@marowsky-bree.de>
On Wed, Mar 01, 2006 at 02:53:56PM +0100, Lars Marowsky-Bree wrote:
> The fact is that now we have user-space and kernel space tied together
> much more intimately than ever; udev & sysfs being the prime examples
> these days, and then it's not that some figure in top is wrong, but
> "oops my network no longer loads and the box is 400 miles away".
IMHO this is not a good example as there is really no reason to install
udev on such a box at all. Remember: KISS. Having a static /dev and
/etc/modules filled in (or even better, a monolithic kernel) is far more
reliable to administer.
On a desktop machine when you are plugging in various USB/Firewire/etc.
devices all the time udev works great. On a remote server there is no
real need for udev.
Gabor
--
---------------------------------------------------------
MTA SZTAKI Computer and Automation Research Institute
Hungarian Academy of Sciences
---------------------------------------------------------
^ permalink raw reply
* Re: Re: [PATCH] Xen Guest Kexec
From: Gerd Hoffmann @ 2006-03-01 14:10 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Ian Pratt, xen-devel, Mark Williamson, Horms
In-Reply-To: <44058EED.7060006@suse.de>
> Thanks. Unfortunaly I can take down Xen now by trying to use that code
> path, see the log below.
> (XEN) ----[ Xen-3.0.0 Not tainted ]----
> (XEN) CPU: 1
> (XEN) EIP: e008:[<ff13383c>] free_l2_table+0x53/0x78
xen tries to dereference a pointer it got from map_domain_page() here.
Guess it points into nowhere because we are running the idle page
tables, not the domain page tables at that point.
cheers,
Gerd
--
Gerd 'just married' Hoffmann <kraxel@suse.de>
I'm the hacker formerly known as Gerd Knorr.
http://www.suse.de/~kraxel/just-married.jpeg
^ permalink raw reply
* Re: [ANNOUNCE] LiSt - Linux Statistics - www.linux-stats.org
From: Alexander Mieland @ 2006-03-01 14:07 UTC (permalink / raw)
To: LKML
In-Reply-To: <20060301135916.GD23159@marowsky-bree.de>
[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]
Am Wednesday 01 March 2006 14:59 schrieben Sie:
> On 2006-02-28T18:12:37, Alexander Mieland <dma147@linux-stats.org> wrote:
> > - The installation date of your distribution
> > - The hostname (no fqdn or ips)
> > - The architecture (x86/i586/i686, ppc, and so on)
> > - CPU information: vendor, model, number of cpus, frequencies
> > - RAM
> > - Swap
> > - Timezone
> > - user defined locales
> > - Windowmanager
> > - Kernel version
> > - Uptime information
> > - The size of mounted partitions (no shares)
> > - the used filesystems
> > - The hardware-IDs of used ISA/PCI/AGP and USB hardware
>
> This is very useful to focus development, eventually. It would be nice
> if you could also come up with a way to provide feedback on the kernel
> modules used (loaded will do, but used would be cuter ;-).
hehe, something similar is already on my ToDo list. But thanks for
remembering me. *g*
--
Alexander 'dma147' Mieland 2.6.15-ck3-r1-fb-my4 SMP
FnuPG-ID: 27491179 Registered Linux-User #249600
http://blog.linux-stats.org http://www.linux-stats.org
http://www.mieland-programming.de http://www.php-programs.de
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] strndup_user (v3), convert (keyctl)
From: David Howells @ 2006-03-01 14:06 UTC (permalink / raw)
To: Davi Arnaut; +Cc: David Howells, akpm, vsu, alan, linux-kernel
In-Reply-To: <20060220170913.b232dc20.davi.arnaut@gmail.com>
Davi Arnaut <davi.arnaut@gmail.com> wrote:
> In keyctl_keyring_search() there wasn't a check for type[0] == '.', but your
> mm-patch added one implicitly. Which one is correct ?
Ummm... good point. Key types beginning with a dot are special, and userspace
isn't allowed to create them. I'm not sure whether they should be findable or
not, but I'm happy go for not at the moment (so the patch is correct, not the
original).
There's another minor problem with your patch:
warthog>grep -r strndup_user *
warthog1>
I take it that this isn't in Linus's kernel yet... However, I don't want my
patch to be held up too much since there are some awkward holes that need
fixing. I'm definitely in favour of strndup_user() though.
David
^ permalink raw reply
* RE: Outgoing port is wrong
From: Rob Sterenborg @ 2006-03-01 14:05 UTC (permalink / raw)
To: netfilter
In-Reply-To: <000001c63d2e$ec88b510$7b82a8c0@aladin>
On Wed, March 1, 2006 13:51, Master wrote:
>> This was working, but the new security of the applications does demand
>> that the services should be able to reinitiate the connection, using the
>> same port as on the way in. So I need to make sure that box1
>> (192.168.1.107:15009) always uses 62.59.197.53:18107 to connect to the
>> outside.
>>
>> How do I setup these rules correctly for in and out going?
>
> Have you looked at "man iptables", the SNAT section ?
>
> ===========
> SNAT
> ....
> It takes one type of option:
>
> --to-source ipaddr[-ipaddr][:port-port]
>
> which can specify a single new source IP address, an inclusive range of
> IP addresses, and optionally, a port range (which is only valid if the rule
> also specifies -p tcp or -p udp).
> ....
> ===========
>
> It looks like :
>
> $ipt -A POSTROUTING -s 192.168.1.107 -p tcp --sport 15009 \
> -j SNAT 65.59.197.53:18107
>
> should do the trick.
>
>
> Gr,
> ROb
>
>
> Hoi Rob,
>
> I have looked it through and many more documents, but still missing
> something.
>
> I used:
> -A POSTROUTING -s 192.168.1.107 -p tcp --sport 15009 \
> -j SNAT -o eth0 --to 65.59.197.53:18107
>
> Should this be in the 'nat' or 'mangle' part?
You are trying to NAT the connection so that would be the nat table.
> Should I also add an INPUT ACCEPT for 192.168.1.107:15009?
Packets are only going through one filter chain. These are NATed so they are
going through the FORWARD chain.
Are these packets dropped or are they NATed differently from what you expected
? Maybe you can add a logging rule or use tcpdump (et al) to see what is
happening.
Gr,
Rob
^ permalink raw reply
* impure renames / history tracking
From: Paul Jakma @ 2006-03-01 14:01 UTC (permalink / raw)
To: git list
Hi,
I'm trying to understand git better (so I can explain it better to
others, with an eye to them considering switching to git), one
question I have is about renames.
- git obviously detects pure renames perfectly well
- git doesn't however record renames, so 'impure' renames may not be
detected
My question is:
- why not record rename information explicitely in the commit object?
I.e. so as to be able to follow history information through 'impure'
renames without having to resort to heuristics.
E.g. imagine a project where development typically occurs through:
o: commit
m: merge
o---o-m--o-o-o--o----m <- project
/ / /
o-o-o-o-o--o-o-o--o-o-o <- main branch
The project merge back to main in one 'big' combined merge
(collapsing all of the commits on 'project' into one commit). This
leads to 'impure renames' being not uncommon. The desired end-result
of merging back to 'main' being to rebase 'project' as one commit
against 'main', and merge that single commit back, a la:
o---o-m--o-o-o--o----m <- project
/ / /
o-o-o-o-o--o-o-o--o-o-o---m <- main branch
\ /
o <- project_collapsed
So that 'm' on 'main' is that one commit[1].
The merits or demerits of such merging practice aside, what reason
would there be /against/ recording explicit rename information in the
commit object, so as to help browsers follow history (particularly
impure renames) better in a commit?
I.e. would there be resistance to adding meta-info rename headers
commit objects, and having diffcore and other tools to use those
headers to /augment/ their existing heuristics in detecting renames?
Thanks!
1. Git currently doesn't have 'porcelain' to do this, presumably
there'd be no objection to one?
regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
Fortune:
It is the quality rather than the quantity that matters.
- Lucius Annaeus Seneca (4 B.C. - A.D. 65)
^ permalink raw reply
* Re: [ANNOUNCE] LiSt - Linux Statistics - www.linux-stats.org
From: Lars Marowsky-Bree @ 2006-03-01 13:59 UTC (permalink / raw)
To: LKML
In-Reply-To: <200602281812.42318.dma147@linux-stats.org>
On 2006-02-28T18:12:37, Alexander Mieland <dma147@linux-stats.org> wrote:
> - The installation date of your distribution
> - The hostname (no fqdn or ips)
> - The architecture (x86/i586/i686, ppc, and so on)
> - CPU information: vendor, model, number of cpus, frequencies
> - RAM
> - Swap
> - Timezone
> - user defined locales
> - Windowmanager
> - Kernel version
> - Uptime information
> - The size of mounted partitions (no shares)
> - the used filesystems
> - The hardware-IDs of used ISA/PCI/AGP and USB hardware
This is very useful to focus development, eventually. It would be nice
if you could also come up with a way to provide feedback on the kernel
modules used (loaded will do, but used would be cuter ;-).
Sincerely,
Lars Marowsky-Brée
--
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business -- Charles Darwin
"Ignorance more frequently begets confidence than does knowledge"
^ permalink raw reply
* [PATCH] wireless.git: update acxsm to 0.4.7
From: Denis Vlasenko @ 2006-03-01 13:58 UTC (permalink / raw)
To: acx100-devel
Cc: John W. Linville, Carlos Martín, netdev, Christoph Hellwig
In-Reply-To: <20060228013415.GD26559@tuxdriver.com>
[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]
On Tuesday 28 February 2006 03:34, John W. Linville wrote:
> On Mon, Feb 27, 2006 at 11:44:38AM +0100, Carlos Martín wrote:
> > On Monday 27 February 2006 11:20, Denis Vlasenko wrote:
> > > > Comments are welcome and I'll split the patch if needed.
>
> Denis are you applying this patch to your tree? If so, I'll rely on
> you to push it to me when you are ready.
>
> If not, then I will need Carlos to generate the diffs so that they
> can be applied to the top of the tree with -p1.
>
> http://linux.yyz.us/patch-format.html
Changelog:
[20060301] 0.4.7
* Carlos Martin <carlos@cmartin.tk>
- splitted monolithic module into acx-common + acx-pci + acx-usb
modules
[20060212] 0.4.6
* Carlos Martin <carlos@cmartin.tk>
- Fix breakage of "Get rid of circular list of adev's"
- Remove .owner = THIS_MODULE
[20060209] 0.4.5
* Get rid of circular list of adev's
[20060208]
* Change the acx_ioctl_{get,set}_encode functions to use
the 80211 stack in the kernel, so they become mere wrappers.
[20060206]
* Register driver device ids to usb device table
[20060205] 0.4.4
* Andreas Mohr <andi@rhlx01.fht-esslingen.de>
- implement much more flexible firmware statistics parsing
(for /proc/driver/acx_wlanX_diag)
This has the nice effect that we now get output for both the older
TNETW1100 USB and TNETW1450.
Since firmware statistics information has non-stable layout depending on
firmware version, please report if you suspect any parsing mismatch!
This improved version now uses 2kB more driver space, unfortunately.
- use "% 8" modulo instead of more complicated "% 5" calculation
Signed-off-by: Denis Vlasenko <vda@ilport.com.ua>
--
vda
[-- Attachment #2: acx_cmn.patch --]
[-- Type: text/x-diff, Size: 71712 bytes --]
diff -urpN wireless-2.6.git/drivers/net/wireless/Makefile wireless-2.6.git.acx/drivers/net/wireless/Makefile
--- wireless-2.6.git/drivers/net/wireless/Makefile Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/Makefile Wed Mar 1 12:01:19 2006
@@ -37,7 +37,8 @@ obj-$(CONFIG_PRISM54_USB) += prism54usb/
obj-$(CONFIG_HOSTAP) += hostap/
obj-$(CONFIG_BCM43XX) += bcm43xx/
-obj-$(CONFIG_ACX) += tiacx/
+obj-$(CONFIG_ACX_PCI) += tiacx/
+obj-$(CONFIG_ACX_USB) += tiacx/
# 16-bit wireless PCMCIA client drivers
obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/Changelog wireless-2.6.git.acx/drivers/net/wireless/tiacx/Changelog
--- wireless-2.6.git/drivers/net/wireless/tiacx/Changelog Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/Changelog Wed Mar 1 15:43:45 2006
@@ -70,6 +70,37 @@ TODO: from Efthym <efthym@gmx.net>:
13:13:32 wlan0: tx error 0x20, buf 05!
13:13:32 wlan0: tx error 0x20, buf 06!
+[20060301] 0.4.7
+* Carlos Martin <carlos@cmartin.tk>
+ - splitted monolithic module into acx-common + acx-pci + acx-usb
+ modules
+
+[20060212] 0.4.6
+* Carlos Martin <carlos@cmartin.tk>
+ - Fix breakage of "Get rid of circular list of adev's"
+ - Remove .owner = THIS_MODULE
+
+[20060209] 0.4.5
+* Get rid of circular list of adev's
+
+[20060208]
+* Change the acx_ioctl_{get,set}_encode functions to use
+ the 80211 stack in the kernel, so they become mere wrappers.
+
+[20060206]
+* Register driver device ids to usb device table
+
+[20060205] 0.4.4
+* Andreas Mohr <andi@rhlx01.fht-esslingen.de>
+ - implement much more flexible firmware statistics parsing
+ (for /proc/driver/acx_wlanX_diag)
+ This has the nice effect that we now get output for both the older
+ TNETW1100 USB and TNETW1450.
+ Since firmware statistics information has non-stable layout depending on
+ firmware version, please report if you suspect any parsing mismatch!
+ This improved version now uses 2kB more driver space, unfortunately.
+ - use "% 8" modulo instead of more complicated "% 5" calculation
+
[20060203] 0.4.3
* merge from acx 0.3.32
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/Kconfig wireless-2.6.git.acx/drivers/net/wireless/tiacx/Kconfig
--- wireless-2.6.git/drivers/net/wireless/tiacx/Kconfig Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/Kconfig Wed Mar 1 12:05:04 2006
@@ -1,20 +1,14 @@
-config ACX
- tristate
+config ACX_PCI
+ tristate "TI acx100/acx111 802.11b/g PCI"
+ depends on NET_RADIO && EXPERIMENTAL && PCI
select FW_LOADER
select IEEE80211
select IEEE80211_SOFTMAC
-
-config ACX_PCI
- tristate "TI acx100/acx111 802.11b/g wireless PCI chipsets"
- depends on NET_RADIO && EXPERIMENTAL && PCI && (USB || ACX_USB=n)
- select ACX
- select ACX_PCI_BOOL
---help---
- Include support for PCI and CardBus 802.11b/g wireless cards
- based on Texas Instruments acx100 and acx111 chipsets.
+ A driver for 802.11b/g wireless cards based on
+ Texas Instruments acx100 and acx111 chipsets.
- This driver supports Host AP mode that allows
- your computer to act as an IEEE 802.11 access point.
+ This is the PCI code.
acx chipsets need their firmware loaded at startup.
You will need to provide a firmware image via hotplug.
@@ -39,20 +33,20 @@ config ACX_PCI
Firmware files are not covered by GPL and are not distributed
with this driver for legal reasons.
-config ACX_PCI_BOOL
- bool
+ Texas Instruments did not take part in development of this driver
+ in any way, shape or form.
config ACX_USB
- tristate "TI acx100/acx111 802.11b/g USB wireless chipsets"
+ tristate "TI acx100/acx111 802.11b/g USB"
depends on NET_RADIO && EXPERIMENTAL && USB
- select ACX
- select ACX_USB_BOOL
+ select FW_LOADER
+ select IEEE80211
+ select IEEE80211_SOFTMAC
---help---
- Include support for USB 802.11b/g wireless cards
- based on Texas Instruments acx100 and acx111 chipsets.
+ A driver for 802.11b/g wireless cards based on
+ Texas Instruments acx100 and acx111 chipsets.
- This driver supports Host AP mode that allows
- your computer to act as an IEEE 802.11 access point.
+ This is the USB code.
There is only one currently known device in this category,
D-Link DWL-120+, but newer devices seem to be on the horizon.
@@ -66,5 +60,6 @@ config ACX_USB
Firmware files are not covered by GPL and are not distributed
with this driver for legal reasons.
-config ACX_USB_BOOL
- bool
+ Texas Instruments did not take part in development of this driver
+ in any way, shape or form.
+
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/Makefile wireless-2.6.git.acx/drivers/net/wireless/tiacx/Makefile
--- wireless-2.6.git/drivers/net/wireless/tiacx/Makefile Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/Makefile Wed Mar 1 12:05:04 2006
@@ -1,6 +1,6 @@
-obj-$(CONFIG_ACX) += acx.o
+acx-common-y := wlan.o ioctl.o common.o
+acx-usb-y := usb.o
+acx-pci-y := pci.o
-acx-obj-$(CONFIG_ACX_PCI_BOOL) += pci.o
-acx-obj-$(CONFIG_ACX_USB_BOOL) += usb.o
-
-acx-objs := wlan.o ioctl.o common.o $(acx-obj-y)
+obj-$(CONFIG_ACX_PCI) += acx-common.o acx-pci.o
+obj-$(CONFIG_ACX_USB) += acx-common.o acx-usb.o
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/README wireless-2.6.git.acx/drivers/net/wireless/tiacx/README
--- wireless-2.6.git/drivers/net/wireless/tiacx/README Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/README Wed Mar 1 12:27:48 2006
@@ -1,21 +1,16 @@
-*** Not run tested. Almost certainly won't work. Lots of things are TODO. ***
+*** Barely works. Lots of things are TODO. ***
This tarball contains a port of acx driver to ieee80211softmac
stack. Broadcom 43xx driver was used as an example.
See http://bcm43xx.berlios.de/,
ftp://ftp.berlios.de/pub/bcm43xx/snapshots/
-Latest softmac source is in softmac-snapshot/ and net/
-is a symlink to softmac-snapshot/include/net/.
-softmac-snapshot/ is to be replaced regularly with newer
-snapshots from http://softmac.sipsolutions.net/SoftMAC.
-
grep for '//SM' to see the code added to standalone acx driver code.
Contact:
netdev@vger.kernel.org
acx100-devel@lists.sourceforge.net
-softmac-dev@sipsolutions.net
+softmac-dev@sipsolutions.net
Bug reports:
@@ -45,4 +40,22 @@ radio module). For example, my firmware
Alternatively, I may remove it and use pair of files 'tiacx111' and
'tiacx111r16' instead.
USB driver:
-image is named 'tiacx100usb'
+image is named 'tiacxNNNusbcMM'
+
+Build instructions:
+
+You need to have git and cogito installed.
+
+# Get initial wireless-2.6.git tree (large download - >300MB)
+cg-clone rsync://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git wireless-2.6.git
+cd wireless-2.6.git
+# Get a branch
+cg-branch-add r-softmac 'rsync://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git#softmac'
+cg-fetch r-softmac
+# Switch to it (make it current)
+git-checkout r-softmac
+# Pull updates from remote master tree
+cg-update r-softmac
+
+You will have a complete Linux kernel in wireless-2.6.git/.
+Replace drivers/net/wireless/tiacx/* by files from this tarball.
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/acx_config.h wireless-2.6.git.acx/drivers/net/wireless/tiacx/acx_config.h
--- wireless-2.6.git/drivers/net/wireless/tiacx/acx_config.h Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/acx_config.h Wed Mar 1 15:43:59 2006
@@ -1,4 +1,4 @@
-#define ACX_RELEASE "v0.4.3"
+#define ACX_RELEASE "v0.4.7"
/* set to 0 if you don't want any debugging code to be compiled in */
/* set to 1 if you want some debugging */
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/acx_func.h wireless-2.6.git.acx/drivers/net/wireless/tiacx/acx_func.h
--- wireless-2.6.git/drivers/net/wireless/tiacx/acx_func.h Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/acx_func.h Wed Mar 1 12:31:08 2006
@@ -66,27 +66,27 @@
*/
#if ACX_DEBUG > 1
-void log_fn_enter(const char *funcname);
-void log_fn_exit(const char *funcname);
-void log_fn_exit_v(const char *funcname, int v);
+void acx_log_fn_enter(const char *funcname);
+void acx_log_fn_exit(const char *funcname);
+void acx_log_fn_exit_v(const char *funcname, int v);
#define FN_ENTER \
do { \
if (unlikely(acx_debug & L_FUNC)) { \
- log_fn_enter(__func__); \
+ acx_log_fn_enter(__func__); \
} \
} while (0)
#define FN_EXIT1(v) \
do { \
if (unlikely(acx_debug & L_FUNC)) { \
- log_fn_exit_v(__func__, v); \
+ acx_log_fn_exit_v(__func__, v); \
} \
} while (0)
#define FN_EXIT0 \
do { \
if (unlikely(acx_debug & L_FUNC)) { \
- log_fn_exit(__func__); \
+ acx_log_fn_exit(__func__); \
} \
} while (0)
@@ -257,7 +257,7 @@ has_only_one_bit(u16 v)
** but may be run under lock
**
** A small number of local helpers do not have acx_[eisl]_ prefix.
-** They are always close to caller and are to be revieved locally.
+** They are always close to caller and are to be reviewed locally.
**
** Theory of operation:
**
@@ -417,44 +417,29 @@ void acx_set_status(acx_device_t *adev,
#if ACX_DEBUG
/* We want to log cmd names */
-int acxpci_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr);
-int acxusb_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr);
-static inline int
-acx_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr)
-{
- if (IS_PCI(adev))
- return acxpci_s_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
- return acxusb_s_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
-}
-#define acx_s_issue_cmd(adev,cmd,param,len) \
- acx_s_issue_cmd_timeo_debug(adev,cmd,param,len,ACX_CMD_TIMEOUT_DEFAULT,#cmd)
-#define acx_s_issue_cmd_timeo(adev,cmd,param,len,timeo) \
- acx_s_issue_cmd_timeo_debug(adev,cmd,param,len,timeo,#cmd)
+
+#define acx_s_issue_cmd(adev, cmd, param, len) \
+ (adev)->ops.issue_cmd(adev, cmd, param, len, ACX_CMD_TIMEOUT_DEFAULT, #cmd)
+
+#define acx_s_issue_cmd_timeo(adev,cmd,param,len, timeout) \
+ (adev)->ops.issue_cmd(adev, cmd, param, len, timeout, #cmd)
+
int acx_s_configure_debug(acx_device_t *adev, void *pdr, int type, const char* str);
#define acx_s_configure(adev,pdr,type) \
acx_s_configure_debug(adev,pdr,type,#type)
+
int acx_s_interrogate_debug(acx_device_t *adev, void *pdr, int type, const char* str);
#define acx_s_interrogate(adev,pdr,type) \
acx_s_interrogate_debug(adev,pdr,type,#type)
#else
-int acxpci_s_issue_cmd_timeo(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout);
-int acxusb_s_issue_cmd_timeo(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout);
-static inline int
-acx_s_issue_cmd_timeo(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout)
-{
- if (IS_PCI(adev))
- return acxpci_s_issue_cmd_timeo(adev, cmd, param, len, timeout);
- return acxusb_s_issue_cmd_timeo(adev, cmd, param, len, timeout);
-}
-static inline int
-acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len)
-{
- if (IS_PCI(adev))
- return acxpci_s_issue_cmd_timeo(adev, cmd, param, len, ACX_CMD_TIMEOUT_DEFAULT);
- return acxusb_s_issue_cmd_timeo(adev, cmd, param, len, ACX_CMD_TIMEOUT_DEFAULT);
-}
+#define acx_s_issue_cmd(adev, cmd, param, len) \
+ (adev)->ops.issue_cmd(adev, cmd, param, len, ACX_CMD_TIMEOUT_DEFAULT)
+
+#define acx_s_issue_cmd_timeo(adev, cmd, param, len, timeout) \
+ (adev)->ops.issue_cmd(adev, cmd, param, len, timeout)
+
int acx_s_configure(acx_device_t *adev, void *pdr, int type);
int acx_s_interrogate(acx_device_t *adev, void *pdr, int type);
@@ -503,64 +488,23 @@ int acxpci_s_upload_radio(acx_device_t *
/***********************************************************************
** Unsorted yet :)
*/
-int acxpci_s_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
-int acxusb_s_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
-static inline int
-acx_s_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf)
-{
- if (IS_PCI(adev))
- return acxpci_s_read_phy_reg(adev, reg, charbuf);
- return acxusb_s_read_phy_reg(adev, reg, charbuf);
-}
+#define acx_s_read_phy_reg(adev, reg, charbuf) \
+ (adev)->ops.read_phy_reg(adev, reg, charbuf)
-int acxpci_s_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
-int acxusb_s_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
-static inline int
-acx_s_write_phy_reg(acx_device_t *adev, u32 reg, u8 value)
-{
- if (IS_PCI(adev))
- return acxpci_s_write_phy_reg(adev, reg, value);
- return acxusb_s_write_phy_reg(adev, reg, value);
-}
+#define acx_s_write_phy_reg(adev, reg, value) \
+ (adev)->ops.write_phy_reg(adev, reg, value)
-tx_t* acxpci_l_alloc_tx(acx_device_t *adev);
-tx_t* acxusb_l_alloc_tx(acx_device_t *adev);
-static inline tx_t*
-acx_l_alloc_tx(acx_device_t *adev)
-{
- if (IS_PCI(adev))
- return acxpci_l_alloc_tx(adev);
- return acxusb_l_alloc_tx(adev);
-}
+#define acx_l_alloc_tx(adev) \
+ (adev)->ops.alloc_tx(adev)
-void acxusb_l_dealloc_tx(tx_t *tx_opaque);
-static inline void
-acx_l_dealloc_tx(acx_device_t *adev, tx_t *tx_opaque)
-{
- if (IS_USB(adev))
- acxusb_l_dealloc_tx(tx_opaque);
-}
+#define acx_l_dealloc_tx(adev, tx_opaque) \
+ (adev)->ops.dealloc_tx(tx_opaque)
-void* acxpci_l_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
-void* acxusb_l_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
-static inline void*
-acx_l_get_txbuf(acx_device_t *adev, tx_t *tx_opaque)
-{
- if (IS_PCI(adev))
- return acxpci_l_get_txbuf(adev, tx_opaque);
- return acxusb_l_get_txbuf(adev, tx_opaque);
-}
+#define acx_l_get_txbuf(adev, tx_opaque) \
+ (adev)->ops.get_txbuf(adev, tx_opaque)
-void acxpci_l_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len);
-void acxusb_l_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len);
-static inline void
-acx_l_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len)
-{
- if (IS_PCI(adev))
- acxpci_l_tx_data(adev, tx_opaque, len);
- else
- acxusb_l_tx_data(adev, tx_opaque, len);
-}
+#define acx_l_tx_data(adev, tx_opaque, len) \
+ (adev)->ops.tx_data(adev, tx_opaque, len)
static inline wlan_hdr_t*
acx_get_wlan_hdr(acx_device_t *adev, const rxbuffer_t *rxbuf)
@@ -637,6 +581,9 @@ void acx_display_hardware_details(acx_de
int acx_e_change_mtu(struct net_device *ndev, int mtu);
struct net_device_stats* acx_e_get_stats(struct net_device *ndev);
struct iw_statistics* acx_e_get_wireless_stats(struct net_device *ndev);
+
+int acx100_s_create_dma_regions(acx_device_t *);
+int acx111_s_create_dma_regions(acx_device_t *);
int __init acxpci_e_init_module(void);
int __init acxusb_e_init_module(void);
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/acx_struct.h wireless-2.6.git.acx/drivers/net/wireless/tiacx/acx_struct.h
--- wireless-2.6.git/drivers/net/wireless/tiacx/acx_struct.h Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/acx_struct.h Wed Mar 1 12:05:04 2006
@@ -87,6 +87,31 @@ enum { acx_debug = 0 };
#define SCHEDULE_WORK schedule_work
#define FLUSH_SCHEDULED_WORK flush_scheduled_work
+/***********************************************************************
+** Chip-specific functions get set here.
+*/
+
+struct acx_ops {
+ int (*create_dma_regions)(acx_device_t *);
+ void (*delete_dma_regions)(acx_device_t *);
+
+#if ACX_DEBUG
+ int (*issue_cmd)(acx_device_t *adev, unsigned cmd, void *param,
+ unsigned len, unsigned cmd_timeout, const char *cmdstr);
+#else
+ int (*issue_cmd)(acx_device_t *adev, unsigned cmd, void *param,
+ unsigned len, unsigned cmd_timeout);
+#endif /* ACX_DEBUG */
+ tx_t* (*alloc_tx)(acx_device_t *adev);
+ void (*dealloc_tx)(tx_t *tx_opaque);
+
+ void* (*get_txbuf)(acx_device_t *adev, tx_t *tx_opaque);
+ void (*tx_data)(acx_device_t *adev, tx_t *tx_opaque, int len);
+
+ int (*write_phy_reg)(acx_device_t *adev, u32 reg, u8 value);
+ int (*read_phy_reg)(acx_device_t *adev, u32 reg, u8 *charbuf);
+};
+
/***********************************************************************
** Constants
@@ -105,8 +130,8 @@ enum { acx_debug = 0 };
#define DEVTYPE_PCI 0
#define DEVTYPE_USB 1
-#if defined(CONFIG_ACX_PCI_BOOL)
- #if !defined(CONFIG_ACX_USB_BOOL)
+#if defined(CONFIG_ACX_PCI)
+ #if !defined(CONFIG_ACX_USB)
#define IS_PCI(adev) 1
#else
#define IS_PCI(adev) ((adev)->dev_type == DEVTYPE_PCI)
@@ -115,8 +140,8 @@ enum { acx_debug = 0 };
#define IS_PCI(adev) 0
#endif
-#if defined(CONFIG_ACX_USB_BOOL)
- #if !defined(CONFIG_ACX_PCI_BOOL)
+#if defined(CONFIG_ACX_USB)
+ #if !defined(CONFIG_ACX_PCI)
#define IS_USB(adev) 1
#else
#define IS_USB(adev) ((adev)->dev_type == DEVTYPE_USB)
@@ -578,21 +603,34 @@ typedef struct rxbuffer {
/*--- Firmware statistics ----------------------------------------------------*/
-typedef struct fw_stats {
- u32 val0x0 ACX_PACKED; /* hdr; */
+
+/* define a random 100 bytes more to catch firmware versions which
+ * provide a bigger struct */
+#define FW_STATS_FUTURE_EXTENSION 100
+
+typedef struct fw_stats_tx {
u32 tx_desc_of ACX_PACKED;
+} fw_stats_tx_t;
+
+typedef struct fw_stats_rx {
u32 rx_oom ACX_PACKED;
u32 rx_hdr_of ACX_PACKED;
- u32 rx_hdr_use_next ACX_PACKED;
+ u32 rx_hw_stuck ACX_PACKED; /* old: u32 rx_hdr_use_next */
u32 rx_dropped_frame ACX_PACKED;
u32 rx_frame_ptr_err ACX_PACKED;
u32 rx_xfr_hint_trig ACX_PACKED;
+ u32 rx_aci_events ACX_PACKED; /* later versions only */
+ u32 rx_aci_resets ACX_PACKED; /* later versions only */
+} fw_stats_rx_t;
+typedef struct fw_stats_dma {
u32 rx_dma_req ACX_PACKED;
u32 rx_dma_err ACX_PACKED;
u32 tx_dma_req ACX_PACKED;
u32 tx_dma_err ACX_PACKED;
+} fw_stats_dma_t;
+typedef struct fw_stats_irq {
u32 cmd_cplt ACX_PACKED;
u32 fiq ACX_PACKED;
u32 rx_hdrs ACX_PACKED;
@@ -600,23 +638,79 @@ typedef struct fw_stats {
u32 rx_mem_of ACX_PACKED;
u32 rx_rdys ACX_PACKED;
u32 irqs ACX_PACKED;
- u32 acx_trans_procs ACX_PACKED;
+ u32 tx_procs ACX_PACKED;
u32 decrypt_done ACX_PACKED;
u32 dma_0_done ACX_PACKED;
u32 dma_1_done ACX_PACKED;
u32 tx_exch_complet ACX_PACKED;
u32 commands ACX_PACKED;
- u32 acx_rx_procs ACX_PACKED;
+ u32 rx_procs ACX_PACKED;
u32 hw_pm_mode_changes ACX_PACKED;
u32 host_acks ACX_PACKED;
u32 pci_pm ACX_PACKED;
u32 acm_wakeups ACX_PACKED;
+} fw_stats_irq_t;
+typedef struct fw_stats_wep {
u32 wep_key_count ACX_PACKED;
u32 wep_default_key_count ACX_PACKED;
u32 dot11_def_key_mib ACX_PACKED;
u32 wep_key_not_found ACX_PACKED;
u32 wep_decrypt_fail ACX_PACKED;
+ u32 wep_pkt_decrypt ACX_PACKED;
+ u32 wep_decrypt_irqs ACX_PACKED;
+} fw_stats_wep_t;
+
+typedef struct fw_stats_pwr {
+ u32 tx_start_ctr ACX_PACKED;
+ u32 no_ps_tx_too_short ACX_PACKED;
+ u32 rx_start_ctr ACX_PACKED;
+ u32 no_ps_rx_too_short ACX_PACKED;
+ u32 lppd_started ACX_PACKED;
+ u32 no_lppd_too_noisy ACX_PACKED;
+ u32 no_lppd_too_short ACX_PACKED;
+ u32 no_lppd_matching_frame ACX_PACKED;
+} fw_stats_pwr_t;
+
+typedef struct fw_stats_mic {
+ u32 mic_rx_pkts ACX_PACKED;
+ u32 mic_calc_fail ACX_PACKED;
+} fw_stats_mic_t;
+
+typedef struct fw_stats_aes {
+ u32 aes_enc_fail ACX_PACKED;
+ u32 aes_dec_fail ACX_PACKED;
+ u32 aes_enc_pkts ACX_PACKED;
+ u32 aes_dec_pkts ACX_PACKED;
+ u32 aes_enc_irq ACX_PACKED;
+ u32 aes_dec_irq ACX_PACKED;
+} fw_stats_aes_t;
+
+typedef struct fw_stats_event {
+ u32 heartbeat ACX_PACKED;
+ u32 calibration ACX_PACKED;
+ u32 rx_mismatch ACX_PACKED;
+ u32 rx_mem_empty ACX_PACKED;
+ u32 rx_pool ACX_PACKED;
+ u32 oom_late ACX_PACKED;
+ u32 phy_tx_err ACX_PACKED;
+ u32 tx_stuck ACX_PACKED;
+} fw_stats_event_t;
+
+/* mainly for size calculation only */
+typedef struct fw_stats {
+ u16 type;
+ u16 len;
+ fw_stats_tx_t tx;
+ fw_stats_rx_t rx;
+ fw_stats_dma_t dma;
+ fw_stats_irq_t irq;
+ fw_stats_wep_t wep;
+ fw_stats_pwr_t pwr;
+ fw_stats_mic_t mic;
+ fw_stats_aes_t aes;
+ fw_stats_event_t evt;
+ u8 _padding[FW_STATS_FUTURE_EXTENSION];
} fw_stats_t;
/* Firmware version struct */
@@ -1122,14 +1216,12 @@ struct acx_device {
unsigned long lock_time;
#endif
- /*** Device chain ***/
- struct acx_device *next; /* link for list of devices */
-
/*** Linux network device ***/
struct net_device *ndev; /* pointer to linux netdevice */
- struct net_device *prev_nd; /* FIXME: We should not chain via our
- * private struct acx_device _and_
- * the struct net_device */
+
+ /* Chip-specific functions */
+ struct acx_ops ops;
+
/*** Device statistics ***/
struct net_device_stats stats; /* net device statistics */
#ifdef WIRELESS_EXT
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/common.c wireless-2.6.git.acx/drivers/net/wireless/tiacx/common.c
--- wireless-2.6.git/drivers/net/wireless/tiacx/common.c Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/common.c Wed Mar 1 12:31:34 2006
@@ -84,6 +84,7 @@ static int acx_l_transmit_assoc_req(acx_
*/
#if ACX_DEBUG
unsigned int acx_debug /* will add __read_mostly later */ = ACX_DEFAULT_MSG;
+EXPORT_SYMBOL_GPL(acx_debug);
/* parameter is 'debug', corresponding var is acx_debug */
module_param_named(debug, acx_debug, uint, 0);
MODULE_PARM_DESC(debug, "Debug level mask (see L_xxx constants)");
@@ -94,7 +95,7 @@ MODULE_LICENSE("Dual MPL/GPL");
#endif
/* USB had this: MODULE_AUTHOR("Martin Wawro <martin.wawro AT uni-dortmund.de>"); */
MODULE_AUTHOR("ACX100 Open Source Driver development team");
-MODULE_DESCRIPTION("Driver for TI ACX1xx based wireless cards (CardBus/PCI/USB)");
+MODULE_DESCRIPTION("Driver for TI ACX1xx based wireless cards (common)");
/***********************************************************************
@@ -265,7 +266,7 @@ static const char
spaces[] = " " " "; /* Nx10 spaces */
void
-log_fn_enter(const char *funcname)
+acx_log_fn_enter(const char *funcname)
{
int indent;
TIMESTAMP(d);
@@ -282,8 +283,11 @@ log_fn_enter(const char *funcname)
acx_debug_func_indent += FUNC_INDENT_INCREMENT;
}
+
+EXPORT_SYMBOL_GPL(acx_log_fn_enter);
+
void
-log_fn_exit(const char *funcname)
+acx_log_fn_exit(const char *funcname)
{
int indent;
TIMESTAMP(d);
@@ -300,8 +304,11 @@ log_fn_exit(const char *funcname)
funcname
);
}
+
+EXPORT_SYMBOL_GPL(acx_log_fn_exit);
+
void
-log_fn_exit_v(const char *funcname, int v)
+acx_log_fn_exit_v(const char *funcname, int v)
{
int indent;
TIMESTAMP(d);
@@ -319,6 +326,9 @@ log_fn_exit_v(const char *funcname, int
v
);
}
+
+EXPORT_SYMBOL_GPL(acx_log_fn_exit_v);
+
#endif /* ACX_DEBUG > 1 */
@@ -333,6 +343,7 @@ acx_s_msleep(int ms)
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_s_msleep);
/***********************************************************************
** Not inlined: it's larger than it seems
@@ -413,6 +424,8 @@ acx_get_packet_type_string(u16 fc)
}
return str;
}
+
+EXPORT_SYMBOL_GPL(acx_get_packet_type_string);
#endif
@@ -482,6 +495,8 @@ acx_cmd_status_str(unsigned int state)
cmd_error_strings[state] : "?";
}
+EXPORT_SYMBOL_GPL(acx_cmd_status_str);
+
/***********************************************************************
** get_status_string
@@ -573,6 +588,8 @@ acx_dump_bytes(const void *data, int num
printk("%02X\n", *ptr);
}
}
+
+EXPORT_SYMBOL_GPL(acx_dump_bytes);
#endif
@@ -660,6 +677,7 @@ acx_s_get_firmware_version(acx_device_t
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_s_get_firmware_version);
/***********************************************************************
** acx_display_hardware_details
@@ -730,6 +748,7 @@ acx_display_hardware_details(acx_device_
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_display_hardware_details);
/***********************************************************************
*/
@@ -748,6 +767,7 @@ acx_e_change_mtu(struct net_device *ndev
return 0;
}
+EXPORT_SYMBOL_GPL(acx_e_change_mtu);
/***********************************************************************
** acx_e_get_stats, acx_e_get_wireless_stats
@@ -759,6 +779,8 @@ acx_e_get_stats(struct net_device *ndev)
return &adev->stats;
}
+EXPORT_SYMBOL_GPL(acx_e_get_stats);
+
struct iw_statistics*
acx_e_get_wireless_stats(struct net_device *ndev)
{
@@ -824,6 +846,7 @@ acx_signal_determine_quality(u8 signal,
return qual;
}
+EXPORT_SYMBOL_GPL(acx_signal_determine_quality);
/***********************************************************************
** Interrogate/configure commands
@@ -853,7 +876,7 @@ acx100_ie_len[] = {
ACX1xx_IE_RXCONFIG_LEN,
0,
0,
- ACX1xx_IE_FIRMWARE_STATISTICS_LEN,
+ sizeof(fw_stats_t)-4,
0,
ACX1xx_IE_FEATURE_CONFIG_LEN,
ACX111_IE_KEY_CHOOSE_LEN,
@@ -930,7 +953,7 @@ acx111_ie_len[] = {
ACX1xx_IE_RXCONFIG_LEN,
0,
0,
- ACX1xx_IE_FIRMWARE_STATISTICS_LEN,
+ sizeof(fw_stats_t)-4,
0,
ACX1xx_IE_FEATURE_CONFIG_LEN,
ACX111_IE_KEY_CHOOSE_LEN,
@@ -992,12 +1015,11 @@ acx111_ie_len_dot11[] = {
#if !ACX_DEBUG
int
acx_s_configure(acx_device_t *adev, void *pdr, int type)
-{
#else
int
acx_s_configure_debug(acx_device_t *adev, void *pdr, int type, const char* typestr)
-{
#endif
+{
u16 len;
int res;
@@ -1030,13 +1052,12 @@ acx_s_configure_debug(acx_device_t *adev
#if !ACX_DEBUG
int
acx_s_interrogate(acx_device_t *adev, void *pdr, int type)
-{
#else
int
acx_s_interrogate_debug(acx_device_t *adev, void *pdr, int type,
const char* typestr)
-{
#endif
+{
u16 len;
int res;
@@ -1063,6 +1084,12 @@ acx_s_interrogate_debug(acx_device_t *ad
return res;
}
+#if ACX_DEBUG
+EXPORT_SYMBOL_GPL(acx_s_interrogate_debug);
+#else
+EXPORT_SYMBOL_GPL(acx_s_interrogate);
+#endif /* ACX_DEBUG */
+
#if CMD_DISCOVERY
void
great_inquisitor(acx_device_t *adev)
@@ -1150,20 +1177,27 @@ static int
acx_s_proc_diag_output(char *buf, acx_device_t *adev)
{
char *p = buf;
- fw_stats_t *fw_stats;
unsigned long flags;
+ unsigned int len = 0, partlen;
+ u32 temp1, temp2;
+ u8 *st, *st_end;
+#ifdef __BIG_ENDIAN
+ u8 *st2;
+#endif
+ fw_stats_t *fw_stats;
+ char *part_str = NULL;
+ fw_stats_tx_t *tx = NULL;
+ fw_stats_rx_t *rx = NULL;
+ fw_stats_dma_t *dma = NULL;
+ fw_stats_irq_t *irq = NULL;
+ fw_stats_wep_t *wep = NULL;
+ fw_stats_pwr_t *pwr = NULL;
+ fw_stats_mic_t *mic = NULL;
+ fw_stats_aes_t *aes = NULL;
+ fw_stats_event_t *evt = NULL;
FN_ENTER;
- /* TODO: may replace kmalloc/memset with kzalloc once
- * Linux 2.6.14 is widespread */
- fw_stats = kmalloc(sizeof(*fw_stats), GFP_KERNEL);
- if (!fw_stats) {
- FN_EXIT1(0);
- return 0;
- }
- memset(fw_stats, 0, sizeof(*fw_stats));
-
acx_lock(adev, flags);
if (IS_PCI(adev))
@@ -1207,63 +1241,322 @@ acx_s_proc_diag_output(char *buf, acx_de
acx_unlock(adev, flags);
- if (OK != acx_s_interrogate(adev, fw_stats, ACX1xx_IE_FIRMWARE_STATISTICS))
- p += sprintf(p,
- "\n"
- "** Firmware **\n"
- "QUERY FAILED!!\n");
- else {
- p += sprintf(p,
- "\n"
- "** Firmware **\n"
- "version \"%s\"\n"
- "tx_desc_overfl %u, rx_OutOfMem %u, rx_hdr_overfl %u, rx_hdr_use_next %u\n"
- "rx_dropped_frame %u, rx_frame_ptr_err %u, rx_xfr_hint_trig %u, rx_dma_req %u\n"
- "rx_dma_err %u, tx_dma_req %u, tx_dma_err %u, cmd_cplt %u, fiq %u\n"
- "rx_hdrs %u, rx_cmplt %u, rx_mem_overfl %u, rx_rdys %u, irqs %u\n"
- "acx_trans_procs %u, decrypt_done %u, dma_0_done %u, dma_1_done %u\n",
- adev->firmware_version,
- le32_to_cpu(fw_stats->tx_desc_of),
- le32_to_cpu(fw_stats->rx_oom),
- le32_to_cpu(fw_stats->rx_hdr_of),
- le32_to_cpu(fw_stats->rx_hdr_use_next),
- le32_to_cpu(fw_stats->rx_dropped_frame),
- le32_to_cpu(fw_stats->rx_frame_ptr_err),
- le32_to_cpu(fw_stats->rx_xfr_hint_trig),
- le32_to_cpu(fw_stats->rx_dma_req),
- le32_to_cpu(fw_stats->rx_dma_err),
- le32_to_cpu(fw_stats->tx_dma_req),
- le32_to_cpu(fw_stats->tx_dma_err),
- le32_to_cpu(fw_stats->cmd_cplt),
- le32_to_cpu(fw_stats->fiq),
- le32_to_cpu(fw_stats->rx_hdrs),
- le32_to_cpu(fw_stats->rx_cmplt),
- le32_to_cpu(fw_stats->rx_mem_of),
- le32_to_cpu(fw_stats->rx_rdys),
- le32_to_cpu(fw_stats->irqs),
- le32_to_cpu(fw_stats->acx_trans_procs),
- le32_to_cpu(fw_stats->decrypt_done),
- le32_to_cpu(fw_stats->dma_0_done),
- le32_to_cpu(fw_stats->dma_1_done));
+ p += sprintf(p,
+ "\n"
+ "** Firmware **\n"
+ "NOTE: version dependent statistics layout, "
+ "please report if you suspect wrong parsing!\n"
+ "\n"
+ "version \"%s\"\n", adev->firmware_version);
+
+ /* TODO: may replace kmalloc/memset with kzalloc once
+ * Linux 2.6.14 is widespread */
+ fw_stats = kmalloc(sizeof(*fw_stats), GFP_KERNEL);
+ if (!fw_stats) {
+ FN_EXIT1(0);
+ return 0;
+ }
+ memset(fw_stats, 0, sizeof(*fw_stats));
+
+ st = (u8 *)fw_stats;
+
+ part_str = "statistics query command";
+
+ if (OK != acx_s_interrogate(adev, st, ACX1xx_IE_FIRMWARE_STATISTICS))
+ goto fw_stats_end;
+
+ st += sizeof(u16);
+ len = *(u16 *)st;
+
+ if (len > sizeof(*fw_stats)) {
p += sprintf(p,
- "tx_exch_complet %u, commands %u, acx_rx_procs %u\n"
- "hw_pm_mode_changes %u, host_acks %u, pci_pm %u, acm_wakeups %u\n"
- "wep_key_count %u, wep_default_key_count %u, dot11_def_key_mib %u\n"
- "wep_key_not_found %u, wep_decrypt_fail %u\n",
- le32_to_cpu(fw_stats->tx_exch_complet),
- le32_to_cpu(fw_stats->commands),
- le32_to_cpu(fw_stats->acx_rx_procs),
- le32_to_cpu(fw_stats->hw_pm_mode_changes),
- le32_to_cpu(fw_stats->host_acks),
- le32_to_cpu(fw_stats->pci_pm),
- le32_to_cpu(fw_stats->acm_wakeups),
- le32_to_cpu(fw_stats->wep_key_count),
- le32_to_cpu(fw_stats->wep_default_key_count),
- le32_to_cpu(fw_stats->dot11_def_key_mib),
- le32_to_cpu(fw_stats->wep_key_not_found),
- le32_to_cpu(fw_stats->wep_decrypt_fail));
+ "firmware version with bigger fw_stats struct detected\n"
+ "(%u vs. %u), please report\n", len, sizeof(fw_stats_t));
+ if (len > sizeof(*fw_stats)) {
+ p += sprintf(p, "struct size exceeded allocation!\n");
+ len = sizeof(*fw_stats);
+ }
+ }
+ st += sizeof(u16);
+ st_end = st - 2*sizeof(u16) + len;
+
+#ifdef __BIG_ENDIAN
+ /* let's make one bold assumption here:
+ * (hopefully!) *all* statistics fields are u32 only,
+ * thus if we need to make endianness corrections
+ * we can simply do them in one go, in advance */
+ st2 = (u8 *)fw_stats;
+ for (temp1 = 0; temp1 < len; temp1 += 4, st2 += 4)
+ *(u32 *)st2 = le32_to_cpu(*(u32 *)st2);
+#endif
+
+ part_str = "Rx/Tx";
+
+ /* directly at end of a struct part? --> no error! */
+ if (st == st_end)
+ goto fw_stats_end;
+
+ tx = (fw_stats_tx_t *)st;
+ st += sizeof(fw_stats_tx_t);
+ rx = (fw_stats_rx_t *)st;
+ st += sizeof(fw_stats_rx_t);
+ partlen = sizeof(fw_stats_tx_t) + sizeof(fw_stats_rx_t);
+
+ if (IS_ACX100(adev)) {
+ /* at least ACX100 PCI F/W 1.9.8.b
+ * and ACX100 USB F/W 1.0.7-USB
+ * don't have those two fields... */
+ st -= 2*sizeof(u32);
+
+ /* our parsing doesn't quite match this firmware yet,
+ * log failure */
+ if (st > st_end)
+ goto fw_stats_fail;
+ temp1 = temp2 = 999999999;
+ } else {
+ if (st > st_end)
+ goto fw_stats_fail;
+ temp1 = rx->rx_aci_events;
+ temp2 = rx->rx_aci_resets;
}
+ p += sprintf(p,
+ "%s:\n"
+ " tx_desc_overfl %u\n"
+ " rx_OutOfMem %u, rx_hdr_overfl %u, rx_hw_stuck %u\n"
+ " rx_dropped_frame %u, rx_frame_ptr_err %u, rx_xfr_hint_trig %u\n"
+ " rx_aci_events %u, rx_aci_resets %u\n",
+ part_str,
+ tx->tx_desc_of,
+ rx->rx_oom,
+ rx->rx_hdr_of,
+ rx->rx_hw_stuck,
+ rx->rx_dropped_frame,
+ rx->rx_frame_ptr_err,
+ rx->rx_xfr_hint_trig,
+ temp1,
+ temp2);
+
+ part_str = "DMA";
+
+ if (st == st_end)
+ goto fw_stats_end;
+
+ dma = (fw_stats_dma_t *)st;
+ partlen = sizeof(fw_stats_dma_t);
+ st += partlen;
+
+ if (st > st_end)
+ goto fw_stats_fail;
+
+ p += sprintf(p,
+ "%s:\n"
+ " rx_dma_req %u, rx_dma_err %u, tx_dma_req %u, tx_dma_err %u\n",
+ part_str,
+ dma->rx_dma_req,
+ dma->rx_dma_err,
+ dma->tx_dma_req,
+ dma->tx_dma_err);
+
+ part_str = "IRQ";
+
+ if (st == st_end)
+ goto fw_stats_end;
+
+ irq = (fw_stats_irq_t *)st;
+ partlen = sizeof(fw_stats_irq_t);
+ st += partlen;
+
+ if (st > st_end)
+ goto fw_stats_fail;
+
+ p += sprintf(p,
+ "%s:\n"
+ " cmd_cplt %u, fiq %u\n"
+ " rx_hdrs %u, rx_cmplt %u, rx_mem_overfl %u, rx_rdys %u\n"
+ " irqs %u, tx_procs %u, decrypt_done %u\n"
+ " dma_0_done %u, dma_1_done %u, tx_exch_complet %u\n"
+ " commands %u, rx_procs %u, hw_pm_mode_changes %u\n"
+ " host_acks %u, pci_pm %u, acm_wakeups %u\n",
+ part_str,
+ irq->cmd_cplt,
+ irq->fiq,
+ irq->rx_hdrs,
+ irq->rx_cmplt,
+ irq->rx_mem_of,
+ irq->rx_rdys,
+ irq->irqs,
+ irq->tx_procs,
+ irq->decrypt_done,
+ irq->dma_0_done,
+ irq->dma_1_done,
+ irq->tx_exch_complet,
+ irq->commands,
+ irq->rx_procs,
+ irq->hw_pm_mode_changes,
+ irq->host_acks,
+ irq->pci_pm,
+ irq->acm_wakeups);
+
+ part_str = "WEP";
+
+ if (st == st_end)
+ goto fw_stats_end;
+
+ wep = (fw_stats_wep_t *)st;
+ partlen = sizeof(fw_stats_wep_t);
+ st += partlen;
+
+ if (
+ (IS_PCI(adev) && IS_ACX100(adev))
+ || (IS_USB(adev) && IS_ACX100(adev))
+ ) {
+ /* at least ACX100 PCI F/W 1.9.8.b
+ * and ACX100 USB F/W 1.0.7-USB
+ * don't have those two fields... */
+ st -= 2*sizeof(u32);
+ if (st > st_end)
+ goto fw_stats_fail;
+ temp1 = temp2 = 999999999;
+ } else {
+ if (st > st_end)
+ goto fw_stats_fail;
+ temp1 = wep->wep_pkt_decrypt;
+ temp2 = wep->wep_decrypt_irqs;
+ }
+
+ p += sprintf(p,
+ "%s:\n"
+ " wep_key_count %u, wep_default_key_count %u, dot11_def_key_mib %u\n"
+ " wep_key_not_found %u, wep_decrypt_fail %u\n"
+ " wep_pkt_decrypt %u, wep_decrypt_irqs %u\n",
+ part_str,
+ wep->wep_key_count,
+ wep->wep_default_key_count,
+ wep->dot11_def_key_mib,
+ wep->wep_key_not_found,
+ wep->wep_decrypt_fail,
+ temp1,
+ temp2);
+
+ part_str = "power";
+
+ if (st == st_end)
+ goto fw_stats_end;
+
+ pwr = (fw_stats_pwr_t *)st;
+ partlen = sizeof(fw_stats_pwr_t);
+ st += partlen;
+
+ if (st > st_end)
+ goto fw_stats_fail;
+
+ p += sprintf(p,
+ "%s:\n"
+ " tx_start_ctr %u, no_ps_tx_too_short %u\n"
+ " rx_start_ctr %u, no_ps_rx_too_short %u\n"
+ " lppd_started %u\n"
+ " no_lppd_too_noisy %u, no_lppd_too_short %u, no_lppd_matching_frame %u\n",
+ part_str,
+ pwr->tx_start_ctr,
+ pwr->no_ps_tx_too_short,
+ pwr->rx_start_ctr,
+ pwr->no_ps_rx_too_short,
+ pwr->lppd_started,
+ pwr->no_lppd_too_noisy,
+ pwr->no_lppd_too_short,
+ pwr->no_lppd_matching_frame);
+
+ part_str = "MIC";
+
+ if (st == st_end)
+ goto fw_stats_end;
+
+ mic = (fw_stats_mic_t *)st;
+ partlen = sizeof(fw_stats_mic_t);
+ st += partlen;
+
+ if (st > st_end)
+ goto fw_stats_fail;
+
+ p += sprintf(p,
+ "%s:\n"
+ " mic_rx_pkts %u, mic_calc_fail %u\n",
+ part_str,
+ mic->mic_rx_pkts,
+ mic->mic_calc_fail);
+
+ part_str = "AES";
+
+ if (st == st_end)
+ goto fw_stats_end;
+
+ aes = (fw_stats_aes_t *)st;
+ partlen = sizeof(fw_stats_aes_t);
+ st += partlen;
+
+ if (st > st_end)
+ goto fw_stats_fail;
+
+ p += sprintf(p,
+ "%s:\n"
+ " aes_enc_fail %u, aes_dec_fail %u\n"
+ " aes_enc_pkts %u, aes_dec_pkts %u\n"
+ " aes_enc_irq %u, aes_dec_irq %u\n",
+ part_str,
+ aes->aes_enc_fail,
+ aes->aes_dec_fail,
+ aes->aes_enc_pkts,
+ aes->aes_dec_pkts,
+ aes->aes_enc_irq,
+ aes->aes_dec_irq);
+
+ part_str = "event";
+
+ if (st == st_end)
+ goto fw_stats_end;
+
+ evt = (fw_stats_event_t *)st;
+ partlen = sizeof(fw_stats_event_t);
+ st += partlen;
+
+ if (st > st_end)
+ goto fw_stats_fail;
+
+ p += sprintf(p,
+ "%s:\n"
+ " heartbeat %u, calibration %u\n"
+ " rx_mismatch %u, rx_mem_empty %u, rx_pool %u\n"
+ " oom_late %u\n"
+ " phy_tx_err %u, tx_stuck %u\n",
+ part_str,
+ evt->heartbeat,
+ evt->calibration,
+ evt->rx_mismatch,
+ evt->rx_mem_empty,
+ evt->rx_pool,
+ evt->oom_late,
+ evt->phy_tx_err,
+ evt->tx_stuck);
+
+ if (st < st_end)
+ goto fw_stats_bigger;
+
+ goto fw_stats_end;
+
+fw_stats_fail:
+ st -= partlen;
+ p += sprintf(p,
+ "failed at %s part (size %u), offset %u (struct size %u), "
+ "please report\n", part_str, partlen,
+ (int)st - (int)fw_stats, len);
+
+fw_stats_bigger:
+ for (; st < st_end; st += 4)
+ p += sprintf(p,
+ "UNKN%3d: %u\n", (int)st - (int)fw_stats, *(u32 *)st);
+
+fw_stats_end:
kfree(fw_stats);
FN_EXIT1(p - buf);
@@ -1472,11 +1765,15 @@ acx_proc_register_entries(const struct n
return manage_proc_entries(ndev, 0);
}
+EXPORT_SYMBOL_GPL(acx_proc_register_entries);
+
int
acx_proc_unregister_entries(const struct net_device *ndev)
{
return manage_proc_entries(ndev, 1);
}
+
+EXPORT_SYMBOL_GPL(acx_proc_unregister_entries);
#endif /* CONFIG_PROC_FS */
@@ -1852,7 +2149,7 @@ bad:
** Note that this fn messes up heavily with hardware, but we cannot
** lock it (we need to sleep). Not a problem since IRQs can't happen
*/
-static int
+int
acx100_s_create_dma_regions(acx_device_t *adev)
{
acx100_ie_queueconfig_t queueconf;
@@ -1936,6 +2233,7 @@ end:
return res;
}
+EXPORT_SYMBOL_GPL(acx100_s_create_dma_regions);
/***********************************************************************
** acx111_s_create_dma_regions
@@ -1945,7 +2243,7 @@ end:
*/
#define ACX111_PERCENT(percent) ((percent)/5)
-static int
+int
acx111_s_create_dma_regions(acx_device_t *adev)
{
struct acx111_ie_memoryconfig memconf;
@@ -2033,6 +2331,7 @@ fail:
return NOT_OK;
}
+EXPORT_SYMBOL_GPL(acx111_s_create_dma_regions);
/***********************************************************************
*/
@@ -2298,6 +2597,7 @@ acx_s_set_defaults(acx_device_t *adev)
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_s_set_defaults);
/***********************************************************************
** FIXME: this should be solved in a general way for all radio types
@@ -2723,76 +3023,78 @@ acx_l_process_rxbuf(acx_device_t *adev,
//SM: have no dev specific code, should be moved to sm layer
+/* Filter out unrelated packets, call ieee80211_rx[_mgt] */
static int
-_TODO_wlan_rx(struct ieee80211_device *ieee,
- struct sk_buff *skb,
- struct ieee80211_rx_stats *stats)
+_TODO_ieee80211_rx_any(struct ieee80211_device *ieee,
+ struct sk_buff *skb, struct ieee80211_rx_stats *stats)
{
struct ieee80211_hdr_4addr *hdr;
- int is_packet_for_us = 0;
+ int is_packet_for_us;
u16 fc;
if (ieee->iw_mode == IW_MODE_MONITOR)
return ieee80211_rx(ieee, skb, stats) ? 0 : -EINVAL;
hdr = (struct ieee80211_hdr_4addr *)skb->data;
+ fc = le16_to_cpu(hdr->frame_ctl);
- switch (ieee->iw_mode) {
- case IW_MODE_ADHOC:
- if (memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0 ||
- memcmp(hdr->addr3, ieee->bssid, ETH_ALEN) == 0 ||
- is_broadcast_ether_addr(hdr->addr1) ||
- is_multicast_ether_addr(hdr->addr1) ||
- ieee->dev->flags & IFF_PROMISC)
- is_packet_for_us = 1;
+ if ((fc & IEEE80211_FCTL_VERS) != 0)
+ return -EINVAL;
+
+ switch (fc & IEEE80211_FCTL_FTYPE) {
+ case IEEE80211_FTYPE_MGMT:
+ ieee80211_rx_mgt(ieee, hdr, stats);
+ return 0;
+ case IEEE80211_FTYPE_DATA:
break;
- case IW_MODE_INFRA:
+ case IEEE80211_FTYPE_CTL:
+ return 0;
default:
- /* When receiving multicast or broadcast packets, filter out
- the packets we send ourself; we shouldn't see those */
- if (memcmp(hdr->addr3, ieee->bssid, ETH_ALEN) == 0 ||
- memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0 ||
- (memcmp(hdr->addr3, ieee->dev->dev_addr, ETH_ALEN) &&
- (is_broadcast_ether_addr(hdr->addr1) ||
- is_multicast_ether_addr(hdr->addr1) ||
- ieee->dev->flags & IFF_PROMISC)))
- is_packet_for_us = 1;
- break;
+ return -EINVAL;
}
- fc = hdr->frame_ctl;
-
- if ((fc & WF_FC_ISWEPi) && !ieee->host_decrypt) {
- fc &= ~WF_FC_ISWEPi;
- hdr->frame_ctl = fc;
- /* trim IV and ICV */
- /* FIXME: this must be done only for WEP encrypted packets */
- if (skb->len < 32) {
- printk("acx: RX packet dropped: PROTECTED flag "
- "set and length < 32 (%d)\n", skb->len);
- return -EINVAL;
- } else {
- memmove(skb->data + 4, skb->data, 24);
- skb_pull(skb, 4);
- skb_trim(skb, skb->len - 4);
+ is_packet_for_us = 0;
+ switch (ieee->iw_mode) {
+ case IW_MODE_ADHOC:
+ /* our BSS and not from/to DS */
+ if (memcmp(hdr->addr3, ieee->bssid, ETH_ALEN) == 0)
+ if ((fc & (IEEE80211_FCTL_TODS+IEEE80211_FCTL_FROMDS)) == 0) {
+ /* promisc: get all */
+ if (ieee->dev->flags & IFF_PROMISC)
+ is_packet_for_us = 1;
+ /* to us */
+ else if (memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0)
+ is_packet_for_us = 1;
+ /* mcast */
+ else if (is_multicast_ether_addr(hdr->addr1))
+ is_packet_for_us = 1;
}
- hdr = (struct ieee80211_hdr_4addr *)skb->data;
- }
-
- switch (fc & WF_FC_FTYPEi) {
- case WF_FTYPE_MGMTi:
- ieee80211_rx_mgt(ieee, hdr, stats);
break;
- case WF_FTYPE_DATAi:
- if (is_packet_for_us)
- return (ieee80211_rx(ieee, skb, stats) ? 0 : -EINVAL);
- break;
- case WF_FTYPE_CTLi:
+ case IW_MODE_INFRA:
+ /* our BSS (== from our AP) and from DS */
+ if (memcmp(hdr->addr2, ieee->bssid, ETH_ALEN) == 0)
+ if ((fc & (IEEE80211_FCTL_TODS+IEEE80211_FCTL_FROMDS)) == IEEE80211_FCTL_FROMDS) {
+ /* promisc: get all */
+ if (ieee->dev->flags & IFF_PROMISC)
+ is_packet_for_us = 1;
+ /* to us */
+ else if (memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0)
+ is_packet_for_us = 1;
+ /* mcast */
+ else if (is_multicast_ether_addr(hdr->addr1)) {
+ /* not our own packet bcasted from AP */
+ if (memcmp(hdr->addr3, ieee->dev->dev_addr, ETH_ALEN))
+ is_packet_for_us = 1;
+ }
+ }
break;
default:
- return -EINVAL;
+ /* ? */
+ break;
}
+ if (is_packet_for_us)
+ return (ieee80211_rx(ieee, skb, stats) ? 0 : -EINVAL);
return 0;
}
@@ -2862,12 +3164,12 @@ acx_l_softmac_process_rxbuf(acx_device_t
memset(&stats, 0, sizeof(stats));
stats.mac_time = le16_to_cpu(rxbuf->time);
- //stats.rssi =
+ //stats.rssi =
stats.signal = rxbuf->phy_snr;
stats.noise = rxbuf->phy_level;
stats.rate = rxbuf->phy_plcp_signal / 5;
stats.received_channel = adev->channel;
- //stats.control =
+ //stats.control =
stats.mask = 0
| IEEE80211_STATMASK_SIGNAL
| IEEE80211_STATMASK_NOISE
@@ -2877,12 +3179,12 @@ acx_l_softmac_process_rxbuf(acx_device_t
stats.freq = IEEE80211_24GHZ_BAND;
stats.len = skb->len;
- _TODO_wlan_rx(adev->ieee, skb, &stats);
+ _TODO_ieee80211_rx_any(adev->ieee, skb, &stats);
end:
FN_EXIT0;
}
-
+EXPORT_SYMBOL_GPL(acx_l_softmac_process_rxbuf);
@@ -3035,6 +3337,7 @@ acx_l_handle_txrate_auto(acx_device_t *a
}
}
+EXPORT_SYMBOL_GPL(acx_l_handle_txrate_auto);
/***********************************************************************
** acx_i_start_xmit
@@ -3147,7 +3450,7 @@ acx_i_ieee80211_start_xmit(struct ieee80
acx_lock(adev, flags);
- for (i = 0; i < txb->nr_frags; i++) {
+ for (i = 0; i < txb->nr_frags; i++) {
tx_t *tx;
void *txbuf;
struct sk_buff *skb = txb->fragments[i];
@@ -3170,7 +3473,7 @@ acx_i_ieee80211_start_xmit(struct ieee80
//ndev->trans_start = jiffies;
//adev->stats.tx_packets++;
//adev->stats.tx_bytes += skb->len;
- }
+ }
rc = 0;
end:
@@ -3184,6 +3487,7 @@ end_no_unlock:
return rc;
}
+EXPORT_SYMBOL_GPL(acx_i_ieee80211_start_xmit);
/***********************************************************************
** acx_l_update_ratevector
@@ -3481,6 +3785,7 @@ acx_set_status(acx_device_t *adev, u16 n
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_set_status);
/***********************************************************************
** acx_i_timer
@@ -3560,6 +3865,7 @@ acx_i_timer(unsigned long address)
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_i_timer);
/***********************************************************************
** acx_set_timer
@@ -5484,6 +5790,7 @@ release_ret:
return res;
}
+EXPORT_SYMBOL_GPL(acx_s_read_fw);
/***********************************************************************
** acx_s_set_wepkey
@@ -6072,6 +6379,7 @@ fail:
return result;
}
+EXPORT_SYMBOL_GPL(acx_s_init_mac);
void
acx_s_set_sane_reg_domain(acx_device_t *adev, int do_set)
@@ -6704,6 +7012,7 @@ acx_s_update_card_settings(acx_device_t
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_s_update_card_settings);
/***********************************************************************
** acx_e_after_interrupt_task
@@ -6910,6 +7219,7 @@ acx_schedule_task(acx_device_t *adev, un
SCHEDULE_WORK(&adev->after_interrupt_task);
}
+EXPORT_SYMBOL_GPL(acx_schedule_task);
/***********************************************************************
*/
@@ -6921,6 +7231,7 @@ acx_init_task_scheduler(acx_device_t *ad
adev->ndev);
}
+EXPORT_SYMBOL_GPL(acx_init_task_scheduler);
/***********************************************************************
** acx_s_start
@@ -6947,6 +7258,7 @@ acx_s_start(acx_device_t *adev)
FN_EXIT0;
}
+EXPORT_SYMBOL_GPL(acx_s_start);
/***********************************************************************
** acx_update_capabilities
@@ -7138,59 +7450,7 @@ acx_s_parse_configoption(acx_device_t *a
*/
}
-
-/***********************************************************************
-*/
-static int __init
-acx_e_init_module(void)
-{
- int r1,r2;
-
- acx_struct_size_check();
-
- printk("acx: this driver is still EXPERIMENTAL\n"
- "acx: reading README file and/or Craig's HOWTO is "
- "recommended, visit http://acx100.sf.net in case "
- "of further questions/discussion\n");
-
-#if defined(CONFIG_ACX_PCI_BOOL)
- r1 = acxpci_e_init_module();
-#else
- r1 = -EINVAL;
-#endif
-#if defined(CONFIG_ACX_USB_BOOL)
- r2 = acxusb_e_init_module();
-#else
- r2 = -EINVAL;
-#endif
- if (r2 && r1) /* both failed! */
- return r2 ? r2 : r1;
- /* return success if at least one succeeded */
- return 0;
-}
-
-static void __exit
-acx_e_cleanup_module(void)
-{
-#if defined(CONFIG_ACX_PCI_BOOL)
- acxpci_e_cleanup_module();
-#endif
-#if defined(CONFIG_ACX_USB_BOOL)
- acxusb_e_cleanup_module();
-#endif
-}
-
-module_init(acx_e_init_module)
-module_exit(acx_e_cleanup_module)
-
-
-
-
-
-
-
-
-
+EXPORT_SYMBOL_GPL(acx_s_parse_configoption);
//SM
void
@@ -7230,7 +7490,7 @@ acx_e_ieee80211_set_security(struct net_
adev->ieee->sec.flags |= SEC_ACTIVE_KEY;
} else
adev->ieee->sec.flags &= ~SEC_ACTIVE_KEY;
-
+
} else
adev->ieee->sec.flags &= ~SEC_ACTIVE_KEY;
@@ -7257,13 +7517,14 @@ acx_e_ieee80211_set_security(struct net_
adev->ieee->sec.flags |= SEC_LEVEL;
SET_BIT(adev->set_mask, GETSET_WEP);
}
-
+
acx_unlock(adev, flags);
acx_sem_unlock(adev);
acx_s_update_card_settings(adev);
}
+EXPORT_SYMBOL_GPL(acx_e_ieee80211_set_security);
void
acx_e_ieee80211_set_chan(struct net_device *ndev, u8 channel)
@@ -7277,3 +7538,5 @@ acx_e_ieee80211_set_chan(struct net_devi
acx_sem_unlock(adev);
}
+
+EXPORT_SYMBOL_GPL(acx_e_ieee80211_set_chan);
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/ioctl.c wireless-2.6.git.acx/drivers/net/wireless/tiacx/ioctl.c
--- wireless-2.6.git/drivers/net/wireless/tiacx/ioctl.c Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/ioctl.c Wed Mar 1 12:05:04 2006
@@ -1007,87 +1007,9 @@ acx_ioctl_set_encode(
union iwreq_data *wrqu,
char *extra)
{
- struct iw_point *dwrq = &wrqu->encoding;
- acx_device_t *adev = ndev2adev(ndev);
- int index;
int result;
-
FN_ENTER;
-
- log(L_IOCTL, "set encoding flags=0x%04X, size=%d, key: %s\n",
- dwrq->flags, dwrq->length, extra ? "set" : "No key");
-
- acx_sem_lock(adev);
-
- index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
-
- if (dwrq->length > 0) {
- /* if index is 0 or invalid, use default key */
- if ((index < 0) || (index > 3))
- index = (int)adev->ieee->sec.active_key;
-
- if (0 == (dwrq->flags & IW_ENCODE_NOKEY)) {
- if (dwrq->length > 29)
- dwrq->length = 29; /* restrict it */
-
- if (dwrq->length > 13) {
- /* 29*8 == 232, WEP256 */
- adev->ieee->sec.key_sizes[index] = 29;
- } else if (dwrq->length > 5) {
- /* 13*8 == 104bit, WEP128 */
- adev->ieee->sec.key_sizes[index] = 13;
- } else if (dwrq->length > 0) {
- /* 5*8 == 40bit, WEP64 */
- adev->ieee->sec.key_sizes[index] = 5;
- } else {
- /* disable key */
- adev->ieee->sec.key_sizes[index] = 0;
- }
-
- memset(adev->ieee->sec.keys[index], 0,
- sizeof(adev->ieee->sec.keys[index]));
- memcpy(adev->ieee->sec.keys[index], extra, dwrq->length);
- }
- } else {
- /* set transmit key */
- if ((index >= 0) && (index <= 3))
- adev->ieee->sec.active_key = index;
- else if (0 == (dwrq->flags & IW_ENCODE_MODE)) {
- /* complain if we were not just setting
- * the key mode */
- result = -EINVAL;
- goto end_unlock;
- }
- }
-
- adev->ieee->sec.enabled = !(dwrq->flags & IW_ENCODE_DISABLED);
-
- if (dwrq->flags & IW_ENCODE_OPEN) {
- adev->ieee->sec.auth_mode = WLAN_AUTH_OPEN;
-
- } else if (dwrq->flags & IW_ENCODE_RESTRICTED) {
- adev->ieee->sec.auth_mode = WLAN_AUTH_SHARED_KEY;
- }
-
- /* set flag to make sure the card WEP settings get updated */
- SET_BIT(adev->set_mask, GETSET_WEP);
-
- log(L_IOCTL, "len=%d, key at 0x%p, flags=0x%X\n",
- dwrq->length, extra, dwrq->flags);
-
- for (index = 0; index <= 3; index++) {
- if (adev->ieee->sec.key_sizes[index]) {
- log(L_IOCTL, "index=%d, size=%d, key at 0x%p\n",
- adev->ieee->sec.active_key,
- (int) adev->ieee->sec.key_sizes[index],
- adev->ieee->sec.keys[index]);
- }
- }
- result = -EINPROGRESS;
-
-end_unlock:
- acx_sem_unlock(adev);
-
+ result = ieee80211_wx_set_encode(netdev_priv(ndev), info, wrqu, extra);
FN_EXIT1(result);
return result;
}
@@ -1103,38 +1025,45 @@ acx_ioctl_get_encode(
union iwreq_data *wrqu,
char *extra)
{
- struct iw_point *dwrq = &wrqu->encoding;
- acx_device_t *adev = ndev2adev(ndev);
- int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
-
+ int result;
FN_ENTER;
-
- if (adev->ieee->sec.enabled == 0) {
- dwrq->flags = IW_ENCODE_DISABLED;
- } else {
- if ((index < 0) || (index > 3))
- index = (int)adev->ieee->sec.active_key;
-
- dwrq->flags = (adev->ieee->sec.auth_mode == WLAN_AUTH_SHARED_KEY) ?
- IW_ENCODE_RESTRICTED : IW_ENCODE_OPEN;
- dwrq->length = adev->ieee->sec.key_sizes[index];
-
- memcpy(extra, adev->ieee->sec.keys[index],
- adev->ieee->sec.key_sizes[index]);
- }
-
- /* set the current index */
- SET_BIT(dwrq->flags, index + 1);
-
- log(L_IOCTL, "len=%d, key=%p, flags=0x%X\n",
- dwrq->length, dwrq->pointer,
- dwrq->flags);
-
- FN_EXIT1(OK);
- return OK;
+ result = ieee80211_wx_get_encode(netdev_priv(ndev), info, wrqu, extra);
+ FN_EXIT1(result);
+ return result;
}
-
+/***********************************************************************
+** acx_ioctl_set_encodeext
+*/
+static int
+acx_ioctl_set_encodeext(
+ struct net_device *ndev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ int result;
+ FN_ENTER;
+ result = ieee80211_wx_set_encodeext(netdev_priv(ndev), info, wrqu, extra);
+ FN_EXIT1(result);
+ return result;
+}
+/***********************************************************************
+** acx_ioctl_get_encodeext
+*/
+static int
+acx_ioctl_get_encodeext(
+ struct net_device *ndev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ int result;
+ FN_ENTER;
+ result = ieee80211_wx_get_encodeext(netdev_priv(ndev), info, wrqu, extra);
+ FN_EXIT1(result);
+ return result;
+}
/***********************************************************************
*/
static int
@@ -2608,6 +2537,8 @@ static const iw_handler acx_ioctl_handle
/* Encoding */
WX(SIOCSIWENCODE) = acx_ioctl_set_encode,
WX(SIOCGIWENCODE) = acx_ioctl_get_encode,
+ WX(SIOCSIWENCODEEXT) = acx_ioctl_set_encodeext,
+ WX(SIOCGIWENCODEEXT) = acx_ioctl_get_encodeext,
/* Power saving */
WX(SIOCSIWPOWER) = acx_ioctl_set_power,
WX(SIOCGIWPOWER) = acx_ioctl_get_power,
@@ -2803,3 +2734,5 @@ const struct iw_handler_def acx_ioctl_ha
.get_wireless_stats = acx_e_get_wireless_stats
#endif /* IW > 5 */
};
+
+EXPORT_SYMBOL_GPL(acx_ioctl_handler_def);
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/pci.c wireless-2.6.git.acx/drivers/net/wireless/tiacx/pci.c
--- wireless-2.6.git/drivers/net/wireless/tiacx/pci.c Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/pci.c Wed Mar 1 12:05:04 2006
@@ -105,6 +105,25 @@ static int acxpci_e_close(struct net_dev
static void acxpci_s_up(struct net_device *ndev);
static void acxpci_s_down(struct net_device *ndev);
+#if ACX_DEBUG
+static int acxpci_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr);
+#else
+static int acxpci_s_issue_cmd_timeo(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout);
+#endif
+static int acxpci_s_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
+static int acxpci_s_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
+static tx_t* acxpci_l_alloc_tx(acx_device_t *adev);
+static void acxpci_l_dealloc_tx(tx_t *tx_opaque);
+static void* acxpci_l_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
+static void acxpci_l_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len);
+
+#ifdef MODULE_LICENSE
+MODULE_LICENSE("Dual MPL/GPL");
+#endif
+/* USB had this: MODULE_AUTHOR("Martin Wawro <martin.wawro AT uni-dortmund.de>"); */
+MODULE_AUTHOR("ACX100 Open Source Driver development team");
+MODULE_DESCRIPTION("Driver for TI ACX1xx based wireless cards (CardBus/PCI)");
+
/***********************************************************************
** Register access
@@ -174,11 +193,13 @@ write_flush(acx_device_t *adev)
readb(adev->iobase);
}
-
-/***********************************************************************
-*/
-static struct net_device *root_adev_newest = NULL;
-DECLARE_MUTEX(root_adev_sem);
+INLINE_IO int
+adev_present(acx_device_t *adev)
+{
+ /* fast version (accesses the first register, IO_ACX_SOFT_RESET,
+ * which should be safe): */
+ return readl(adev->iobase) != 0xffffffff;
+}
/***********************************************************************
@@ -406,7 +427,7 @@ end:
** Messing with rx/tx disabling and enabling here
** (write_reg32(adev, IO_ACX_ENABLE, 0b000000xx)) kills traffic
*/
-int
+static int
acxpci_s_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf)
{
int result = NOT_OK;
@@ -447,7 +468,7 @@ fail:
/***********************************************************************
*/
-int
+static int
acxpci_s_write_phy_reg(acx_device_t *adev, u32 reg, u8 value)
{
FN_ENTER;
@@ -1001,8 +1022,8 @@ end:
#undef FUNC
#define FUNC "issue_cmd"
+static int
#if !ACX_DEBUG
-int
acxpci_s_issue_cmd_timeo(
acx_device_t *adev,
unsigned int cmd,
@@ -1011,7 +1032,6 @@ acxpci_s_issue_cmd_timeo(
unsigned cmd_timeout)
{
#else
-int
acxpci_s_issue_cmd_timeo_debug(
acx_device_t *adev,
unsigned cmd,
@@ -1058,13 +1078,13 @@ acxpci_s_issue_cmd_timeo_debug(
/* Test for IDLE state */
if (!cmd_status)
break;
- if (counter % 5 == 0) {
+ if (counter % 8 == 0) {
if (time_after(jiffies, timeout)) {
counter = 0;
break;
}
- /* we waited 5 iterations, no luck. Sleep 5 ms */
- acx_s_msleep(5);
+ /* we waited 8 iterations, no luck. Sleep 8 ms */
+ acx_s_msleep(8);
}
} while (likely(--counter));
@@ -1124,13 +1144,13 @@ acxpci_s_issue_cmd_timeo_debug(
break;
}
- if (counter % 5 == 0) {
+ if (counter % 8 == 0) {
if (time_after(jiffies, timeout)) {
counter = 0;
break;
}
- /* we waited 5 iterations, no luck. Sleep 5 ms */
- acx_s_msleep(5);
+ /* we waited 8 iterations, no luck. Sleep 8 ms */
+ acx_s_msleep(8);
}
} while (likely(--counter));
@@ -1273,62 +1293,6 @@ acx_show_card_eeprom_id(acx_device_t *ad
/***********************************************************************
-*/
-static void
-acxpci_s_device_chain_add(struct net_device *ndev)
-{
- acx_device_t *adev = ndev2adev(ndev);
-
- down(&root_adev_sem);
- adev->prev_nd = root_adev_newest;
- root_adev_newest = ndev;
- adev->ndev = ndev;
- up(&root_adev_sem);
-}
-
-static void
-acxpci_s_device_chain_remove(struct net_device *ndev)
-{
- struct net_device *querydev;
- struct net_device *olderdev;
- struct net_device *newerdev;
-
- down(&root_adev_sem);
- querydev = root_adev_newest;
- newerdev = NULL;
- while (querydev) {
- olderdev = ndev2adev(querydev)->prev_nd;
- if (0 == strcmp(querydev->name, ndev->name)) {
- if (!newerdev) {
- /* if we were at the beginning of the
- * list, then it's the list head that
- * we need to update to point at the
- * next older device */
- root_adev_newest = olderdev;
- } else {
- /* it's the device that is newer than us
- * that we need to update to point at
- * the device older than us */
- ndev2adev(newerdev)->prev_nd = olderdev;
- }
- break;
- }
- /* "newerdev" is actually the device of the old iteration,
- * but since the list starts (root_adev_newest)
- * with the newest devices,
- * it's newer than the ones following.
- * Oh the joys of iterating from newest to oldest :-\ */
- newerdev = querydev;
-
- /* keep checking old devices for matches until we hit the end
- * of the list */
- querydev = olderdev;
- }
- up(&root_adev_sem);
-}
-
-
-/***********************************************************************
** acxpci_free_desc_queues
**
** Releases the queues that have been allocated, the
@@ -1617,6 +1581,7 @@ acxpci_e_probe(struct pci_dev *pdev, con
** just _presume_ that we're under sem (instead of actually taking it): */
/* acx_sem_lock(adev); */
adev->pdev = pdev;
+ adev->ndev = ndev;
adev->dev_type = DEVTYPE_PCI;
adev->chip_type = chip_type;
adev->chip_name = chip_name;
@@ -1645,6 +1610,24 @@ acxpci_e_probe(struct pci_dev *pdev, con
adev->ieee->sec.enabled = 0;
adev->ieee->sec.auth_mode = WLAN_AUTH_OPEN;
+ if (IS_ACX100(adev)) {
+ adev->ops.create_dma_regions = acx100_s_create_dma_regions;
+ } else {
+ adev->ops.create_dma_regions = acx111_s_create_dma_regions;
+ }
+ adev->ops.delete_dma_regions = acxpci_s_delete_dma_regions;
+#if ACX_DEBUG
+ adev->ops.issue_cmd = acxpci_s_issue_cmd_timeo_debug;
+#else
+ adev->ops.issue_cmd = acxpci_s_issue_cmd_timeo;
+#endif /* ACX_DEBUG */
+ adev->ops.alloc_tx = acxpci_l_alloc_tx;
+ adev->ops.dealloc_tx = acxpci_l_dealloc_tx;
+ adev->ops.get_txbuf = acxpci_l_get_txbuf;
+ adev->ops.tx_data = acxpci_l_tx_data;
+ adev->ops.write_phy_reg = acxpci_s_write_phy_reg;
+ adev->ops.read_phy_reg = acxpci_s_read_phy_reg;
+
#ifdef NONESSENTIAL_FEATURES
acx_show_card_eeprom_id(adev);
#endif /* NONESSENTIAL_FEATURES */
@@ -1654,9 +1637,6 @@ acxpci_e_probe(struct pci_dev *pdev, con
#endif
SET_NETDEV_DEV(ndev, &pdev->dev);
- /* register new dev in linked list */
- acxpci_s_device_chain_add(ndev);
-
log(L_IRQ|L_INIT, "using IRQ %d\n", pdev->irq);
/* need to be able to restore PCI state after a suspend */
@@ -1731,7 +1711,6 @@ fail_register_netdev:
fail_init_mac:
fail_reset:
- acxpci_s_device_chain_remove(ndev);
free_netdev(ndev);
fail_alloc_netdev:
fail_irq:
@@ -1765,11 +1744,8 @@ done:
/***********************************************************************
** acxpci_e_remove
**
-** Deallocate PCI resources for the acx chip.
-**
-** This should NOT execute any other hardware operations on the card,
-** since the card might already be ejected. Instead, that should be done
-** in cleanup_module, since the card is most likely still available there.
+** Shut device down (if not hot unplugged)
+** and deallocate PCI resources for the acx chip.
**
** pdev - ptr to PCI device structure containing info about pci configuration
*/
@@ -1779,6 +1755,7 @@ acxpci_e_remove(struct pci_dev *pdev)
struct net_device *ndev;
acx_device_t *adev;
unsigned long mem_region1, mem_region2;
+ unsigned long flags;
FN_ENTER;
@@ -1791,6 +1768,43 @@ acxpci_e_remove(struct pci_dev *pdev)
adev = ndev2adev(ndev);
+ /* If device wasn't hot unplugged... */
+ if (adev_present(adev)) {
+
+ acx_sem_lock(adev);
+
+ /* disable both Tx and Rx to shut radio down properly */
+ acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_TX, NULL, 0);
+ acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_RX, NULL, 0);
+
+#ifdef REDUNDANT
+ /* put the eCPU to sleep to save power
+ * Halting is not possible currently,
+ * since not supported by all firmware versions */
+ acx_s_issue_cmd(adev, ACX100_CMD_SLEEP, NULL, 0);
+#endif
+ acx_lock(adev, flags);
+ /* disable power LED to save power :-) */
+ log(L_INIT, "switching off power LED to save power\n");
+ acxpci_l_power_led(adev, 0);
+ /* stop our eCPU */
+ if (IS_ACX111(adev)) {
+ /* FIXME: does this actually keep halting the eCPU?
+ * I don't think so...
+ */
+ acxpci_l_reset_mac(adev);
+ } else {
+ u16 temp;
+ /* halt eCPU */
+ temp = read_reg16(adev, IO_ACX_ECPU_CTRL) | 0x1;
+ write_reg16(adev, IO_ACX_ECPU_CTRL, temp);
+ write_flush(adev);
+ }
+ acx_unlock(adev, flags);
+
+ acx_sem_unlock(adev);
+ }
+
/* unregister the device to not let the kernel
* (e.g. ioctls) access a half-deconfigured device
* NB: this will cause acxpci_e_close() to be called,
@@ -1802,6 +1816,13 @@ acxpci_e_remove(struct pci_dev *pdev)
* For paranoid reasons we continue to follow the rules */
acx_sem_lock(adev);
+ if (adev->dev_state_mask & ACX_STATE_IFACE_UP) {
+ acxpci_s_down(ndev);
+ CLEAR_BIT(adev->dev_state_mask, ACX_STATE_IFACE_UP);
+ }
+
+ acx_proc_unregister_entries(ndev);
+
if (IS_ACX100(adev)) {
mem_region1 = PCI_ACX100_REGION1;
mem_region2 = PCI_ACX100_REGION2;
@@ -1810,33 +1831,21 @@ acxpci_e_remove(struct pci_dev *pdev)
mem_region2 = PCI_ACX111_REGION2;
}
- acx_proc_unregister_entries(ndev);
-
- /* find our PCI device in the global acx list and remove it */
- acxpci_s_device_chain_remove(ndev);
-
- if (adev->dev_state_mask & ACX_STATE_IFACE_UP)
- acxpci_s_down(ndev);
-
- CLEAR_BIT(adev->dev_state_mask, ACX_STATE_IFACE_UP);
-
- acxpci_s_delete_dma_regions(adev);
-
/* finally, clean up PCI bus state */
+ acxpci_s_delete_dma_regions(adev);
if (adev->iobase) iounmap(adev->iobase);
if (adev->iobase2) iounmap(adev->iobase2);
-
release_mem_region(pci_resource_start(pdev, mem_region1),
pci_resource_len(pdev, mem_region1));
-
release_mem_region(pci_resource_start(pdev, mem_region2),
pci_resource_len(pdev, mem_region2));
-
pci_disable_device(pdev);
/* remove dev registration */
pci_set_drvdata(pdev, NULL);
+ acx_sem_unlock(adev);
+
/* Free netdev (quite late,
* since otherwise we might get caught off-guard
* by a netdev timeout handler execution
@@ -2008,10 +2017,10 @@ acxpci_s_up(struct net_device *ndev)
/***********************************************************************
** acxpci_s_down
**
-** This disables the netdevice
+** NB: device may be already hot unplugged if called from acxpci_e_remove()
**
-** Side effects:
-** - disables on-card interrupt request
+** Disables on-card interrupt request, stops softirq and timer, stops queue,
+** sets status == STOPPED
*/
static void
@@ -2298,7 +2307,7 @@ static void
acxpci_l_process_rxdesc(acx_device_t *adev)
{
register rxhostdesc_t *hostdesc;
- int count, tail;
+ unsigned count, tail;
FN_ENTER;
@@ -3026,11 +3035,11 @@ acx100pci_ioctl_set_phy_amp_bias(
** after figuring out how many we need and whether we still have
** sufficiently many.
*/
-tx_t*
+static tx_t*
acxpci_l_alloc_tx(acx_device_t *adev)
{
struct txdesc *txdesc;
- int head;
+ unsigned head;
u8 ctl8;
FN_ENTER;
@@ -3078,10 +3087,15 @@ end:
return (tx_t*)txdesc;
}
+/* Dummy function. */
+static void
+acxpci_l_dealloc_tx(tx_t *tx_opaque)
+{
+}
/***********************************************************************
*/
-void*
+static void*
acxpci_l_get_txbuf(acx_device_t *adev, tx_t* tx_opaque)
{
return get_txhostdesc(adev, (txdesc_t*)tx_opaque)->data;
@@ -3098,7 +3112,7 @@ acxpci_l_get_txbuf(acx_device_t *adev, t
** pre-allocated tx descrs, properly setting up transfer data and
** CTL_xxx flags according to fragment number.
*/
-void
+static void
acxpci_l_tx_data(acx_device_t *adev, tx_t* tx_opaque, int len)
{
txdesc_t *txdesc = (txdesc_t*)tx_opaque;
@@ -3391,7 +3405,7 @@ unsigned int
acxpci_l_clean_txdesc(acx_device_t *adev)
{
txdesc_t *txdesc;
- int finger;
+ unsigned finger;
int num_cleaned;
u16 r111;
u8 error, ack_failures, rts_failures, rts_ok, r100;
@@ -4213,70 +4227,12 @@ acxpci_e_init_module(void)
void __exit
acxpci_e_cleanup_module(void)
{
- struct net_device *ndev;
- unsigned long flags;
-
FN_ENTER;
- /* Since the whole module is about to be unloaded,
- * we recursively shutdown all cards we handled instead
- * of doing it in acxpci_e_remove() (which will be activated by us
- * via pci_unregister_driver at the end).
- * acxpci_e_remove() might just get called after a card eject,
- * that's why hardware operations have to be done here instead
- * when the hardware is available. */
-
- down(&root_adev_sem);
-
- ndev = root_adev_newest;
- while (ndev) {
- acx_device_t *adev = ndev2adev(ndev);
-
- acx_sem_lock(adev);
-
- /* disable both Tx and Rx to shut radio down properly */
- acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_TX, NULL, 0);
- acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_RX, NULL, 0);
-
-#ifdef REDUNDANT
- /* put the eCPU to sleep to save power
- * Halting is not possible currently,
- * since not supported by all firmware versions */
- acx_s_issue_cmd(adev, ACX100_CMD_SLEEP, NULL, 0);
-#endif
- acx_lock(adev, flags);
-
- /* disable power LED to save power :-) */
- log(L_INIT, "switching off power LED to save power\n");
- acxpci_l_power_led(adev, 0);
-
- /* stop our eCPU */
- if (IS_ACX111(adev)) {
- /* FIXME: does this actually keep halting the eCPU?
- * I don't think so...
- */
- acxpci_l_reset_mac(adev);
- } else {
- u16 temp;
-
- /* halt eCPU */
- temp = read_reg16(adev, IO_ACX_ECPU_CTRL) | 0x1;
- write_reg16(adev, IO_ACX_ECPU_CTRL, temp);
- write_flush(adev);
- }
-
- acx_unlock(adev, flags);
-
- acx_sem_unlock(adev);
-
- ndev = adev->prev_nd;
- }
-
- up(&root_adev_sem);
-
- /* now let the PCI layer recursively remove
- * all PCI related things (acxpci_e_remove()) */
pci_unregister_driver(&acxpci_drv_id);
FN_EXIT0;
}
+
+module_init(acxpci_e_init_module);
+module_exit(acxpci_e_cleanup_module);
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/usb.c wireless-2.6.git.acx/drivers/net/wireless/tiacx/usb.c
--- wireless-2.6.git/drivers/net/wireless/tiacx/usb.c Wed Mar 1 07:56:14 2006
+++ wireless-2.6.git.acx/drivers/net/wireless/tiacx/usb.c Wed Mar 1 12:05:04 2006
@@ -123,10 +123,30 @@ static void acxusb_l_poll_rx(acx_device_
static void acxusb_i_tx_timeout(struct net_device *);
+#if ACX_DEBUG
+static int acxusb_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr);
+#else
+static int acxusb_s_issue_cmd_timeo(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout);
+#endif
+static int acxusb_s_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
+static int acxusb_s_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
+static tx_t* acxusb_l_alloc_tx(acx_device_t *adev);
+static void acxusb_l_dealloc_tx(tx_t *tx_opaque);
+static void* acxusb_l_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
+static void acxusb_l_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len);
+
/* static void dump_device(struct usb_device *); */
/* static void dump_device_descriptor(struct usb_device_descriptor *); */
/* static void dump_config_descriptor(struct usb_config_descriptor *); */
+#ifdef MODULE_LICENSE
+MODULE_LICENSE("Dual MPL/GPL");
+#endif
+/* USB had this: MODULE_AUTHOR("Martin Wawro <martin.wawro AT uni-dortmund.de>"); */
+MODULE_AUTHOR("ACX100 Open Source Driver development team");
+MODULE_DESCRIPTION("Driver for TI ACX1xx based wireless cards (USB)");
+
+
/***********************************************************************
** Module Data
*/
@@ -150,6 +170,7 @@ acxusb_ids[] = {
{}
};
+MODULE_DEVICE_TABLE(usb, acxusb_ids);
/* USB driver data structure as required by the kernel's USB core */
static struct usb_driver
@@ -211,7 +232,7 @@ acxusb_unlink_urb(struct urb* urb)
/***********************************************************************
** acxusb_s_read_phy_reg
*/
-int
+static int
acxusb_s_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf)
{
/* mem_read_write_t mem; */
@@ -236,7 +257,7 @@ acxusb_s_read_phy_reg(acx_device_t *adev
/***********************************************************************
*/
-int
+static int
acxusb_s_write_phy_reg(acx_device_t *adev, u32 reg, u8 value)
{
mem_read_write_t mem;
@@ -270,17 +291,15 @@ acxusb_s_write_phy_reg(acx_device_t *ade
#undef FUNC
#define FUNC "issue_cmd"
+static int
#if !ACX_DEBUG
-int
acxusb_s_issue_cmd_timeo(
acx_device_t *adev,
unsigned cmd,
void *buffer,
unsigned buflen,
unsigned timeout)
-{
#else
-int
acxusb_s_issue_cmd_timeo_debug(
acx_device_t *adev,
unsigned cmd,
@@ -288,8 +307,8 @@ acxusb_s_issue_cmd_timeo_debug(
unsigned buflen,
unsigned timeout,
const char* cmdstr)
-{
#endif
+{
/* USB ignores timeout param */
struct usb_device *usbdev;
@@ -754,6 +773,11 @@ acxusb_s_fill_configoption(acx_device_t
return OK;
}
+/* Dummy function. */
+static void
+acxusb_s_delete_dma_regions(acx_device_t *adev)
+{
+}
/***********************************************************************
** acxusb_e_probe()
@@ -882,6 +906,20 @@ acxusb_e_probe(struct usb_interface *int
adev->ieee->sec.encrypt = 0;
adev->ieee->sec.auth_mode = WLAN_AUTH_OPEN;
+ adev->ops.create_dma_regions = acx100_s_create_dma_regions;
+ adev->ops.delete_dma_regions = acxusb_s_delete_dma_regions;
+#if ACX_DEBUG
+ adev->ops.issue_cmd = acxusb_s_issue_cmd_timeo_debug;
+#else
+ adev->ops.issue_cmd = acxusb_s_issue_cmd_timeo;
+#endif /* ACX_DEBUG */
+ adev->ops.alloc_tx = acxusb_l_alloc_tx;
+ adev->ops.dealloc_tx = acxusb_l_dealloc_tx;
+ adev->ops.get_txbuf = acxusb_l_get_txbuf;
+ adev->ops.tx_data = acxusb_l_tx_data;
+ adev->ops.write_phy_reg = acxusb_s_write_phy_reg;
+ adev->ops.read_phy_reg = acxusb_s_read_phy_reg;
+
/* Check that this is really the hardware we know about.
** If not sure, at least notify the user that he
** may be in trouble...
@@ -1582,11 +1620,11 @@ end_unlock:
** acxusb_l_alloc_tx
** Actually returns a usb_tx_t* ptr
*/
-tx_t*
+static tx_t*
acxusb_l_alloc_tx(acx_device_t *adev)
{
usb_tx_t *tx;
- int head;
+ unsigned head;
FN_ENTER;
@@ -1620,7 +1658,7 @@ end:
/***************************************************************
** Used if alloc_tx()'ed buffer needs to be cancelled without doing tx
*/
-void
+static void
acxusb_l_dealloc_tx(tx_t *tx_opaque)
{
usb_tx_t* tx = (usb_tx_t*)tx_opaque;
@@ -1630,7 +1668,7 @@ acxusb_l_dealloc_tx(tx_t *tx_opaque)
/***************************************************************
*/
-void*
+static void*
acxusb_l_get_txbuf(acx_device_t *adev, tx_t* tx_opaque)
{
usb_tx_t* tx = (usb_tx_t*)tx_opaque;
@@ -1644,7 +1682,7 @@ acxusb_l_get_txbuf(acx_device_t *adev, t
** Can be called from IRQ (rx -> (AP bridging or mgmt response) -> tx).
** Can be called from acx_i_start_xmit (data frames from net core).
*/
-void
+static void
acxusb_l_tx_data(acx_device_t *adev, tx_t* tx_opaque, int wlanpkt_len)
{
struct usb_device *usbdev;
@@ -1810,7 +1848,8 @@ acxusb_e_cleanup_module()
usb_deregister(&acxusb_driver);
}
-
+module_init(acxusb_e_init_module);
+module_exit(acxusb_e_cleanup_module);
/***********************************************************************
** DEBUG STUFF
*/
^ permalink raw reply
* Re: No syncing after crash. Is this a software raid bug?
From: Luca Berra @ 2006-03-01 13:58 UTC (permalink / raw)
To: linux-raid
In-Reply-To: <20060301124432.GA3591@hactar.lan>
On Wed, Mar 01, 2006 at 01:44:33PM +0100, Kasper Dupont wrote:
>Should I report this as a bug in Fedora Core or did I miss
>something?
>
you forgot to post evidence
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply
* Re: 2.6.16-rc5-mm1
From: Mike Galbraith @ 2006-03-01 13:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Laurent Riffard, jesper.juhl, linux-kernel, rjw, mbligh, clameter,
ebiederm
In-Reply-To: <20060301023235.735c8c47.akpm@osdl.org>
On Wed, 2006-03-01 at 02:32 -0800, Andrew Morton wrote:
> Laurent Riffard <laurent.riffard@free.fr> wrote:
> >
> > Le 01.03.2006 01:21, Andrew Morton a écrit :
> > > Laurent Riffard <laurent.riffard@free.fr> wrote:
> > >
> > >>BUG: unable to handle kernel NULL pointer dereference at virtual address 00000034
> > >
> > >
> > > I booted that thing on five machines, four architectures :(
> > >
> > > Could people please test a couple more patchsets, see if we can isolate it?
> > >
> > > http://www.zip.com.au/~akpm/linux/patches/stuff/2.6.16-rc5-mm1.1.gz
> > >
> > > is 2.6.16-rc5-mm1 minus:
> > >
> > > proc-make-proc_numbuf-the-buffer-size-for-holding-a.patch
> > > tref-implement-task-references.patch
> > > proc-dont-lock-task_structs-indefinitely.patch
> > > proc-dont-lock-task_structs-indefinitely-git-nfs-fix.patch
> > > proc-dont-lock-task_structs-indefinitely-cpuset-fix.patch
> > > proc-optimize-proc_check_dentry_visible.patch
> >
> > Ok, 2.6.16-rc5-mm1.1 works for me:
> > - I can run java from command line in runlevel 1
> > - I can launch Mozilla in X
>
> Useful, thanks. So the second batch of /proc patches are indeed the problem.
>
> If you have (even more) time you could test
> http://www.zip.com.au/~akpm/linux/patches/stuff/2.6.16-rc5-mm2-pre1.gz.
> That's the latest of everything with the problematic sysfs patches reverted
> and Eric's recent /proc fixes.
Seems to work OK here, with debug settings as in Paul Jackson's report.
No java crash, no fuser -n tcp NNNN crash. Only thing I see so far is
the proc symbolic link to nirvana permissions thingie. Box is P4 HT.
-Mike
^ permalink raw reply
* Re: NCQ general question
From: Jens Axboe @ 2006-03-01 13:55 UTC (permalink / raw)
To: Mark Lord
Cc: Gentoopower, Raz Ben-Jehuda(caro), Linux RAID Mailing List,
linux-ide@vger.kernel.org
In-Reply-To: <4405A656.1030602@rtr.ca>
On Wed, Mar 01 2006, Mark Lord wrote:
> Gentoopower wrote:
> >Raz Ben-Jehuda(caro) wrote:
> >>i am thinking of buying a promise card sataII pcix.
> >>they have two types, a card which support NCQ
> >>and another that does not.
> >>What is the bennifit of buying a card with NCQ tagging ?
> >>
> >How about: http://en.wikipedia.org/wiki/Native_command_queueing
>
> Yuck.. what a lousy wiki entry.
Yeah, it's pretty bogus.
> NCQ vs. TCQ: NCQ has a much more efficient low-level protocol,
> making the host-side (controller, operating-system) quite a bit
> simpler than with NCQ.
Or in laymens terms - TCQ sucks and NCQ doesn't :-)
NCQ has many more advantages than TCQ, apart from both a more efficient
low level protocol and ease of implementation. TCQ basically just allows
the drive to do some reordering, it still serializes everything and
requires too many interrupts.
> Both use 32-deep queue depths, and neither of them are worth a
> damn on Linux yet. Except possibly in the libata ahci driver,
> or vendor-provided drivers (open source, even) for some chipsets.
Eh strange statement, NCQ works just fine in Linux with the NCQ patch.
On AHCI only of course, as that is the only docu I had available.
> In theory, NCQ/TCQ can speed up a very busy fileserver that is
> handling mostly tiny I/O requests. Practically no measurable
> benefit for single-user systems.
Even single user systems easily have more than on pending request, I'd
say results are very measurable for random 4kb io. In real life the
casual single user wont see much benefit, mainly because he doesn't do a
whole lot of io. I have seen over 30% benefit in "micro" io benchmarks,
though.
--
Jens Axboe
^ permalink raw reply
* Re: [RFC] Add kernel<->userspace ABI stability documentation
From: Lars Marowsky-Bree @ 2006-03-01 13:53 UTC (permalink / raw)
To: linux-kernel
In-Reply-To: <20060227194400.GB9991@suse.de>
On 2006-02-27T11:44:00, Greg KH <gregkh@suse.de> wrote:
> > Ok, but how do you plan to address the basic practical problem?
> > People cannot freely upgrade/downgrade kernels anymore since udev/hal
> > are used widely in distributions.
> I can freely upgrade/downgrade kernels on some distros[1] if I wish to,
> as they support such things. Just complain to your distro maker if you
> have this issue :)
This is a somewhat cheap excuse.
The fact is that now we have user-space and kernel space tied together
much more intimately than ever; udev & sysfs being the prime examples
these days, and then it's not that some figure in top is wrong, but
"oops my network no longer loads and the box is 400 miles away".
I don't have any issue with that per se, and the kernel can continue to
change as much as it wants, but for the users' sake, the user-land needs
to be at least _backwards compatible_ for a number of kernel releases.
ie, you can upgrade the kernel, and this forces you to upgrade the
user-space - annoying, but alright -, but at least said user-space will
support the older kernel(s) in case one has to go back (or accidentially
doesn't boot into the new kernel at all ;-).
So that a user could always be sure that if they are running udev-latest
(for example; a number of other projects have the same issue), they can
run almost any kernel up to that point.
This isn't a policy we can dictate to user-space, but an expectation it
should measure up to, at least for such critical components as required
for the system to get up to the point of being able to log in
(serial/console/ssh) again and fix anything.
Interfaces in the boot path are more critical than sound or even gfx
starting up or not, which is merely annoying ;-)
That said, the proposal is great, as are Ted's comments. We definetely
need to document which parts of the evolving interface are supposed to
be stable, otherwise we're confusing the users mightily and causing much
havoc. And users can also use this as evidence against us ("you said
the interface was _stable_, damn it!" and we'd have to at least go
"Oops, sorry, we had to." instead of "neener neener!" ;-) Please go
ahead with this!
Sincerely,
Lars Marowsky-Brée
--
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business -- Charles Darwin
"Ignorance more frequently begets confidence than does knowledge"
^ permalink raw reply
* Re: [PATCH] leave APIC code inactive by default on i386
From: Matthew Garrett @ 2006-03-01 13:52 UTC (permalink / raw)
To: Dave Jones
Cc: Michael Ellerman, Darrick J. Wong, linux-kernel, Chris McDermott
In-Reply-To: <20060301133809.GA16840@redhat.com>
Dave Jones <davej@redhat.com> wrote:
> On Wed, Mar 01, 2006 at 04:10:26PM +1100, Michael Ellerman wrote:
> >
> > Ok, even more reason for it to go in. Someone might want to let the folks at
> > Ubuntu know too, they seem to have it enabled in their installer kernel. :D
>
> Last I looked they picked up the same patch we were carrying in Fedora.
No, we use the standard kernel behaviour (use APIC if the BIOS enabled
it, otherwise don't).
--
Matthew Garrett | mjg59-chiark.mail.linux-rutgers.kernel@srcf.ucam.org
^ permalink raw reply
* [PATCH] pktgen: Convert thread lock to mutexes.
From: Luiz Fernando Capitulino @ 2006-03-01 13:52 UTC (permalink / raw)
To: davem; +Cc: lkml, netdev, robert.olsson
Hi!
pktgen's thread semaphores are strict mutexes, convert them to the mutex
implementation.
Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
---
net/core/pktgen.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
1185abd5dacbca3052ccd93e059c497bbc8869b2
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 2221b86..2618a7b 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -113,6 +113,7 @@
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/smp_lock.h>
+#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
@@ -153,7 +154,7 @@
#include <asm/div64.h> /* do_div */
#include <asm/timex.h>
-#define VERSION "pktgen v2.65: Packet Generator for packet performance testing.\n"
+#define VERSION "pktgen v2.66: Packet Generator for packet performance testing.\n"
/* #define PG_DEBUG(a) a */
#define PG_DEBUG(a)
@@ -180,8 +181,8 @@
#define T_REMDEV (1<<4) /* Remove one dev */
/* Locks */
-#define thread_lock() down(&pktgen_sem)
-#define thread_unlock() up(&pktgen_sem)
+#define thread_lock() mutex_lock(&pktgen_mutex)
+#define thread_unlock() mutex_unlock(&pktgen_mutex)
/* If lock -- can be removed after some work */
#define if_lock(t) spin_lock(&(t->if_lock));
@@ -493,7 +494,7 @@ static int pg_delay_d;
static int pg_clone_skb_d;
static int debug;
-static DECLARE_MUTEX(pktgen_sem);
+static DEFINE_MUTEX(pktgen_mutex);
static LIST_HEAD(pktgen_threads);
static struct notifier_block pktgen_notifier_block = {
--
1.2.3.g8fcf1
--
Luiz Fernando N. Capitulino
^ permalink raw reply related
* Re: NCQ general question
From: Mark Lord @ 2006-03-01 13:49 UTC (permalink / raw)
To: Gentoopower
Cc: Raz Ben-Jehuda(caro), Linux RAID Mailing List,
linux-ide@vger.kernel.org
In-Reply-To: <440561CB.30201@yahoo.de>
Gentoopower wrote:
> Raz Ben-Jehuda(caro) wrote:
>> i am thinking of buying a promise card sataII pcix.
>> they have two types, a card which support NCQ
>> and another that does not.
>> What is the bennifit of buying a card with NCQ tagging ?
>>
> How about: http://en.wikipedia.org/wiki/Native_command_queueing
Yuck.. what a lousy wiki entry.
NCQ vs. TCQ: NCQ has a much more efficient low-level protocol,
making the host-side (controller, operating-system) quite a bit
simpler than with NCQ.
Both use 32-deep queue depths, and neither of them are worth a
damn on Linux yet. Except possibly in the libata ahci driver,
or vendor-provided drivers (open source, even) for some chipsets.
In theory, NCQ/TCQ can speed up a very busy fileserver that is
handling mostly tiny I/O requests. Practically no measurable
benefit for single-user systems.
Cheers
^ permalink raw reply
* Re: AW: AW: [Xenomai-core] vxworks-skin taskSpawn
From: Philippe Gerum @ 2006-03-01 13:46 UTC (permalink / raw)
To: Roderik_Wildenburg; +Cc: xenomai
In-Reply-To: <5D63919D95F87E4D9D34FF7748CE2C2A1C3EE6@domain.hid>
Roderik_Wildenburg@domain.hid wrote:
> Philippe Gerum wrote :
>
>>I've run the satch example successfully on an Icecube board
>>here using -rc2.
>>What's the status of this issue on your side? Was it a timer
>>configuration issue as suspected by Gilles?
>>
>
>
> Status is unchanged. I still try to debugg satch with gdb/ddd and have been a little bit successfull with this.
But I face more and more problems the deeper I dig into the system (e.g.
unresolved symbols when compiling vxWorks-examples
with --debug enabled (see other thread)
This has been fixed in the repository:
http://mail.gna.org/public/xenomai-help/2006-02/msg00149.html
or now, gdb moans about "cannot find bounds of current function" (do you have
any idea, what this means ?))
>
It means that GDB is confused actually; while stepping into some code, it could
not locate the routine the current text address belongs too. This might happen
when interrupting the program execution while it was running some code GDB has no
symbolic information about. Nothing to worry about, unless GDB would not find any
symbol at all.
> I don´t think it is a timer problem, as my timer is running in oneshot mode and not in
continous mode what causes the problem on Gilles system. But I am not shure.
Could you try running "strace" on your program? TIA,
>
> Nevertheless, thank you for asking !! If you have any other suggestions what I can do, please let me know. I will inform you when the status changes on my side.
>
> Best Regards
> Roderik
>
>
>
--
Philippe.
^ permalink raw reply
* Re: adding swap workarounds oom - was: Re: Out of Memory: Killed process 16498 (java).
From: Jens Axboe @ 2006-03-01 13:41 UTC (permalink / raw)
To: Andy Chittenden
Cc: Andi Kleen, Anton Altaparmakov, Andrew Morton, davej,
linux-kernel, lwoodman, Bartlomiej Zolnierkiewicz
In-Reply-To: <89E85E0168AD994693B574C80EDB9C270393C104@uk-email.terastack.bluearc.com>
On Wed, Mar 01 2006, Andy Chittenden wrote:
> with revised patch that does:
>
> printk("sg%d: dma=%llx, dma_len=%u/%u, pfn=%lu\n", i,
> (unsigned long long) sg->dma_address, sg->dma_length, sg->offset,
> page_to_pfn(sg->page));
That is correct, thanks!
> hda: DMA table too small
> ide dma table, 255 entries, bounce pfn 1310720
> sg0: dma=81c8800, dma_len=4096/0, pfn=1296369
Still the same badness here, it's 2kb into a page so straddles two pages
for one entry.
> sg1: dma=81c9800, dma_len=4096/0, pfn=1292696
> sg2: dma=81ca800, dma_len=4096/0, pfn=1296278
> sg3: dma=81cb800, dma_len=4096/0, pfn=1296092
> sg4: dma=81cc800, dma_len=4096/0, pfn=1296090
> sg5: dma=81cd800, dma_len=4096/0, pfn=1296088
> sg6: dma=81ce800, dma_len=4096/0, pfn=1296086
> sg7: dma=81cf800, dma_len=4096/0, pfn=1296083
This one gets split.
> sg8: dma=81d0800, dma_len=4096/0, pfn=1296081
> sg9: dma=81d1800, dma_len=4096/0, pfn=1292712
> sg10: dma=81d2800, dma_len=4096/0, pfn=1297008
> sg11: dma=81d3800, dma_len=4096/0, pfn=1297063
> sg12: dma=81d4800, dma_len=4096/0, pfn=1297146
> sg13: dma=81d5800, dma_len=4096/0, pfn=1297193
> sg14: dma=81d6800, dma_len=4096/0, pfn=1297198
> sg15: dma=81d7800, dma_len=4096/0, pfn=1296363
> sg16: dma=81d8800, dma_len=4096/0, pfn=1304021
> sg17: dma=81d9800, dma_len=4096/0, pfn=1303030
> sg18: dma=81da800, dma_len=4096/0, pfn=1302151
> sg19: dma=81db800, dma_len=4096/0, pfn=1303979
> sg20: dma=81dc800, dma_len=4096/0, pfn=1306158
> sg21: dma=81dd800, dma_len=4096/0, pfn=1304015
> sg22: dma=81de800, dma_len=4096/0, pfn=1304957
> sg23: dma=81df800, dma_len=4096/0, pfn=1304001
This one as well.
> sg24: dma=81e0800, dma_len=4096/0, pfn=1292710
> sg25: dma=81e1800, dma_len=4096/0, pfn=1304035
> sg26: dma=81e2800, dma_len=4096/0, pfn=1303025
> sg27: dma=81e3800, dma_len=4096/0, pfn=1304019
> sg28: dma=81e4800, dma_len=4096/0, pfn=1302256
> sg29: dma=81e5800, dma_len=4096/0, pfn=1304738
> sg30: dma=81e6800, dma_len=4096/0, pfn=1302998
> sg31: dma=81e7800, dma_len=4096/0, pfn=1304148
> sg32: dma=81e8800, dma_len=4096/0, pfn=1304126
> sg33: dma=81e9800, dma_len=4096/0, pfn=1303079
> sg34: dma=81ea800, dma_len=4096/0, pfn=1302996
> sg35: dma=81eb800, dma_len=4096/0, pfn=1296243
> sg36: dma=81ec800, dma_len=4096/0, pfn=1306396
> sg37: dma=81ed800, dma_len=4096/0, pfn=1306474
> sg38: dma=81ee800, dma_len=4096/0, pfn=1295929
> sg39: dma=81ef800, dma_len=4096/0, pfn=1296156
And this. And a few more below. The end result is that we are about ~20
entries short.
Andi, any idea what is going on here? Why is this throwing up all of a
sudden??
--
Jens Axboe
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.