【linux 001】【利用staging Driver】【001】wifi AR6000 驱动移植引发的 staging 的问题

前言:

移植AR6000 到android 时候, 开始总是去找网上的开源驱动代码。

结果,发现总是因为linux kernel的版本问题,编译出现一些问题。仔细研究网上一下帖子,发现,有很多版本问题和staging 有关,

再查看,发现其实android的内核里面,其实已经包含了 staging的目录,那么,staging的目录究竟是什么意义呢?此外还有 linux-next tree

同样被牵扯进去的有      -- Linus Torvalds

这里转一篇文章写得比较详细看看。


具体如何编译使用staging里面的驱动,请看我的另外一个文章:

#####################################################################################################

起因:

Randy Dunlap
10-9-28

Re: linux-next: Tree for September 27 (staging: ath6kl, spectra, & vt6655)
将帖子翻译为中文  
On Mon, 27 Sep 2010 16:21:43 +1000 Stephen Rothwell wrote:
> Hi all,
>
> Changes since 20100924:


drivers/staging/ath6kl/os/linux/ar6000_drv.c:1370:1: warning: "CONFIG_AR600x_BT_RESET_PIN" redefined
./include/generated/autoconf.h:419:1: warning: this is the location of the previous definition
drivers/staging/ath6kl/os/linux/ioctl.c:4673: warning: the frame size of 2052 bytes is larger than 1024 bytes
drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c:288: error: 'struct mmc_host' has no member named 'max_hw_segs' #【我编译源码遇到的问题】
drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c:289: error: 'struct mmc_host' has no member named 'max_hw_segs'

drivers/staging/spectra/ffsport.c:659: error: implicit declaration of function 'blk_queue_ordered'
drivers/staging/spectra/ffsport.c:659: error: 'QUEUE_ORDERED_DRAIN_FLUSH' undeclared (first use in this function)

drivers/staging/vt6655/device_main.c:3579: warning: the frame size of 1868 bytes is larger than 1024 bytes


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Vipin Mehta
10-9-28
RE: linux-next: Tree for September 27 (staging: ath6kl, spectra, & vt6655)
将帖子翻译为中文  
> Hi all,
>
> Changes since 20100924:

drivers/staging/ath6kl/os/ linux/ar6000_drv.c:1370:1: warning: "CONFIG_AR600x_BT_RESET_PIN" redefined
./include/generated/autoconf. h:419:1: warning: this is the location of the previous definition
drivers/staging/ath6kl/os/ linux/ioctl.c:4673: warning: the frame size of 2052 bytes is larger than 1024 bytes
drivers/staging/ath6kl/hif/ sdio/linux_sdio/src/hif_ scatter.c:288: error: 'struct mmc_host' has no member named 'max_hw_segs'
drivers/staging/ath6kl/hif/ sdio/linux_sdio/src/hif_ scatter.c:289: error: 'struct mmc_host' has no member named 'max_hw_segs'

The problem is because the mmc stack is out of sync in Greg's staging tree and Stephen's linux-next tree. Greg asked me to generate a patch which I did and emailed to Greg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at   http://vger.kernel.org/majordomo-info.html
Please read the FAQ at   http://www.tux.org/lkml/
Geert Uytterhoeven
11-8-8
Re: linux-next: Tree for September 27 (staging: ath6kl, spectra, & vt6655)
将帖子翻译为中文  
On Mon, Sep 27, 2010 at 21:28, Vipin Mehta < [email protected]> wrote:
>> Changes since 20100924:
>
> drivers/staging/ath6kl/os/ linux/ar6000_drv.c:1370:1: warning: "CONFIG_AR600x_BT_RESET_PIN" redefined
> ./include/generated/autoconf. h:419:1: warning: this is the location of the previous definition
> drivers/staging/ath6kl/os/ linux/ioctl.c:4673: warning: the frame size of 2052 bytes is larger than 1024 bytes
> drivers/staging/ath6kl/hif/ sdio/linux_sdio/src/hif_ scatter.c:288: error: 'struct mmc_host' has no member named 'max_hw_segs'
> drivers/staging/ath6kl/hif/ sdio/linux_sdio/src/hif_ scatter.c:289: error: 'struct mmc_host' has no member named 'max_hw_segs'
>
> The problem is because the mmc stack is out of sync in Greg's staging tree and Stephen's linux-next tree. Greg asked me to generate a patch which I did and emailed to Greg.

