最新进展:
如果将如下代码打开:
static struct s3c_irq_data init_eint[32] = {
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
#if 1
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT4 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT5 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT6 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 4 }, /* EINT7 */
#else
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
{ .type = S3C_IRQTYPE_NONE, }, /* reserved */
#endif
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT8 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT9 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT10 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT11 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT12 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT13 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT14 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT15 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT16 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT17 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT18 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT19 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT20 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT21 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT22 */
{ .type = S3C_IRQTYPE_EINT, .parent_irq = 5 }, /* EINT23 */
};
(1)也就是说,如果这里是#if 1,dm9000.c中的中断就正常,网络就是正常的,但是加载key.ko就会出现中断注册失败
[func:request_irq_for_gpio][line:282] request_irq failed, ret:-22!
(2)如果这里是#if 0,那么dm9000网卡就不可以正常使用,但是key.ko中的中断注册就是正常的
为什么呢?
(3)另外,查看系统文件,也没有发现注册20号中断:
[\u@\h \W]# cat /proc/interrupts
#####[func:irq_to_desc][line:279], [irq==20] NR_IRQS:111
#####[func:irq_to_desc][line:279], [irq==20] NR_IRQS:111
CPU0
24: 0 s3c 8 s3c2410-rtc tick
29: 20193 s3c 13 samsung_time_irq
32: 0 s3c 16 s3c2410-lcd
37: 0 s3c 21 s3c-mci
42: 0 s3c 26 ohci_hcd:usb1
43: 0 s3c 27 s3c2440-i2c.0
46: 0 s3c 30 s3c2410-rtc alarm
55: 0 s3c-ext 7 eth0
64: 0 s3c-ext 16 s3c-mci
74: 30 s3c-level 0 s3c2440-uart
75: 170 s3c-level 1 s3c2440-uart
87: 0 s3c-level 13 s3c2410-wdt
Err: 0
[\u@\h \W]#
为什么呢?
我觉得,主要还是要看如下打印是哪里调下来的,这里是非常重要的:
#####[func:irq_to_desc][line:279], [irq==20] NR_IRQS:111