Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2353386
  • 博文数量: 141
  • 博客积分: 3552
  • 博客等级: 中校
  • 技术积分: 4148
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-15 14:39
个人简介

熟悉Linux下程序设计及各种应用程序 熟悉C Language 熟悉Glusterfs、FFmpeg、CDN 系统设计,计算机图形系统设计、分布式程序设计 目前主要研究方向:流媒体

文章分类

全部博文(141)

分类: LINUX

2009-11-05 22:56:37

文件:compat-wireless-2.6.32-rc6.tar.bz2
大小:1946KB
下载:下载

git pull了一下最新的代码,然后make modules_install install以后,重启系统以后发现无线网卡使用不了,这个时候就需要解决问题



首先下载了一个压缩包,编译的时候,在/drivers/net/wireless/ipw2x00/ipw2100.c的6060行,遇到了没有成员的问题,于是将该文件copy到linux-2.6源代码目录下,然后建立一下源代码tags表,接着就用vim逐级查进去


6024 /* Look into using netdev destructor to shutdown ieee80211? */
6025
6026 static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6027 void __iomem * base_addr,
6028 unsigned long mem_start,
6029 unsigned long mem_len)
6030 {
6031 struct ipw2100_priv *priv;
6032 struct net_device *dev;
6033
6034 dev = alloc_ieee80211(sizeof(struct ipw2100_priv), 0);
6035 if (!dev)
6036 return NULL;
6037 priv = libipw_priv(dev);
6038 priv->ieee = netdev_priv(dev);
6039 priv->pci_dev = pci_dev;
6040 priv->net_dev = dev;
6041
6042 priv->ieee->hard_start_xmit = ipw2100_tx;
6043 priv->ieee->set_security = shim__set_security;
6044
6045 priv->ieee->perfect_rssi = -20;
6046 priv->ieee->worst_rssi = -85;
6047
6048 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
6049 dev->netdev_ops = &ipw2100_netdev_ops;
6050 #else
6051 dev->open = ipw2100_open;
6052 dev->stop = ipw2100_close;
6053 dev->init = ipw2100_net_init;
6054 dev->tx_timeout = ipw2100_tx_timeout;
6055 dev->set_mac_address = ipw2100_set_address;
6056 #endif
6057
6058 dev->ethtool_ops = &ipw2100_ethtool_ops;
6059 dev->wireless_handlers = &ipw2100_wx_handler_def;
6060 // modify by ChinaUnix T-Bagwell

6061 // priv->wireless_data.ieee80211 = (struct ieee80211_device *) priv->ieee;

6062 dev->wireless_data = &priv->wireless_data;
6063 dev->watchdog_timeo = 3 * HZ;
6064 dev->irq = 0;
6065
6066 dev->base_addr = (unsigned long)base_addr;
6067 dev->mem_start = mem_start;
6068 dev->mem_end = dev->mem_start + mem_len - 1;
6069
6070 /* NOTE: We don't use the wireless_handlers hook
6071 * in dev as the system will start throwing WX requests
6072 * to us before we're actually initialized and it just
6073 * ends up causing problems. So, we just handle
6074 * the WX extensions through the ipw2100_ioctl interface */

6075
6076 /* memset() puts everything to 0, so we only have explicitly set
6077 * those values that need to be something else */

6078
6079 /* If power management is turned on, default to AUTO mode */
6080 priv->power_mode = IPW_POWER_AUTO;
6081

其中6061行代码以前没有被注释掉,我这里给注释掉了,为了能够暂时使用,所以这里注掉了,以后遇到问题再说,没问题就先放着
为什么我注掉他呢?跟进去看一下

首先看priv这个结构

490 struct ipw2100_priv {
 491
 492 int stop_hang_check; /* Set 1 when shutting down to kill hang_check */
 493 int stop_rf_kill; /* Set 1 when shutting down to kill rf_kill */
 494
 495 struct libipw_device *ieee;
 496 unsigned long status;
 497 unsigned long config;
 498 unsigned long capability;
 499
 500 /* Statistics */
 501 int resets;
 502 int reset_backoff;
 503
 504 /* Context */
 505 u8 essid[IW_ESSID_MAX_SIZE];
 506 u8 essid_len;
 507 u8 bssid[ETH_ALEN];
 508 u8 channel;
 509 int last_mode;
 510
 511 unsigned long connect_start;
 512 unsigned long last_reset;
 513
 514 u32 channel_mask;
 515 u32 fatal_error;
 516 u32 fatal_errors[IPW2100_ERROR_QUEUE];
 517 u32 fatal_index;
 518 int eeprom_version;
 519 int firmware_version;
 520 unsigned long hw_features;
 521 int hangs;
 522 u32 last_rtc;
 523 int dump_raw; /* 1 to dump raw bytes in /sys/.../memory */
 524 u8 *snapshot[0x30];
 525
 526 u8 mandatory_bssid_mac[ETH_ALEN];
 527 u8 mac_addr[ETH_ALEN];
 528
 529 int power_mode;
 530
 531 int messages_sent;
 532
 533 int short_retry_limit;
 534 int long_retry_limit;
 535
 536 u32 rts_threshold;
 537 u32 frag_threshold;
 538
 539 int in_isr;
 540
 541 u32 tx_rates;
 542 int tx_power;
 543 u32 beacon_interval;
 544
 545 char nick[IW_ESSID_MAX_SIZE + 1];
 546
 547 struct ipw2100_status_queue status_queue;
 548
 549 struct statistic txq_stat;
 550 struct statistic rxq_stat;
 551 struct ipw2100_bd_queue rx_queue;
 552 struct ipw2100_bd_queue tx_queue;
 553 struct ipw2100_rx_packet *rx_buffers;
 554
 555 struct statistic fw_pend_stat;
 556 struct list_head fw_pend_list;
 557
 558 struct statistic msg_free_stat;
 559 struct statistic msg_pend_stat;
 560 struct list_head msg_free_list;
 561 struct list_head msg_pend_list;
 562 struct ipw2100_tx_packet *msg_buffers;
 563
 564 struct statistic tx_free_stat;
 565 struct statistic tx_pend_stat;
 566 struct list_head tx_free_list;
 567 struct list_head tx_pend_list;
 568 struct ipw2100_tx_packet *tx_buffers;
 569
 570 struct ipw2100_ordinals ordinals;
 571
 572 struct pci_dev *pci_dev;
 573
 574 struct proc_dir_entry *dir_dev;
 575
 576 struct net_device *net_dev;
 577 struct iw_statistics wstats;
 578
 579 struct iw_public_data wireless_data;
 580
 581 struct tasklet_struct irq_tasklet;
 582
 583 struct workqueue_struct *workqueue;
 584 struct delayed_work reset_work;
 585 struct delayed_work security_work;
 586 struct delayed_work wx_event_work;
 587 struct delayed_work hang_check;
 588 struct delayed_work rf_kill;
 589 struct work_struct scan_event_now;
 590 struct delayed_work scan_event_later;
 591
 592 int user_requested_scan;
 593
 594 /* Track time in suspend */
 595 unsigned long suspend_at;
 596 unsigned long suspend_time;
 597
 598 u32 interrupts;
 599 int tx_interrupts;
 600 int rx_interrupts;
 601 int inta_other;
 602
 603 spinlock_t low_lock;
 604 struct mutex action_mutex;
 605 struct mutex adapter_mutex;
 606
 607 wait_queue_head_t wait_command_queue;
 608 };

里面包含下一个结构
但是这个wireless结构里就没有ieee80211成员了

421 struct iw_public_data {
422 /* Driver enhanced spy support */
423 struct iw_spy_data * spy_data;
424 /* Legacy structure managed by the ipw2x00-specific IEEE 802.11 layer */
425 struct libipw_device * libipw;
426 };
427


但是这个iw_public_data在我的linux-2.6的源代码里,我实在不忍心修改,呵呵,就改一下驱动的代码吧。

[root@localhost linux-2.6]# lspci
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:03.0 Communication controller: Intel Corporation Mobile 4 Series Chipset MEI Controller (rev 07)
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M-E LPC Interface Controller (rev 03)
00:1f.2 IDE interface: Intel Corporation ICH9M/M-E 2 port SATA IDE Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
03:00.0 Network controller: Intel Corporation PRO/Wireless 5100 AGN [Shiloh] Network Connection
[root@localhost linux-2.6]#


阅读(5566) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~