kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Header organization/separation rule in kernel
@ 2017-12-10 15:21 Shiyao MA
  2017-12-10 21:31 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Shiyao MA @ 2017-12-10 15:21 UTC (permalink / raw)
  To: kernelnewbies

Hi,

I wonder the header separation rule in kernel.
To make this question concrete, for example, let's targeting genetlink.h

It can be found in:

http://elixir.free-electrons.com/linux/latest/source/include/net/genetlink.h
http://elixir.free-electrons.com/linux/latest/source/include/linux/genetlink.h
http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/genetlink.h


so basically three parts, in uapi, linux/genetlink.h, and net/genetlink.h.

I understand the necessity of uapi, but why divide the genetlink.h in
linux and the net folder?
What's the benefit of such separation?



-- 
Best,
Shiyao

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Header organization/separation rule in kernel
  2017-12-10 15:21 Header organization/separation rule in kernel Shiyao MA
@ 2017-12-10 21:31 ` Greg KH
  2017-12-10 21:38   ` Ozgur
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2017-12-10 21:31 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Dec 10, 2017 at 11:21:46PM +0800, Shiyao MA wrote:
> Hi,
> 
> I wonder the header separation rule in kernel.
> To make this question concrete, for example, let's targeting genetlink.h
> 
> It can be found in:
> 
> http://elixir.free-electrons.com/linux/latest/source/include/net/genetlink.h
> http://elixir.free-electrons.com/linux/latest/source/include/linux/genetlink.h
> http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/genetlink.h
> 
> 
> so basically three parts, in uapi, linux/genetlink.h, and net/genetlink.h.
> 
> I understand the necessity of uapi, but why divide the genetlink.h in
> linux and the net folder?
> What's the benefit of such separation?

Some things are only for the networking subsystem, and some things are
for any other part of the kernel.

Hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Header organization/separation rule in kernel
  2017-12-10 21:31 ` Greg KH
@ 2017-12-10 21:38   ` Ozgur
  0 siblings, 0 replies; 3+ messages in thread
From: Ozgur @ 2017-12-10 21:38 UTC (permalink / raw)
  To: kernelnewbies

Hello,

11.12.2017, 00:32, "Greg KH" <greg@kroah.com>:
> On Sun, Dec 10, 2017 at 11:21:46PM +0800, Shiyao MA wrote:
>> ?Hi,
>>
>> ?I wonder the header separation rule in kernel.
>> ?To make this question concrete, for example, let's targeting genetlink.h
>>
>> ?It can be found in:
>>
>> ?http://elixir.free-electrons.com/linux/latest/source/include/net/genetlink.h
>> ?http://elixir.free-electrons.com/linux/latest/source/include/linux/genetlink.h
>> ?http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/genetlink.h
>>
>> ?so basically three parts, in uapi, linux/genetlink.h, and net/genetlink.h.
>>
>> ?I understand the necessity of uapi, but why divide the genetlink.h in
>> ?linux and the net folder?
>> ?What's the benefit of such separation?

hm, I think if you use a diff and you would see the why different header file.
for example you development a network card driver and you not be use to linux kernel genetlink header file.

use to network side genetlink.h.

So please check:

#ifndef __NET_GENERIC_NETLINK_H
#define __NET_GENERIC_NETLINK_H

#ifndef __LINUX_GENERIC_NETLINK_H
#define __LINUX_GENERIC_NETLINK_H

#ifndef _UAPI__LINUX_GENERIC_NETLINK_H
#define _UAPI__LINUX_GENERIC_NETLINK_H

they are like the assets that separate and address each others.

> Some things are only for the networking subsystem, and some things are
> for any other part of the kernel.
>
> Hope this helps,
>
> greg k-h

Regards,

Ozgur

>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-10 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-10 15:21 Header organization/separation rule in kernel Shiyao MA
2017-12-10 21:31 ` Greg KH
2017-12-10 21:38   ` Ozgur

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).