linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Schaefer <schaefer.frank@gmx.net>
To: linux-wireless@vger.kernel.org
Cc: linux-usb@vger.kernel.org, johannes@sipsolutions.net, chunkeey@web.de
Subject: [PATCH] ar9170usb: add mode-switching for AVM Fritz!WLAN USB N devices in cdrom mode
Date: Sun, 01 Nov 2009 19:00:00 +0100	[thread overview]
Message-ID: <4AEDCCA0.8050709@gmx.net> (raw)
In-Reply-To: <4ADC3657.6080906@gmx.net>

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

Frank Schaefer schrieb:
> Matthew Dharm schrieb:
>   
>> On Sat, Oct 17, 2009 at 11:34:07AM -0400, Alan Stern wrote:
>>   
>>     
>>> On Sat, 17 Oct 2009, Oliver Neukum wrote:
>>>
>>>     
>>>       
>>>> Am Samstag, 17. Oktober 2009 15:14:28 schrieb Frank Schaefer:
>>>>       
>>>>         
>>>>> I can think of multiple solutions for this, my first questions are:
>>>>> Is there already a common solution for these devices in the kernel ?
>>>>> How widespread is this bad habit of device-design ? So far, the only
>>>>> devices I know are
>>>>>         
>>>>>           
>>>> This is usually handled by the modeswitch tool outside the kernel.
>>>>       
>>>>         
>>> Alternatively, you may be able to force the device to switch modes by 
>>> running the "eject" program on it.
>>>
>>> There is mode-switching code in the kernel for a few devices.  The 
>>> current trend is to move this out of the kernel and let user programs 
>>> be responsible for it.
>>>     
>>>       
>> If you go with the current trend, then you probably will want to write some
>> UDEV rules to recognize these devices and issue the mode-changing command
>> (either modeswitch or eject).
>>
>> Matt
>>   
>>     
> Thanks for your replies, I really didn't know that there are so many
> devices showing this behavior.
>
> On Windows, AVM does the fast-eject for its devices with a small
> filter-driver avmeject.sys.
> I will try to find out the "magic sequence" needed for the mode-switch
> with a USB-logger.
>
> Regards,
> Frank
>   
I finally found the "magic" sequence.
In the meantime I've been thinking a lot (too much ?) about HOW and
WHERE to do the mode-switching.
The mailing-list-archieves were really inspiring, maybe you remember the
discussion about Tejun Heos' patches in april 2008.
The conclusion was that there is no clearly preferable way to do this
and that compromises are inevitable.

The attached patch adds the mode-switching-procedure to the WLAN-driver
(ar9170usb) and disables the storage device in the usb-storage-driver.

I really think the mode-switching should be done in the kernel and not
in user-space for reasons of usability.
Doing it in the driver means putting the code for these device together
in a single place.
It also doesn't "pollute" the driver with much code (adds a single
usb_bulk_msg()).
Another benfit is that it binds the mode-switching to the driver. If the
driver is blacklisted/not used, there will be no mode-switching.
If there would be a way to keep the usb-storage-driver enabled as
"fallback-driver" it would be an almost perfect solution...

Regards,
Frank


[-- Attachment #2: 0001-ar9170usb-add-mode-switching-for-AVM-Fritz-WLAN-USB.patch --]
[-- Type: application/mbox, Size: 4522 bytes --]

       reply	other threads:[~2009-11-01 17:59 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200910171606.02961.oliver@neukum.org>
     [not found] ` <Pine.LNX.4.44L0.0910171130550.25594-100000@netrider.rowland.org>
     [not found]   ` <20091017220313.GH24502@one-eyed-alien.net>
     [not found]     ` <4ADC3657.6080906@gmx.net>
2009-11-01 18:00       ` Frank Schaefer [this message]
2009-11-01 18:27         ` [PATCH] ar9170usb: add mode-switching for AVM Fritz!WLAN USB N devices in cdrom mode Johannes Berg
2009-11-01 20:02           ` Frank Schaefer
2009-11-01 18:29         ` Josua Dietze
2009-11-01 18:35           ` Matthew Dharm
2009-11-01 20:24             ` Frank Schaefer
2009-11-01 20:49               ` Christian Lamparter
2009-11-02 20:16                 ` Frank Schaefer
2009-11-02  0:47               ` Matthew Dharm
2009-11-02 20:07                 ` Frank Schaefer
2009-11-02 21:10                   ` Matthew Dharm
2009-11-02 21:15                     ` Matthew Dharm
2009-11-03 20:33                     ` Frank Schaefer
2009-11-01 20:11           ` Frank Schaefer
2009-11-02  0:51             ` Matthew Dharm
2009-11-02 20:10               ` Frank Schaefer
2009-11-02 20:18                 ` Dan Williams
2009-11-02 21:05                   ` Alan Cox
2009-11-02 21:37                     ` Dan Williams
2009-11-02 21:45                     ` Dan Williams
2009-11-02 22:23                       ` Christian Lamparter
2009-11-03 20:22                       ` Frank Schaefer
2009-11-02 21:11                   ` Matthew Dharm
2009-11-02 21:42                     ` Dan Williams
2009-11-02 22:39                       ` Alan Cox
2009-11-03  0:54                         ` Dan Williams
2009-11-03 10:55                       ` Oliver Neukum
2009-11-03 15:16                       ` Alan Stern
2009-11-03 16:29                         ` Oliver Neukum
2009-11-03 22:47                           ` Alan Stern
2009-11-03 23:55                             ` Oliver Neukum
2009-11-04  3:57                               ` Alan Stern
2009-11-04  9:11                                 ` Oliver Neukum
2009-11-03 20:42                         ` Frank Schaefer
2009-11-04 16:16                           ` Alan Stern
2009-11-04 16:25                             ` Johannes Berg
2009-11-04 17:07                               ` Alan Stern
2009-11-04 17:41                                 ` Josua Dietze
2009-11-04 16:41                             ` Oliver Neukum
2009-11-04 17:41                               ` Josua Dietze
2009-11-03 10:57                     ` Oliver Neukum
2009-11-03 12:58                       ` Christian Lamparter
2009-11-03 20:18                   ` Frank Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AEDCCA0.8050709@gmx.net \
    --to=schaefer.frank@gmx.net \
    --cc=chunkeey@web.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).