Re: Major and minor numbers

2013-11-27 Thread Nav Kamal
On Nov 27, 2013 3:49 PM, "Sudip Mukherjee" 
wrote:
>
>
>
>
> On Tue, Nov 26, 2013 at 4:36 PM, Nav Kamal  wrote:
>>
>> Am a little stuck at major and minor numbers used to reference the
connection between device file and device driver. Can please somebody
theoretically explain how they work ?
>
> In my opinion major and minor number are like device identifier. The
combination of major and minor number (dev_t) is the deviceid. The major
number is like an id of your driver. And all the devices that are using
this driver will be having their own minor numbers. No two devices can have
the same minor number if they are being controlled by the same driver. So
when you create a device node , you specify the major and minor number with
mknod command , and that means that particular node is associated with the
driver (recognized by major number) and a particular device (recognized by
the minor number).
> Did i explain correctly or is my understanding wrong ???
>
> Regards
> Sudip
>
Thanks , yes its correct . Finally understood the concept.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to contribute to latest -rc kernel?

2013-11-27 Thread Fan Du


On 2013年11月28日 00:26, Arvid Brodin wrote:
> On 2013-11-27 02:20, Fan Du wrote:
>>
>>
>> On 2013年11月26日 05:17, Arvid Brodin wrote:
>>> Hi,
>>>
>>> How would I go ahead to send a patch for the latest -rc kernel?
>>>
>>> Specifically:
>>>
>>> * What tree to diff against? (Linus'?)
>>> * To which list do I send the patch?
>>>
>>> Background: I've contributed a new network driver that is now in 3.13-rc1. I
>>> would like to fix it so that it behaves better with iproute. Strictly 
>>> speaking
>>> this isn't a bug fix, but the driver is going to be quite useless without
>>> iproute support, and that won't be there until this fix is in the kernel.
>>
>> Almost every subsystem has its own next git tree, since it's a networking 
>> driver
>> issue, please verify your fix against net-next:
>>
>> https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/
>>
>> And send the patch to netdev maillist:
>> http://vger.kernel.org/vger-lists.html#netdev
>>
>> You need also CC the driver maintainer by looking at 
>> linux_source_code/MAINTAINERS,
>> or using ./scripts/get_maintainer.pl.
>>
>
> Actually, part of the patch series is adding myself as the maintainer for the
> driver. :)

I'm afraid this will depends on your fix is a major one or trivial...

> I thought the subsystem -next trees was for the next release of Linux? I.e., 
> what
> goes into the net-next tree now will find its way into mainline at the next
> release window, for linux-3.14-rc1?
>
> I'm not sure though. It's a bit confusing. Aldo Iljazi said this:
>>   Arvid Brodin wrote:
>>
>>> * What tree to diff against? (Linus'?)
>>
>> I believe that you need to diff against linux-next tree: 
>> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=refs/tags/next-20131126
>>
>>> * To which list do I send the patch?
>>
>> Well you can send it to the Linux Kernel Mailing List.
>> -- Aldo Iljazi
>
> Which seems reasonable to me. Is there anyone who can confirm this?

As I said before, if your fix is networking related, please rebase against 
net-next.
Refer: Documentation/networking/netdev-FAQ.txt


>
> --
> Arvid Brodin | Consultant (Linux)
> ALTEN | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden
> arvid.bro...@alten.se | www.alten.se/en/
>
> 
> Xdin has changed its name. From 25 November 2013 we are known as Alten. Read 
> more at www.alten.se
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-- 
浮沉随浪只记今朝笑

--fan fan

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to contribute to latest -rc kernel?

2013-11-27 Thread Arvid Brodin
On 2013-11-27 02:20, Fan Du wrote:
>
>
> On 2013年11月26日 05:17, Arvid Brodin wrote:
>> Hi,
>>
>> How would I go ahead to send a patch for the latest -rc kernel?
>>
>> Specifically:
>>
>> * What tree to diff against? (Linus'?)
>> * To which list do I send the patch?
>>
>> Background: I've contributed a new network driver that is now in 3.13-rc1. I
>> would like to fix it so that it behaves better with iproute. Strictly 
>> speaking
>> this isn't a bug fix, but the driver is going to be quite useless without
>> iproute support, and that won't be there until this fix is in the kernel.
>
> Almost every subsystem has its own next git tree, since it's a networking 
> driver
> issue, please verify your fix against net-next:
>
> https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/
>
> And send the patch to netdev maillist:
> http://vger.kernel.org/vger-lists.html#netdev
>
> You need also CC the driver maintainer by looking at 
> linux_source_code/MAINTAINERS,
> or using ./scripts/get_maintainer.pl.
>

Actually, part of the patch series is adding myself as the maintainer for the
driver. :)

I thought the subsystem -next trees was for the next release of Linux? I.e., 
what
goes into the net-next tree now will find its way into mainline at the next
release window, for linux-3.14-rc1?

I'm not sure though. It's a bit confusing. Aldo Iljazi said this:
>  Arvid Brodin wrote:
>
>> * What tree to diff against? (Linus'?)
>
> I believe that you need to diff against linux-next tree: 
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=refs/tags/next-20131126
>
>> * To which list do I send the patch?
>
> Well you can send it to the Linux Kernel Mailing List.
> -- Aldo Iljazi

Which seems reasonable to me. Is there anyone who can confirm this?


--
Arvid Brodin | Consultant (Linux)
ALTEN | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden
arvid.bro...@alten.se | www.alten.se/en/


Xdin has changed its name. From 25 November 2013 we are known as Alten. Read 
more at www.alten.se

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Should I pass user-space buffer pointer to read() of struct file implemented by `filp_open()`?

2013-11-27 Thread 乃宏周
In module code:

*unsigned char buf[20];*

*struct file *device;*

*device = filp_open(...);*

*device->f_op->read(device,buf,20,&device->f_pos);*

In signature(interface) of *read()* of *struct file*, *buf* should came
from user-space. I fed my buffer, and I get correct data from that, Is that
correct? Shouldn't I provide a user-space buffer to that ?
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Major and minor numbers

2013-11-27 Thread Sudip Mukherjee
On Tue, Nov 26, 2013 at 4:36 PM, Nav Kamal  wrote:

> Am a little stuck at major and minor numbers used to reference the
> connection between device file and device driver. Can please somebody
> theoretically explain how they work ?
>
In my opinion major and minor number are like device identifier. The
combination of major and minor number (dev_t) is the deviceid. The major
number is like an id of your driver. And all the devices that are using
this driver will be having their own minor numbers. No two devices can have
the same minor number if they are being controlled by the same driver. So
when you create a device node , you specify the major and minor number with
mknod command , and that means that particular node is associated with the
driver (recognized by major number) and a particular device (recognized by
the minor number).
Did i explain correctly or is my understanding wrong ???

Regards
Sudip
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies