[Cerowrt-devel] [discuss] [cdc_ncm] Refactoring cdc_ncm

Enrico Mioso mrkiko.rs at gmail.com
Tue Jan 20 13:21:34 EST 2015


First of all: hello to everyone and good evening.
I put you in CC Bjorn so that you can also follow this conversation.
Please all of you - keep me in CC, I am not subscribed to any list.

So - let explain it from the beginning. Sorry if I didn't do this before.

Some USB dongle modems / might be chipsets?, use the NCM protocol: an USB 
specification, whose main goal was to allow for grouping of more than one 
ethernet frame in a single USB packet, thus allowing for more efficiency and 
performance.
you can find it at http://www.usb.org/
after some juggling around. Or look at the URL I specified in my first patch in 
case.

An NCM packet is formed of different parts: I remember the acronyms, not their 
meaning. Still you can see them in the specs.
- DPE
- NDP
- and so on;

the position of some of these parts is "arbitrary": not specified in the specs.
The device system (running Linux) and the firmware, can infact put them 
practically where they want.
However, some particular devices, like the E3372 and possibly other devices, 
require the NDP part of the packet being placed at the end. Wituout this, the 
device will not validate packets, not answer to them.

So the need for modifying / refactoring the cdc_ncm.c driver occurred: in that 
driver infact, some parts of the NCM logic and the "driver code" are not 
separate enough in my point of view.
And more - the NCM logic itself, would need to be refactored out, so that it 
can be made more flexible in the future, adaptable to newer devices as problems 
arise.
In particular, contrary to what the driver does in it's current state, my goals 
would be, in order of importance:
- completely separate ncm-related code from the rest
- changing the way in which the {tx,rx}_fixup functions handle frames they 
{build / prepare to send,receive incoming} frames.
   This, to allow for queuing up frames and building the NCM packet all at once
   when needed.

The driver uses a smart solution to coalesce frames in one packet, as 
implemente by Bjorn, to which I am grate for this work also.

So - sorry if I've been boring.
Any help would be _greatly_ welcome.
Enrico



More information about the Cerowrt-devel mailing list