And the 'warning: "CONFIG_AR600x_BT_RESET_PIN" redefined' is still there...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at   http://vger.kernel.org/majordomo-info.html
Please read the FAQ at   http://www.tux.org/lkml/


#####################################################################################################

【转】小议Linux staging tree

2.6.28版本起,内核代码的drivers下增加了一个staging目录,这个目录也是用来存放驱动程序,只是这里的驱动和上层目录的不同,加载的时候内核log会打印如下的语句:

MODULE_NAME: module is from the staging directory, the quality is unknown, you have been warned.

drivers/staging究竟所谓何物,需要从Linux staging tree说起。

Greg KH于2008年6月10号在Linux内核邮件列表里发出一封信,宣布建立了另外一棵kernel tree,这就是Linux staging tree。Greg解释到,staging tree建立之目的是用来放置一些未充分测试或者因为一些其他原因未能进入内核的新增驱动程序和新增文件系统。在信中,Greg罗列了开发者把代码提交到staging tree应该遵循哪些规则,以及哪些行为是在staging tree不受欢迎的:

The rules of what can be included here is as follows:
	- the code must be released under a Linux kernel-compatible
	  license
	- the goal of the developers must be to merge this code into the
	  main kernel tree in the near future, but not for the next
	  kernel release.
	- the code must build properly on the x86 platform
	- this is not a tree for bugfixes or rewrites of existing kernel
	  code, this should be for new features, drivers, and
	  filesystems.
	- the patches included must detail exactly what is needed to be
	  completed in order for them to be included into the main
	  kernel tree.
	- there must be some email address associated with the patch
	  that can be used for bug reporting and questions about
	  cleanups and testing the code.

What this tree is not:
	- it is not a place to dump features that are being actively
	  developed by a community of people (reiserfs4 for example.)
	- it is not a place to dump code and then run away, hoping that
	  someone else will do the cleanup work for you.  While there
	  are developers available to do this kind of work, you need to
	  get someone to agree to "babysit" the code.

但是,也有人对staging tree建立的必要性有些疑问的,毕竟,在此之前我们已经有了linux-next tree。Greg对这些疑问解释到,staging tree只是收留新增的驱动程序和文件系统,并不接收对已有代码的修改补丁。因此可以说,Greg的staging tree在很大程度上分担了Stephen Rothwell身上的压力,但并不意味着linux-next tree的角色定位发生了变化。

到这里,我们似乎应该比较了然了,对于新增的驱动我们提交的对象就是staging tree。但Greg在2009年3月18号发表的一篇博文带来了一些变故。

在文章中,Greg提到在数月前的Linux内核开发者的会议上,经过讨论Linux-staging tree的定位发生了变化,但还是很多人对staging tree究竟是什么有些疑惑。因此,Greg在这篇文章里重申了staging tree究竟是什么和不是什么(大概意思和上面引用的那封信里的内容类似)。并且,staging tree里的代码也已经被合并到了Linux内核代码里,位置正是本文开始提到的drivers/staging。也就是说,自2.6.28内核开始,我们如果要测试staging tree里的驱动程序或者文件系统,并不需要clone一个staging tree再合并到mainline内核里,mainline本身就已经包含了staging tree的代码了。对于Linux驱动开发者来说,我们也可以clone linux-next tree并以它为基础来提交驱动程序。

那这样是不是意味着Greg的linux staging tree已经没用了呢?我在提交驱动的时候也有这样的疑问,因此特意写信向Greg求证。Greg的回复说,如果我们要把新增的driver提交给他本人处理,还是可以继续基于linux staging tree来做patch;如果我们的工作不止是开发staging driver,比如还在为其他内核代码开发补丁,那么基于linux-next tree来制作patch也是可以的。



附:

Linux-next tree: 

git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

http://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

Linux-staging tree:

git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git

http://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git

这里需要注意的是,git协议的端口号是9418,因为很多公司的防火墙只会开放80端口,所以clone代码仓库时如果git协议超时,不妨试试http协议。

ref:

http://www.cnblogs.com/wwang/archive/2011/03/08/1970432.html

####################################################################################################################################





作者:wwang
出处:http://www.cnblogs.com/wwang
本文采用知识共享署名-非商业性使用-相同方式共享 2.5 中国大陆许可协议进行许可,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。

--------懒人评论(请勿重复点击)--------


####################################################################################################################################

madeby: Franklin @ QQ or [email protected]





你可能感兴趣的:(【linux 001】【利用staging Driver】【001】wifi AR6000 驱动移植引发的 staging 的问题)