acx-mac80211 non construit après upgrade kernel
Erreur de build dans /var/log/boot.log
Système et matériels / Installation et configuration

magnux77 Membre non connecté
-
- Voir le profil du membre magnux77
- Inscrit le : 21/09/2009
- Groupes :
-
Membre d'Honneur
Reprise du message précédent
Ouh la la ! Tu m'impressionnes ! Le prochain de fork de Mageia, c'est toi qui le lance ?......depuis Mandrake 7
Membre de l'April - « promouvoir et défendre le Logiciel Libre»
Soutien Framasoft - « Changer le monde, un octet à la fois»
Config n°1 : cpu=AMD64x6 mem=16G SSD=64G HDD=1T OS=Mageia8-64 DE=Xfce, Config n°2 : Dell Latitude E6410 SSD=120G OS=Mageia8 DE=Xfce, Config n°3 : ThinkpadR40 SSD=32G OS=[Manjaro, Parabola, Mageia6] DE=Xfce, Config n°4 : EeePC901 SSD=20Gb, OS=[SliTaz5/Lxde, Mageia8/Xfce]
Membre de l'April - « promouvoir et défendre le Logiciel Libre»
Soutien Framasoft - « Changer le monde, un octet à la fois»
Config n°1 : cpu=AMD64x6 mem=16G SSD=64G HDD=1T OS=Mageia8-64 DE=Xfce, Config n°2 : Dell Latitude E6410 SSD=120G OS=Mageia8 DE=Xfce, Config n°3 : ThinkpadR40 SSD=32G OS=[Manjaro, Parabola, Mageia6] DE=Xfce, Config n°4 : EeePC901 SSD=20Gb, OS=[SliTaz5/Lxde, Mageia8/Xfce]

alp1 Membre non connecté
-
- Voir le profil du membre alp1
- Inscrit le : 26/06/2012
- Groupes :
http://www.mageialinux-online.org/forum/topic-18541+cartes-wifi-a-chipset-texas-instrument-acx100-111-et-tnetw1450.php

kalagani Membre non connecté
-
- Voir le profil du membre kalagani
- Inscrit le : 10/03/2012
- Groupes :
magnux77 :
merci, mais tu me surestimes, je n'ai ajouté que 3Ouh la la ! Tu m'impressionnes ! Le prochain de fork de Mageia, c'est toi qui le lance ?...
Code BASH :
dont les 2 premiers ne font que sauter la ligne de code qui aboutit à l'erreur.#if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(4, 2, 0)
...
Quand j'ai vraiment voulu introduire une ligne modifiée, ici 1ère ligne
Code BASH :
au lieu dehw->flags[0] |= IEEE80211_HW_SIGNAL_UNSPEC;
Code BASH :
autant le build manuel s'est bien passé,hw->flags |= IEEE80211_HW_SIGNAL_UNSPEC;
autant en réinitialisant l'arbre dkms pour complilation au reboot, j'ai eu un magnifique blocage de Mageia5 en kernel 4.4.13 avec affichage d'une trace impliquant le module acx,
laquelle trace se terminant par
"Fixing recursive fault but reboot is needed".
La modif pourtant ne modifiant juste que l'accès au champ (flags) d'une structure (ieee80211_hw) modifié dans le fichier mac80211.h venu avec le nouveau kernel.
Champ passé d'un simple type u32 (u32 flags;) à un type tableau (unsigned long flags[BITS_TO_LONGS(NUM_IEEE80211_HW_FLAGS);])
Il semblerait que ce changement de type ne soit pas aussi anodin que cela, en effet ce u32 utilisé semble t-il en champ de bits (rempli par une série de type enum initialisé en décalage de bits)
Caché :
se voit maintenant rempli par le même enum cette fois initialisé par le compilateur non plus en champ de bits mais en valeur entière...Code BASH :
enum ieee80211_hw_flags { IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, IEEE80211_HW_SIGNAL_DBM = 1<<6, IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC = 1<<7, IEEE80211_HW_SPECTRUM_MGMT = 1<<8, IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, IEEE80211_HW_SUPPORTS_PS = 1<<10, IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11, IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, IEEE80211_HW_MFP_CAPABLE = 1<<13, IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, IEEE80211_HW_NO_AUTO_VIF = 1<<15, IEEE80211_HW_SW_CRYPTO_CONTROL = 1<<16, /* free slots */ IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, IEEE80211_HW_CONNECTION_MONITOR = 1<<19, IEEE80211_HW_QUEUE_CONTROL = 1<<20, IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, IEEE80211_HW_AP_LINK_PS = 1<<22, IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, IEEE80211_HW_SUPPORTS_RC_TABLE = 1<<24, IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, IEEE80211_HW_CHANCTX_STA_CSA = 1<<28, IEEE80211_HW_SUPPORTS_CLONED_SKBS = 1<<29, IEEE80211_SINGLE_HW_SCAN_ON_ALL_BANDS = 1<<30, };
Caché :
Depuis je suis revenu en arrière en continuant à sauter la ligne de code...Code BASH :
enum ieee80211_hw_flags { IEEE80211_HW_HAS_RATE_CONTROL, IEEE80211_HW_RX_INCLUDES_FCS, IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING, IEEE80211_HW_SIGNAL_UNSPEC, IEEE80211_HW_SIGNAL_DBM, IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC, IEEE80211_HW_SPECTRUM_MGMT, IEEE80211_HW_AMPDU_AGGREGATION, IEEE80211_HW_SUPPORTS_PS, IEEE80211_HW_PS_NULLFUNC_STACK, IEEE80211_HW_SUPPORTS_DYNAMIC_PS, IEEE80211_HW_MFP_CAPABLE, IEEE80211_HW_WANT_MONITOR_VIF, IEEE80211_HW_NO_AUTO_VIF, IEEE80211_HW_SW_CRYPTO_CONTROL, IEEE80211_HW_SUPPORT_FAST_XMIT, IEEE80211_HW_REPORTS_TX_ACK_STATUS, IEEE80211_HW_CONNECTION_MONITOR, IEEE80211_HW_QUEUE_CONTROL, IEEE80211_HW_SUPPORTS_PER_STA_GTK, IEEE80211_HW_AP_LINK_PS, IEEE80211_HW_TX_AMPDU_SETUP_IN_HW, IEEE80211_HW_SUPPORTS_RC_TABLE, IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF, IEEE80211_HW_TIMING_BEACON_ONLY, IEEE80211_HW_SUPPORTS_HT_CCK_RATES, IEEE80211_HW_CHANCTX_STA_CSA, IEEE80211_HW_SUPPORTS_CLONED_SKBS, IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS, IEEE80211_HW_TDLS_WIDER_BW, IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU, IEEE80211_HW_BEACON_TX_STATUS, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS };
alp1 :
Penser à compléter le post épinglé:
http://www.mageialinux-online.org/forum/topic-18541-1+cartes-wifi-a-chipset-texas-instrument-acx100-111-et-tnetw1450.php#m214624
http://www.mageialinux-online.org/forum/topic-18541-1+cartes-wifi-a-chipset-texas-instrument-acx100-111-et-tnetw1450.php#m214624
J'y pensais en effet :+)...et viens de le faire...post #m214624
Édité par kalagani Le 27/06/2016 à 12h12
PC1: HPxw9400 Mageia8 Xfce/Cinnamon (ex Plasma car "Freeze")
PC2: Dell Studio 540 Core2 Quad Q8300 en double boot: XPsp3/Mageia8 64bits Plasma
PC2: Dell Studio 540 Core2 Quad Q8300 en double boot: XPsp3/Mageia8 64bits Plasma

kalagani Membre non connecté
-
- Voir le profil du membre kalagani
- Inscrit le : 10/03/2012
- Groupes :
kalagani :
...
La modif pourtant ne modifiant juste que l'accès au champ (flags) d'une structure (ieee80211_hw) modifié dans le fichier mac80211.h venu avec le nouveau kernel.
Champ passé d'un simple type u32 (u32 flags;) à un type tableau (unsigned long flags[BITS_TO_LONGS(NUM_IEEE80211_HW_FLAGS);])
Il semblerait que ce changement de type ne soit pas aussi anodin que cela, en effet ce u32 utilisé semble t-il en champ de bits (rempli par une série de type enum initialisé en décalage de bits)
La modif pourtant ne modifiant juste que l'accès au champ (flags) d'une structure (ieee80211_hw) modifié dans le fichier mac80211.h venu avec le nouveau kernel.
Champ passé d'un simple type u32 (u32 flags;) à un type tableau (unsigned long flags[BITS_TO_LONGS(NUM_IEEE80211_HW_FLAGS);])
Il semblerait que ce changement de type ne soit pas aussi anodin que cela, en effet ce u32 utilisé semble t-il en champ de bits (rempli par une série de type enum initialisé en décalage de bits)
Caché :
Depuis je suis revenu en arrière en continuant à sauter la ligne de code..Code BASH :
se voit maintenant rempli par le même enum cette fois initialisé par le compilateur non plus en champ de bits mais en valeur entière...[hide]enum ieee80211_hw_flags { IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, IEEE80211_HW_SIGNAL_DBM = 1<<6, IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC = 1<<7, IEEE80211_HW_SPECTRUM_MGMT = 1<<8, IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, IEEE80211_HW_SUPPORTS_PS = 1<<10, IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11, IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, IEEE80211_HW_MFP_CAPABLE = 1<<13, IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, IEEE80211_HW_NO_AUTO_VIF = 1<<15, IEEE80211_HW_SW_CRYPTO_CONTROL = 1<<16, /* free slots */ IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, IEEE80211_HW_CONNECTION_MONITOR = 1<<19, IEEE80211_HW_QUEUE_CONTROL = 1<<20, IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, IEEE80211_HW_AP_LINK_PS = 1<<22, IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, IEEE80211_HW_SUPPORTS_RC_TABLE = 1<<24, IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, IEEE80211_HW_CHANCTX_STA_CSA = 1<<28, IEEE80211_HW_SUPPORTS_CLONED_SKBS = 1<<29, IEEE80211_SINGLE_HW_SCAN_ON_ALL_BANDS = 1<<30, };
Code BASH :
enum ieee80211_hw_flags { IEEE80211_HW_HAS_RATE_CONTROL, IEEE80211_HW_RX_INCLUDES_FCS, IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING, IEEE80211_HW_SIGNAL_UNSPEC, IEEE80211_HW_SIGNAL_DBM, IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC, IEEE80211_HW_SPECTRUM_MGMT, IEEE80211_HW_AMPDU_AGGREGATION, IEEE80211_HW_SUPPORTS_PS, IEEE80211_HW_PS_NULLFUNC_STACK, IEEE80211_HW_SUPPORTS_DYNAMIC_PS, IEEE80211_HW_MFP_CAPABLE, IEEE80211_HW_WANT_MONITOR_VIF, IEEE80211_HW_NO_AUTO_VIF, IEEE80211_HW_SW_CRYPTO_CONTROL, IEEE80211_HW_SUPPORT_FAST_XMIT, IEEE80211_HW_REPORTS_TX_ACK_STATUS, IEEE80211_HW_CONNECTION_MONITOR, IEEE80211_HW_QUEUE_CONTROL, IEEE80211_HW_SUPPORTS_PER_STA_GTK, IEEE80211_HW_AP_LINK_PS, IEEE80211_HW_TX_AMPDU_SETUP_IN_HW, IEEE80211_HW_SUPPORTS_RC_TABLE, IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF, IEEE80211_HW_TIMING_BEACON_ONLY, IEEE80211_HW_SUPPORTS_HT_CCK_RATES, IEEE80211_HW_CHANCTX_STA_CSA, IEEE80211_HW_SUPPORTS_CLONED_SKBS, IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS, IEEE80211_HW_TDLS_WIDER_BW, IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU, IEEE80211_HW_BEACON_TX_STATUS, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS };
N'étant pas satisfait de ce retour arrière, j'ai simplement en cas de version kernel >= 4.2 réinitialisé les enum à la valeur du kernel précédent, ceci avant d'allouer cet enum au champ flags[0] évitant ainsi l'échec à l'initialisation du module.
Pour infos, ci-dessous, avant modif, l'erreur qui survient juste après l'écriture dans le champ flags[0]
cf après les valeurs du champ flags[0] (affichées via des printk ajoutés pour test)
Caché :
Code BASH :
... Jul 5 08:08:31 HPxw9400 kernel: [ 31.110107] acx.acx_display_hardware_details: chipset TNETW1130, radio type 0x16 (Radia (RC2422?)), form factor 0x01 ((mini-)PCI / CardBus), EEPROM version 0x05, uploaded firmware 'Rev 1.2.1.34' Jul 5 08:08:31 HPxw9400 kernel: [ 31.110109] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_STATION_ID,len:6) Jul 5 08:08:31 HPxw9400 kernel: [ 31.130088] acx.acx1xx_get_station_id: Got station_id: 00:0F:B5:8C:AE:1D Jul 5 08:08:31 HPxw9400 kernel: [ 31.130097] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_CURRENT_ANTENNA,len:2) Jul 5 08:08:31 HPxw9400 kernel: [ 31.150065] acx.acx1xx_get_antenna: Got antenna[0,1]: 0x4A 0x04 Jul 5 08:08:31 HPxw9400 kernel: [ 31.150072] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_CURRENT_REG_DOMAIN,len:2) Jul 5 08:08:31 HPxw9400 kernel: [ 31.170068] acx.acx_get_reg_domain: Got regulatory domain 0x41 Jul 5 08:08:31 HPxw9400 kernel: [ 31.170073] acx.acx_get_sensitivity: don't know how to get sensitivity for radio type 0x16 Jul 5 08:08:31 HPxw9400 kernel: [ 31.170076] acx.acx_set_interrupt_mask: adev->irq_mask: before: 0 devtype:0 chiptype:2 tobe: 39157 Jul 5 08:08:31 HPxw9400 kernel: [ 31.170079] acx.acx_update_ratevector: new ratevector: 82 84 0B 0C 12 16 18 24 2C 30 48 60 6C Jul 5 08:08:31 HPxw9400 kernel: [ 31.170087] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_TX_POWER_LEVEL,len:1) Jul 5 08:08:31 HPxw9400 kernel: [ 31.190075] acx.acx1xx_get_tx_level: Got tx-power-level: 1 Jul 5 08:08:31 HPxw9400 kernel: [ 31.190081] acx.acx_update_hw_encryption: Enabling hw-encryption Jul 5 08:08:31 HPxw9400 kernel: [ 31.190084] acx.acx_interrogate: (type:ACX1xx_IE_FEATURE_CONFIG,len:8) Jul 5 08:08:31 HPxw9400 kernel: [ 31.230067] acx.acx_debugfs_add_adev: adev:ffff880311a814a0 nm:phy0 dirp:ffff880310dc89c0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.230113] acx flags[0] à l'init 0x00000000 0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.230115] acx flags[0] &= ~IEEE80211_HW_RX_INCLUDES_FCS 0x00000000 0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.230117] acx flags[0] après init 0x00000000 0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.230119] acx flags[0] |= IEEE80211_HW_SIGNAL_UNSPEC 0x00000003 11 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251148] ------------[ cut here ]------------ Jul 5 08:08:31 HPxw9400 kernel: [ 31.251193] WARNING: CPU: 0 PID: 594 at net/mac80211/rate.c:908 ieee80211_init_rate_ctrl_alg+0x1b5/0x1e0 [mac80211]() Jul 5 08:08:31 HPxw9400 kernel: [ 31.251195] Modules linked in: arc4 fuse drm acx_mac80211(O+) mac80211 cfg80211 hp_wmi sparse_keymap rfkill uas usb_storage input_leds kvm_amd kvm irqbypass snd_hda_intel snd_hda_codec nv_tco snd_hda_core snd_hwdep amd64_edac_mod psmouse edac_core serio_raw k8temp evdev shpchp forcedeth snd_pcm 8250_fintek snd_timer fjes i2c_nforce2 snd soundcore tpm_tis tpm cpufreq_ondemand cpufreq_conservative cpufreq_powersave powernow_k8 processor sch_fq_codel ipv6 autofs4 hid_generic usbhid hid ohci_pci firewire_ohci ehci_pci ehci_hcd ohci_hcd wmi usbcore firewire_core crc_itu_t sr_mod usb_common button amd74xx ide_pci_generic ide_core mptsas scsi_transport_sas mptscsih mptbase ata_generic pata_acpi pata_amd sata_nv Jul 5 08:08:31 HPxw9400 kernel: [ 31.251239] CPU: 0 PID: 594 Comm: systemd-udevd Tainted: G O 4.4.13-server-1.mga5 #1 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251240] Hardware name: Hewlett-Packard HP xw9400 Workstation/0A1Ch, BIOS 786D6 v03.01 10/12/2007 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251242] 0000000000000000 ffff88031127f9a8 ffffffff813d577e 0000000000000000 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251245] ffffffffc0596a94 ffff88031127f9e0 ffffffff810748e6 ffff880311a80700 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251247] 00000000ffffffea 0000000000000000 0000000000000000 0000000000000000 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251249] Call Trace: Jul 5 08:08:31 HPxw9400 kernel: [ 31.251255] [<ffffffff813d577e>] dump_stack+0x63/0x85 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251258] [<ffffffff810748e6>] warn_slowpath_common+0x86/0xc0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251260] [<ffffffff810749da>] warn_slowpath_null+0x1a/0x20 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251280] [<ffffffffc0548645>] ieee80211_init_rate_ctrl_alg+0x1b5/0x1e0 [mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.251299] [<ffffffffc052fea3>] ieee80211_register_hw+0x433/0xa20 [mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.251312] [<ffffffffc0501e3d>] acxpci_probe+0x38d/0x570 [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.251315] [<ffffffff81420775>] local_pci_probe+0x45/0xa0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251318] [<ffffffff81247559>] ? sysfs_do_create_link_sd.isra.2+0x69/0xb0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251321] [<ffffffff81421bfd>] pci_device_probe+0xdd/0x130 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251325] [<ffffffff8150c884>] driver_probe_device+0x224/0x4b0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251327] [<ffffffff8150cb94>] __driver_attach+0x84/0x90 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251329] [<ffffffff8150cb10>] ? driver_probe_device+0x4b0/0x4b0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251332] [<ffffffff8150a5b4>] bus_for_each_dev+0x64/0xa0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251334] [<ffffffff8150c21e>] driver_attach+0x1e/0x20 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251336] [<ffffffff8150bda1>] bus_add_driver+0x1f1/0x290 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251343] [<ffffffffc024b13b>] ? acxmem_init_module+0x61/0x61 [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.251345] [<ffffffff8150d580>] driver_register+0x60/0xe0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251347] [<ffffffff8142012c>] __pci_register_driver+0x4c/0x50 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251353] [<ffffffffc024b067>] acxpci_init_module+0x67/0x87 [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.251358] [<ffffffffc024b184>] acx_init_module+0x49/0x9d [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.251361] [<ffffffff81002123>] do_one_initcall+0xb3/0x1d0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251365] [<ffffffff811531d9>] do_init_module+0x60/0x1ce Jul 5 08:08:31 HPxw9400 kernel: [ 31.251368] [<ffffffff810f36de>] load_module+0x209e/0x25e0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251370] [<ffffffff810efad0>] ? __symbol_put+0x40/0x40 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251374] [<ffffffff81192076>] ? map_vm_area+0x36/0x50 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251376] [<ffffffff81193627>] ? __vmalloc_node_range+0x1c7/0x290 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251378] [<ffffffff810f3d39>] SYSC_init_module+0x119/0x160 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251381] [<ffffffff810f3e2e>] SyS_init_module+0xe/0x10 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251384] [<ffffffff816df1b6>] entry_SYSCALL_64_fastpath+0x16/0x75 Jul 5 08:08:31 HPxw9400 kernel: [ 31.251386] ---[ end trace d223e0b094c91000 ]--- Jul 5 08:08:31 HPxw9400 kernel: [ 31.251390] ieee80211 phy0: Failed to initialize rate control algorithm Jul 5 08:08:31 HPxw9400 kernel: [ 31.290114] acx.acxpci_probe: ieee80211_register_hw() FAILED: -22 Jul 5 08:08:31 HPxw9400 kernel: [ 31.320089] general protection fault: 0000 [#1] SMP Jul 5 08:08:31 HPxw9400 kernel: [ 31.321602] Modules linked in: arc4 fuse drm acx_mac80211(O+) mac80211 cfg80211 hp_wmi sparse_keymap rfkill uas usb_storage input_leds kvm_amd kvm irqbypass snd_hda_intel snd_hda_codec nv_tco snd_hda_core snd_hwdep amd64_edac_mod psmouse edac_core serio_raw k8temp evdev shpchp forcedeth snd_pcm 8250_fintek snd_timer fjes i2c_nforce2 snd soundcore tpm_tis tpm cpufreq_ondemand cpufreq_conservative cpufreq_powersave powernow_k8 processor sch_fq_codel ipv6 autofs4 hid_generic usbhid hid ohci_pci firewire_ohci ehci_pci ehci_hcd ohci_hcd wmi usbcore firewire_core crc_itu_t sr_mod usb_common button amd74xx ide_pci_generic ide_core mptsas scsi_transport_sas mptscsih mptbase ata_generic pata_acpi pata_amd sata_nv Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] CPU: 1 PID: 594 Comm: systemd-udevd Tainted: G W O 4.4.13-server-1.mga5 #1 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] Hardware name: Hewlett-Packard HP xw9400 Workstation/0A1Ch, BIOS 786D6 v03.01 10/12/2007 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] task: ffff8806104e8000 ti: ffff88031127c000 task.ti: ffff88031127c000 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] RIP: 0010:[<ffffffff810b7fde>] [<ffffffff810b7fde>] queued_spin_lock_slowpath+0xfe/0x170 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] RSP: 0018:ffff88031127f908 EFLAGS: 00010002 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] RAX: 0000000000003ffe RBX: ffff880611bd0a00 RCX: 0000000000080000 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] RDX: ffff88061fc17380 RSI: 2828202626219cd9 RDI: ffff880311f45da8 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] RBP: ffff88031127f908 R08: 0000000000000001 R09: 000000074ad2047c Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] R10: 00000000ffff970b R11: 0000000000000000 R12: 0000000000000001 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] R13: 0000000000000002 R14: ffff880311f45da8 R15: ffff880611bd0f90 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] FS: 00007fc133e087c0(0000) GS:ffff88061fc00000(0000) knlGS:0000000000000000 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] CR2: 00007fc209102c5a CR3: 00000003109fd000 CR4: 00000000000006e0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] Stack: Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] ffff88031127f918 ffffffff816ded27 ffff88031127f960 ffffffff8108b2bf Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] 00ffffffffffffff 0000000000000001 ffff880611bd0a00 0000000000000002 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] ffff880611bd0a70 ffff880611bd0a20 ffff88031127f9a0 ffff88031127fa08 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] Call Trace: Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff816ded27>] _raw_spin_lock_irq+0x27/0x30 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8108b2bf>] flush_workqueue_prep_pwqs+0x5f/0x1a0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8108b565>] flush_workqueue+0x165/0x5d0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8108caf3>] ? flush_work+0x23/0x150 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8108ba2b>] drain_workqueue+0x5b/0x120 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8108bb0a>] destroy_workqueue+0x1a/0x210 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffffc052f96c>] ieee80211_unregister_hw+0xec/0x120 [mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffffc0502015>] acxpci_probe+0x565/0x570 [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff81420775>] local_pci_probe+0x45/0xa0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff81247559>] ? sysfs_do_create_link_sd.isra.2+0x69/0xb0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff81421bfd>] pci_device_probe+0xdd/0x130 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8150c884>] driver_probe_device+0x224/0x4b0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8150cb94>] __driver_attach+0x84/0x90 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8150cb10>] ? driver_probe_device+0x4b0/0x4b0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8150a5b4>] bus_for_each_dev+0x64/0xa0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8150c21e>] driver_attach+0x1e/0x20 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8150bda1>] bus_add_driver+0x1f1/0x290 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffffc024b13b>] ? acxmem_init_module+0x61/0x61 [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8150d580>] driver_register+0x60/0xe0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff8142012c>] __pci_register_driver+0x4c/0x50 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffffc024b067>] acxpci_init_module+0x67/0x87 [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffffc024b184>] acx_init_module+0x49/0x9d [acx_mac80211] Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff81002123>] do_one_initcall+0xb3/0x1d0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff811531d9>] do_init_module+0x60/0x1ce Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff810f36de>] load_module+0x209e/0x25e0 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff810efad0>] ? __symbol_put+0x40/0x40 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff81192076>] ? map_vm_area+0x36/0x50 Jul 5 08:08:31 HPxw9400 kernel: [ 31.330033] [<ffffffff81193627>] ? __vmalloc_node_range+0x1c7/0x290 Jul 5 08:08:31 HPxw9400 kernel: [ 31.440067] [<ffffffff810f3d39>] SYSC_init_module+0x119/0x160 Jul 5 08:08:31 HPxw9400 kernel: [ 31.440067] [<ffffffff810f3e2e>] SyS_init_module+0xe/0x10 Jul 5 08:08:31 HPxw9400 kernel: [ 31.440067] [<ffffffff816df1b6>] entry_SYSCALL_64_fastpath+0x16/0x75 Jul 5 08:08:31 HPxw9400 kernel: [ 31.440067] Code: 87 47 02 c1 e0 10 85 c0 74 38 48 89 c6 c1 e8 12 48 c1 ee 0c 83 e8 01 83 e6 30 48 98 48 81 c6 80 73 01 00 48 03 34 c5 40 a1 d2 81 <48> 89 16 8b 42 08 85 c0 75 0d f3 90 8b 42 08 85 c0 74 f7 eb 02 Jul 5 08:08:31 HPxw9400 kernel: [ 31.440067] RIP [<ffffffff810b7fde>] queued_spin_lock_slowpath+0xfe/0x170 Jul 5 08:08:31 HPxw9400 kernel: [ 31.440067] RSP <ffff88031127f908> Jul 5 08:08:31 HPxw9400 kernel: [ 31.440067] ---[ end trace d223e0b094c91001 ]---
comparé au log sans erreur après modif:
Caché :
Code BASH :
... Jul 5 09:25:07 HPxw9400 kernel: [ 30.160078] acx.acx_display_hardware_details: chipset TNETW1130, radio type 0x16 (Radia (RC2422?)), form factor 0x01 ((mini-)PCI / CardBus), EEPROM version 0x05, uploaded firmware 'Rev 1.2.1.34' Jul 5 09:25:07 HPxw9400 kernel: [ 30.160081] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_STATION_ID,len:6) Jul 5 09:25:07 HPxw9400 kernel: [ 30.180084] acx.acx1xx_get_station_id: Got station_id: 00:0F:B5:8C:AE:1D Jul 5 09:25:07 HPxw9400 kernel: [ 30.180090] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_CURRENT_ANTENNA,len:2) Jul 5 09:25:07 HPxw9400 kernel: [ 30.200053] acx.acx1xx_get_antenna: Got antenna[0,1]: 0x4A 0x04 Jul 5 09:25:07 HPxw9400 kernel: [ 30.200055] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_CURRENT_REG_DOMAIN,len:2) Jul 5 09:25:07 HPxw9400 kernel: [ 30.220074] acx.acx_get_reg_domain: Got regulatory domain 0x41 Jul 5 09:25:07 HPxw9400 kernel: [ 30.220079] acx.acx_get_sensitivity: don't know how to get sensitivity for radio type 0x16 Jul 5 09:25:07 HPxw9400 kernel: [ 30.220082] acx.acx_set_interrupt_mask: adev->irq_mask: before: 0 devtype:0 chiptype:2 tobe: 39157 Jul 5 09:25:07 HPxw9400 kernel: [ 30.220085] acx.acx_update_ratevector: new ratevector: 82 84 0B 0C 12 16 18 24 2C 30 48 60 6C Jul 5 09:25:07 HPxw9400 kernel: [ 30.220093] acx.acx_interrogate: (type:ACX1xx_IE_DOT11_TX_POWER_LEVEL,len:1) Jul 5 09:25:07 HPxw9400 kernel: [ 30.240082] acx.acx1xx_get_tx_level: Got tx-power-level: 1 Jul 5 09:25:07 HPxw9400 kernel: [ 30.240088] acx.acx_update_hw_encryption: Enabling hw-encryption Jul 5 09:25:07 HPxw9400 kernel: [ 30.240091] acx.acx_interrogate: (type:ACX1xx_IE_FEATURE_CONFIG,len:8) Jul 5 09:25:07 HPxw9400 kernel: [ 30.280067] acx.acx_debugfs_add_adev: adev:ffff880310c154a0 nm:phy0 dirp:ffff8803136d8300 Jul 5 09:25:07 HPxw9400 kernel: [ 30.280107] acx flags[0] à l'init 0x00000000 0 Jul 5 09:25:07 HPxw9400 kernel: [ 30.280109] acx flags[0] &= ~IEEE80211_HW_RX_INCLUDES_FCS 0x00000000 0 Jul 5 09:25:07 HPxw9400 kernel: [ 30.280111] acx flags[0] après init 0x00000000 0 Jul 5 09:25:07 HPxw9400 kernel: [ 30.280113] acx flags[0] |= IEEE80211_HW_SIGNAL_UNSPEC 0x00000020 100000 Jul 5 09:25:07 HPxw9400 kernel: [ 30.308185] nvidia: module license 'NVIDIA' taints kernel. Jul 5 09:25:07 HPxw9400 kernel: [ 30.308192] Disabling lock debugging due to kernel taint Jul 5 09:25:07 HPxw9400 kernel: [ 30.329518] ACPI: PCI Interrupt Link [LXPB] enabled at IRQ 21 Jul 5 09:25:07 HPxw9400 kernel: [ 30.329538] vgaarb: device changed decodes: PCI:0000:18:00.0,olddecodes=io+mem,decodes=none:owns=io+mem Jul 5 09:25:07 HPxw9400 kernel: [ 30.330198] [drm] Initialized nvidia-drm 0.0.0 20150116 for 0000:18:00.0 on minor 0 Jul 5 09:25:07 HPxw9400 kernel: [ 30.330229] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 340.96 Sun Nov 8 22:33:28 PST 2015 Jul 5 09:25:07 HPxw9400 kernel: [ 30.357679] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht' Jul 5 09:25:07 HPxw9400 kernel: [ 30.357947] acxusb.acxusb_init_module: built with CONFIG_ACX_MAC80211_USB Jul 5 09:25:07 HPxw9400 kernel: [ 30.357953] acxusb.acxusb_init_module: USB module initialized, probing for devices... Jul 5 09:25:07 HPxw9400 kernel: [ 30.357985] usbcore: registered new interface driver acx_usb Jul 5 09:25:07 HPxw9400 kernel: [ 30.357987] acx.acxmem_init_module: built with CONFIG_ACX_MAC80211_MEM Jul 5 09:25:07 HPxw9400 kernel: [ 30.357988] acx.acxmem_init_module: compiled to use 32bit I/O access. I/O timing issues might occur, such as non-working firmware upload. Report them Jul 5 09:25:07 HPxw9400 kernel: [ 30.357989] acx.acxmem_init_module: acx: running on a little-endian CPU Jul 5 09:25:07 HPxw9400 kernel: [ 30.357989] acx: Slave-memory module initialized, waiting for cards to probe... Jul 5 09:25:07 HPxw9400 kernel: [ 30.516840] Adding 8402908k swap on /dev/sda1. Priority:-1 extents:1 across:8402908k FS Jul 5 09:25:07 HPxw9400 kernel: [ 30.548836] fuse init (API version 7.23) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564531] cfg80211: World regulatory domain updated: Jul 5 09:25:07 HPxw9400 kernel: [ 30.564539] cfg80211: DFS Master region: unset Jul 5 09:25:07 HPxw9400 kernel: [ 30.564541] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564544] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564546] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz, 92000 KHz AUTO), (N/A, 2000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564548] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564550] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564552] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564554] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564556] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.564557] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.570551] cfg80211: Regulatory domain changed to country: FR Jul 5 09:25:07 HPxw9400 kernel: [ 30.570556] cfg80211: DFS Master region: ETSI Jul 5 09:25:07 HPxw9400 kernel: [ 30.570559] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) Jul 5 09:25:07 HPxw9400 kernel: [ 30.570561] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.570564] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.570566] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) Jul 5 09:25:07 HPxw9400 kernel: [ 30.570568] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) Jul 5 09:25:07 HPxw9400 kernel: [ 30.570569] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) Jul 5 09:25:07 HPxw9400 kernel: [ 30.873732] forcedeth 0000:00:08.0 enp0s8: renamed from eth0 Jul 5 09:25:07 HPxw9400 kernel: [ 30.910168] forcedeth 0000:00:09.0 enp0s9: renamed from eth1 Jul 5 09:25:07 HPxw9400 kernel: [ 30.940464] scsi 9:0:0:0: Direct-Access Generic Flash HS-CF 5.39 PQ: 0 ANSI: 0 Jul 5 09:25:07 HPxw9400 kernel: [ 30.947690] scsi 9:0:0:1: Direct-Access Generic Flash HS-COMBO 5.39 PQ: 0 ANSI: 0 Jul 5 09:25:07 HPxw9400 kernel: [ 30.960323] acx_pci 0000:2c:09.0 wlp44s9: renamed from wlan0 ...
Le nouveau fichier main.c qui fonctionne (j'ai retiré les lignes d'affichage printk utilisées pour test)
Caché :
Code BASH :
/* * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012 * The ACX100 Open Source Project <acx100-devel@lists.sourceforge.net> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * 2016/07/05: kalagani * not official release to avoid failed build with kernel > 4.2.0 * work around with kernel version test lines 411, 441, 766 */ #include "acx_debug.h" #include <linux/etherdevice.h> #include <net/mac80211.h> #include "acx.h" #include "usb.h" #include "merge.h" #include "mem.h" #include "pci.h" #include "cmd.h" #include "ie.h" #include "utils.h" #include "cardsetting.h" #include "tx.h" #include "main.h" #include "debug.h" #include "acx_func.h" #include "boot.h" /* * General Mac-related Definitions * ================================================== */ /* We define rates without short-preamble support fo now */ static struct ieee80211_rate acx100_rates[] = { { .bitrate = 10, .hw_value = RATE100_1, }, { .bitrate = 20, .hw_value = RATE100_2, }, { .bitrate = 55, .hw_value = RATE100_5, }, { .bitrate = 110, .hw_value = RATE100_11, }, { .bitrate = 220, .hw_value = RATE100_22, }, }; struct ieee80211_rate acx111_rates[] = { { .bitrate = 10, .hw_value = RATE111_1, }, { .bitrate = 20, .hw_value = RATE111_2, }, { .bitrate = 55, .hw_value = RATE111_5, }, { .bitrate = 60, .hw_value = RATE111_6, }, { .bitrate = 90, .hw_value = RATE111_9, }, { .bitrate = 110, .hw_value = RATE111_11, }, { .bitrate = 120, .hw_value = RATE111_12, }, { .bitrate = 180, .hw_value = RATE111_18, }, { .bitrate = 240, .hw_value = RATE111_24, }, { .bitrate = 360, .hw_value = RATE111_36, }, { .bitrate = 480, .hw_value = RATE111_48, }, { .bitrate = 540, .hw_value = RATE111_54, }, }; const int acx111_rates_sizeof=ARRAY_SIZE(acx111_rates); static struct ieee80211_channel channels[] = { { .center_freq = 2412, .hw_value = 1, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2417, .hw_value = 2, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2422, .hw_value = 3, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2427, .hw_value = 4, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2432, .hw_value = 5, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2437, .hw_value = 6, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2442, .hw_value = 7, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2447, .hw_value = 8, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2452, .hw_value = 9, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2457, .hw_value = 10, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2462, .hw_value = 11, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2467, .hw_value = 12, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2472, .hw_value = 13, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2484, .hw_value = 14, .max_power = TX_CFG_MAX_DBM_POWER }, }; static struct ieee80211_supported_band acx100_band_2GHz = { .channels = channels, .n_channels = ARRAY_SIZE(channels), .bitrates = acx100_rates, .n_bitrates = ARRAY_SIZE(acx100_rates), }; static struct ieee80211_supported_band acx111_band_2GHz = { .channels = channels, .n_channels = ARRAY_SIZE(channels), .bitrates = acx111_rates, .n_bitrates = ARRAY_SIZE(acx111_rates), }; const u8 bitpos2genframe_txrate[] = { [0] = 10, /* 1 Mbit/s */ [1] = 20, /* 2 Mbit/s */ [2] = 55, /* 5*5 Mbit/s */ [3] = 0x0B, /* 6 Mbit/s */ [4] = 0x0F, /* 9 Mbit/s */ [5] = 110, /* 11 Mbit/s */ [6] = 0x0A, /* 12 Mbit/s */ [7] = 0x0E, /* 18 Mbit/s */ [8] = 220, /* 22 Mbit/s */ [9] = 0x09, /* 24 Mbit/s */ [10] = 0x0D, /* 36 Mbit/s */ [11] = 0x08, /* 48 Mbit/s */ [12] = 0x0C, /* 54 Mbit/s */ [13] = 10, /* 1 Mbit/s, should never happen */ [14] = 10, /* 1 Mbit/s, should never happen */ [15] = 10, /* 1 Mbit/s, should never happen */ }; const u8 acx_bitpos2ratebyte[] = { DOT11RATEBYTE_1, DOT11RATEBYTE_2, DOT11RATEBYTE_5_5, DOT11RATEBYTE_6_G, DOT11RATEBYTE_9_G, DOT11RATEBYTE_11, DOT11RATEBYTE_12_G, DOT11RATEBYTE_18_G, DOT11RATEBYTE_22, DOT11RATEBYTE_24_G, DOT11RATEBYTE_36_G, DOT11RATEBYTE_48_G, DOT11RATEBYTE_54_G, }; const u8 acx_bitpos2rate100[] = { [0] = RATE100_1, [1] = RATE100_2, [2] = RATE100_5, [3] = RATE100_2, /* should not happen */ [4] = RATE100_2, /* should not happen */ [5] = RATE100_11, [6] = RATE100_2, /* should not happen */ [7] = RATE100_2, /* should not happen */ [8] = RATE100_22, [9] = RATE100_2, /* should not happen */ [10] = RATE100_2, /* should not happen */ [11] = RATE100_2, /* should not happen */ [12] = RATE100_2, /* should not happen */ [13] = RATE100_2, /* should not happen */ [14] = RATE100_2, /* should not happen */ [15] = RATE100_2, /* should not happen */ }; BUILD_BUG_DECL(Rates, ARRAY_SIZE(acx_bitpos2rate100) != ARRAY_SIZE(bitpos2genframe_txrate)); static int acx_do_job_update_tim(acx_device_t *adev) { int ret; struct sk_buff *beacon; u16 tim_offset; u16 tim_length; #if CONFIG_ACX_MAC80211_VERSION > KERNEL_VERSION(2, 6, 32) beacon = ieee80211_beacon_get_tim(adev->hw, adev->vif, &tim_offset, &tim_length); #else beacon = ieee80211_beacon_get(adev->hw, adev->vif); if (!beacon) goto out; tim_offset = acx_beacon_find_tim(beacon) - beacon->data; out: #endif if (!beacon) { logf0(L_ANY, "Error: beacon==NULL"); return NOT_OK; } if (IS_ACX111(adev)) { ret = acx_set_tim_template(adev, beacon->data + tim_offset, beacon->len - tim_offset); } dev_kfree_skb(beacon); return (ret); } static int acx_recalib_radio(acx_device_t *adev) { if (IS_ACX100(adev)) { logf0(L_INIT, "acx100: Doing radio re-calibration.n"); /* On ACX100, we need to recalibrate the radio * by issuing a GETSET_TX|GETSET_RX */ /* (OK == acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_TX, NULL, 0)) && (OK == acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_RX, NULL, 0)) && */ if ((acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_TX, &adev->channel, 1) == OK) && (acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_RX, &adev->channel, 1) == OK)) return OK; return NOT_OK; } else { logf0(L_INIT, "acx111: Enabling auto radio re-calibration.n"); return(acx111_set_recalib_auto(adev, 1)); } } static void acx_after_interrupt_recalib(acx_device_t *adev) { int res; /* this helps with ACX100 at least; hopefully ACX111 also does * a recalibration here */ /* clear flag beforehand, since we want to make sure it's * cleared; then only set it again on specific * circumstances */ CLEAR_BIT(adev->after_interrupt_jobs, ACX_AFTER_IRQ_CMD_RADIO_RECALIB); /* better wait a bit between recalibrations to prevent * overheating due to torturing the card into working too long * despite high temperature (just a safety measure) */ if (adev->recalib_time_last_success && time_before(jiffies, adev->recalib_time_last_success + RECALIB_PAUSE * 60 * HZ)) { if (adev->recalib_msg_ratelimit <= 4) { logf1(L_ANY, "%s: less than " STRING(RECALIB_PAUSE) " minutes since last radio recalibration, " "not recalibrating (maybe the card is too hot?)n", wiphy_name(adev->hw->wiphy)); adev->recalib_msg_ratelimit++; if (adev->recalib_msg_ratelimit == 5) logf0(L_ANY, "disabling the above message until next recalibn"); } return; } adev->recalib_msg_ratelimit = 0; /* note that commands sometimes fail (card busy), so only * clear flag if we were fully successful */ res = acx_recalib_radio(adev); if (res == OK) { pr_info("%s: successfully recalibrated radion", wiphy_name(adev->hw->wiphy)); adev->recalib_time_last_success = jiffies; adev->recalib_failure_count = 0; } else { /* failed: resubmit, but only limited amount of times * within some time range to prevent endless loop */ adev->recalib_time_last_success = 0; /* we failed */ /* if some time passed between last attempts, then * reset failure retry counter to be able to do next * recalib attempt */ if (time_after (jiffies, adev->recalib_time_last_attempt + 5 * HZ)) adev->recalib_failure_count = 0; if (adev->recalib_failure_count < 5) { /* increment inside only, for speedup of * outside path */ adev->recalib_failure_count++; adev->recalib_time_last_attempt = jiffies; acx_schedule_task(adev, ACX_AFTER_IRQ_CMD_RADIO_RECALIB); } } } void acx_after_interrupt_task(acx_device_t *adev) { if (!test_bit(ACX_FLAG_HW_UP, &adev->flags)) return; if (!adev->after_interrupt_jobs) return; /* we see lotsa tx errors */ if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_CMD_RADIO_RECALIB) { logf0(L_DEBUG, "Schedule CMD_RADIO_RECALIBn"); acx_after_interrupt_recalib(adev); } if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_UPDATE_TIM) { log(L_IRQ, "ACX_AFTER_IRQ_UPDATE_TIMn"); acx_do_job_update_tim(adev); CLEAR_BIT(adev->after_interrupt_jobs, ACX_AFTER_IRQ_UPDATE_TIM); } /* others */ if(adev->after_interrupt_jobs) { pr_info("Jobs still to be run: 0x%02Xn", adev->after_interrupt_jobs); adev->after_interrupt_jobs = 0; } } void acx_log_irq(u16 irqtype) { pr_info("%s: got: ", __func__); if (irqtype & HOST_INT_RX_DATA) pr_info("Rx_Data,"); if (irqtype & HOST_INT_TX_COMPLETE) pr_info("Tx_Complete,"); if (irqtype & HOST_INT_TX_XFER) pr_info("Tx_Xfer,"); if (irqtype & HOST_INT_RX_COMPLETE) pr_info("Rx_Complete,"); if (irqtype & HOST_INT_DTIM) pr_info("DTIM,"); if (irqtype & HOST_INT_BEACON) pr_info("Beacon,"); if (irqtype & HOST_INT_TIMER) log(L_IRQ, "Timer,"); if (irqtype & HOST_INT_KEY_NOT_FOUND) pr_info("Key_Not_Found,"); if (irqtype & HOST_INT_IV_ICV_FAILURE) pr_info("IV_ICV_Failure (crypto),"); if (irqtype & HOST_INT_CMD_COMPLETE) pr_info("Cmd_Complete,"); if (irqtype & HOST_INT_INFO) pr_info("Info,"); if (irqtype & HOST_INT_OVERFLOW) pr_info("Overflow,"); if (irqtype & HOST_INT_PROCESS_ERROR) pr_info("Process_Error,"); if (irqtype & HOST_INT_SCAN_COMPLETE) pr_info("Scan_Complete,"); if (irqtype & HOST_INT_FCS_THRESHOLD) pr_info("FCS_Threshold,"); if (irqtype & HOST_INT_UNKNOWN) pr_info("Unknown,"); pr_info(": IRQ(s)n"); } /* * acx_schedule_task * * Schedule the call of the after_interrupt method after leaving * the interrupt context. */ void acx_schedule_task(acx_device_t *adev, unsigned int set_flag) { SET_BIT(adev->after_interrupt_jobs, set_flag); ieee80211_queue_work(adev->hw, &adev->irq_work); } /* * acx_i_timer */ void acx_timer(unsigned long address) { /* acx_device_t *adev = (acx_device_t *) address; */ FIXME(); /* We need calibration and stats gather tasks to perform here */ } struct ieee80211_hw* acx_alloc_hw(const struct ieee80211_ops *hw_ops) { acx_device_t *adev; struct ieee80211_hw *hw; hw = ieee80211_alloc_hw(sizeof(struct acx_device), hw_ops); if (!hw) { pr_err("ieee80211_alloc_hw failedn"); return hw; } adev = hw2adev(hw); memset(adev, 0, sizeof(*adev)); adev->hw = hw; pr_info("wiphy: %s", wiphy_name(adev->hw->wiphy)); return hw; } #define ACX_WATCHDOG_DELAY 1 #define ACX_SCAN_TIMEOUT 5 int acx_start_watchdog(acx_device_t *adev) { schedule_delayed_work(&adev->watchdog_work, HZ*ACX_WATCHDOG_DELAY); set_bit(ACX_FLAG_WATCHDOG_RUNNING, &adev->flags); return 0; } int acx_stop_watchdog(acx_device_t *adev) { clear_bit(ACX_FLAG_WATCHDOG_RUNNING, &adev->flags); cancel_delayed_work_sync(&adev->watchdog_work); return 0; } static void acx_watchdog_work(struct work_struct *work) { acx_device_t *adev = container_of(work, struct acx_device, watchdog_work.work); if (!test_bit(ACX_FLAG_WATCHDOG_RUNNING, &adev->flags)) return; adev->watchdog_last = jiffies; log(L_DEBUG, "n"); if (!test_bit(ACX_FLAG_HW_UP, &adev->flags)) return; /* Check ongoing scan timeout */ if (test_bit(ACX_FLAG_SCANNING, &adev->flags)) { if (jiffies - adev->scan_start > ACX_SCAN_TIMEOUT * HZ) { log(L_ANY, "Scan completion timeout: triggering hw-recoveryn"); acx_sem_lock(adev); acx_recover_hw(adev); acx_sem_unlock(adev); } } schedule_delayed_work(&adev->watchdog_work, HZ*ACX_WATCHDOG_DELAY); return; } /* Locking, queueing, etc. mechanics */ int acx_init_mechanics(acx_device_t *adev) { /* Locking */ spin_lock_init(&adev->spinlock); mutex_init(&adev->mutex); /* Irq work */ if (IS_USB(adev)) INIT_WORK(&adev->irq_work, acxusb_irq_work); else INIT_WORK(&adev->irq_work, acx_irq_work); /* Skb tx-queue from mac80211 */ INIT_WORK(&adev->tx_work, acx_tx_work); skb_queue_head_init(&adev->tx_queue); INIT_DELAYED_WORK(&adev->watchdog_work, acx_watchdog_work); /* Allocate IE cmd buffer */ adev->ie_cmd_buf_len=acx_ie_get_max_len()+4; log(L_INIT, "ie_cmd_buf_len=%dn", adev->ie_cmd_buf_len); adev->ie_cmd_buf=kmalloc(adev->ie_cmd_buf_len, GFP_KERNEL); if (!adev->ie_cmd_buf) return -1; return 0; } int acx_free_mechanics(acx_device_t *adev) { kfree(adev->ie_cmd_buf); return 0; } int acx_init_ieee80211(acx_device_t *adev, struct ieee80211_hw *hw) { #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(4, 2, 0) unsigned long IEEE80211_HW_RX_INCLUDES_FCS = 1<<1; hw->flags[0] &= ~IEEE80211_HW_RX_INCLUDES_FCS; #else hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; #endif hw->queues = 1; hw->wiphy->max_scan_ssids = 1; /* OW TODO Check if RTS/CTS threshold can be included here */ /* TODO: although in the original driver the maximum value was * 100, the OpenBSD driver assigns maximum values depending on * the type of radio transceiver (i.e. Radia, Maxim, * etc.). This value is always a positive integer which most * probably indicates the gain of the AGC in the rx path of * the chip, in dB steps (0.625 dB, for example?). The * mapping of this rssi value to dBm is still unknown, but it * can nevertheless be used as a measure of relative signal * strength. The other two values, i.e. max_signal and * max_noise, do not seem to be supported on my acx111 card * (they are always 0), although iwconfig reports them (in * dBm) when using ndiswrapper with the Windows XP driver. The * GPL-licensed part of the AVM FRITZ!WLAN USB Stick driver * sources (for the TNETW1450, though) seems to also indicate * that only the RSSI is supported. In conclusion, the * max_signal and max_noise values will not be initialised by * now, as they do not seem to be supported or how to acquire * them is still unknown. */ /* We base signal quality on winlevel approach of previous driver * TODO OW 20100615 This should into a common init code */ #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(4, 2, 0) unsigned long IEEE80211_HW_SIGNAL_UNSPEC = 1<<5; hw->flags[0] |= IEEE80211_HW_SIGNAL_UNSPEC; #else hw->flags |= IEEE80211_HW_SIGNAL_UNSPEC; #endif hw->max_signal = 100; if (IS_ACX100(adev)) { adev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &acx100_band_2GHz; } else if (IS_ACX111(adev)) adev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &acx111_band_2GHz; else { log(L_ANY, "Error: Unknown device"); return -1; } return 0; } /* * BOM Mac80211 Ops * ================================================== */ int acx_op_add_interface(struct ieee80211_hw *ieee, struct ieee80211_VIF *vif) { acx_device_t *adev = hw2adev(ieee); int err = -EOPNOTSUPP; u8 *mac_vif; char mac[MACSTR_SIZE]; int vif_type; acx_sem_lock(adev); vif_type = vif->type; adev->vif_type = vif_type; log(L_ANY, "vif_type=%04Xn", vif_type); if (vif_type == NL80211_IFTYPE_MONITOR) adev->vif_monitor++; else if (adev->vif) goto out_unlock; adev->vif = VIF_vif(vif); mac_vif = VIF_addr(vif); switch (adev->vif_type) { case NL80211_IFTYPE_AP: log(L_ANY, "NL80211_IFTYPE_APn"); adev->mode = ACX_MODE_3_AP; break; case NL80211_IFTYPE_ADHOC: log(L_ANY, "NL80211_IFTYPE_ADHOCn"); adev->mode = ACX_MODE_0_ADHOC; break; case NL80211_IFTYPE_STATION: log(L_ANY, "NL80211_IFTYPE_STATIONn"); adev->mode = ACX_MODE_2_STA; break; case NL80211_IFTYPE_MONITOR: logf0(L_ANY, "NL80211_IFTYPE_MONITORn"); break; case NL80211_IFTYPE_WDS: logf0(L_ANY, "NL80211_IFTYPE_WDS: Not implementedn"); goto out_unlock; default: logf1(L_ANY, "Unknown adev->vif_type=%dn", adev->vif_type); goto out_unlock; break; } /* Reconfigure mac-address globally, affecting all vifs */ if (!mac_is_equal(mac_vif, adev->dev_addr)) { memcpy(adev->dev_addr, mac_vif, ETH_ALEN); memcpy(adev->bssid, mac_vif, ETH_ALEN); acx1xx_set_station_id(adev, mac_vif); } acx_update_mode(adev); logf0(L_ANY, "Redoing cmd_join_bssid() after add_interfacen"); acx_cmd_join_bssid(adev, adev->bssid); pr_info("Virtual interface added (type: 0x%08X, MAC: %s)n", adev->vif_type, acx_print_mac(mac, mac_vif)); err = 0; out_unlock: acx_sem_unlock(adev); return err; } void acx_remove_interface(acx_device_t *adev, struct ieee80211_vif *vif) { if (vif->type == NL80211_IFTYPE_MONITOR) adev->vif_monitor--; else { adev->vif = NULL; } acx_set_mode(adev, ACX_MODE_OFF); } void acx_op_remove_interface(struct ieee80211_hw *hw, struct ieee80211_VIF *vif) { acx_device_t *adev = hw2adev(hw); char mac[MACSTR_SIZE]; u8 *mac_vif; acx_sem_lock(adev); mac_vif = VIF_addr(vif); acx_remove_interface(adev, VIF_vif(vif)); log(L_ANY, "Virtual interface removed: type=%d, MAC=%sn", vif->type, acx_print_mac(mac, mac_vif)); acx_sem_unlock(adev); } int acx_op_config(struct ieee80211_hw *hw, u32 changed) { acx_device_t *adev = hw2adev(hw); struct ieee80211_conf *conf = &hw->conf; int ret=0; u32 changed_not_done = changed; acx_sem_lock(adev); if (unlikely(!test_bit(ACX_FLAG_HW_UP, &adev->flags))) { ret = -EINVAL; goto out; } logf1(L_DEBUG, "changed=%08Xn", changed); /* Tx-Power power_level: requested transmit power (in dBm) */ if (changed & IEEE80211_CONF_CHANGE_POWER) { logf1(L_DEBUG, "IEEE80211_CONF_CHANGE_POWER: %dn", conf->power_level); acx1xx_set_tx_level_dbm(adev, conf->power_level); } if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { logf1(L_DEBUG, "IEEE80211_CONF_CHANGE_CHANNEL," #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) "channel->hw_value=%in", conf->chandef.chan->hw_value); acx_set_channel(adev, conf->chandef.chan->hw_value, conf->chandef.chan->center_freq); #else "channel->hw_value=%in", conf->channel->hw_value); acx_set_channel(adev, conf->channel->hw_value, conf->channel->center_freq); #endif changed_not_done &= ~IEEE80211_CONF_CHANGE_CHANNEL; } if (changed_not_done) logf1(L_DEBUG, "changed_not_done=%08Xn", changed_not_done); out: acx_sem_unlock(adev); return ret; } void acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u32 changed) { acx_device_t *adev = hw2adev(hw); int err = -ENODEV; struct sk_buff *beacon; acx_sem_lock(adev); logf1(L_DEBUG, "changed=%04Xn", changed); if (!adev->vif) goto end_sem_unlock; if (changed & BSS_CHANGED_BSSID) { MAC_COPY(adev->bssid, info->bssid); logf0(L_INIT, "Join following bssid updaten"); acx_cmd_join_bssid(adev, adev->bssid); } /* BOM BSS_CHANGED_BEACON */ if (changed & BSS_CHANGED_BEACON) { /* TODO Use ieee80211_beacon_get_tim instead */ beacon = ieee80211_beacon_get(hw, vif); if (!beacon) { pr_err("Error: BSS_CHANGED_BEACON: skb_tmp==NULL"); goto end_sem_unlock; } adev->beacon_interval = info->beacon_int; acx_set_beacon(adev, beacon); dev_kfree_skb(beacon); } err = 0; end_sem_unlock: acx_sem_unlock(adev); return; } static int acx111_set_key_type(acx_device_t *adev, acx111WEPDefaultKey_t *key, struct ieee80211_key_conf *mac80211_key, const u8 *addr) { #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) switch (mac80211_key->alg) { #else switch (mac80211_key->cipher) { #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_CCMP: #else case WLAN_CIPHER_SUITE_CCMP: #endif if (is_broadcast_ether_addr(addr)) key->type = KEY_AES_GROUP; else key->type = KEY_AES_PAIRWISE; break; default: #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(2, 6, 37) log(L_INIT, "Unknown key cipher 0x%x", mac80211_key->cipher); #endif return -EOPNOTSUPP; } return 0; } static int acx111_set_key(acx_device_t *adev, enum set_key_cmd cmd, const u8 *addr, struct ieee80211_key_conf *key) { int ret = -1; acx111WEPDefaultKey_t dk; memset(&dk, 0, sizeof(dk)); switch (cmd) { case SET_KEY: dk.action = cpu_to_le16(KEY_ADD_OR_REPLACE); break; case DISABLE_KEY: dk.action = cpu_to_le16(KEY_REMOVE); break; default: log(L_INIT, "Unsupported key cmd 0x%x", cmd); break; } ret = acx111_set_key_type(adev, &dk, key, addr); if (ret < 0) { log(L_INIT, "Set KEY type failed"); return ret; } memcpy(dk.MacAddr, addr, ETH_ALEN); dk.keySize = key->keylen; dk.defaultKeyNum = key->keyidx; /* ignored when setting default key */ dk.index = 0; memcpy(dk.key, key->key, dk.keySize); ret = acx_issue_cmd(adev, ACX1xx_CMD_WEP_MGMT, &dk, sizeof(dk)); return ret; } int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_key_conf *key) { struct acx_device *adev = hw2adev(hw); u8 algorithm; int ret=0; const u8 *addr; static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; acx_sem_lock(adev); addr = sta ? sta->addr : bcast_addr; #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(2, 6, 37) log(L_DEBUG, "cmd=%dn", cmd); log(L_DEBUG, "addr=" MACSTR, MAC(addr)); log(L_DEBUG, "key->: cipher=%08x, icv_len=%d, iv_len=%d, hw_key_idx=%d, " "flags=%02x, keyidx=%d, keylen=%dn", key->cipher, key->icv_len, key->iv_len, key->hw_key_idx, key->flags, key->keyidx, key->keylen); if (acx_debug & L_DEBUG) hexdump("key->: key", key->key, key->keylen); #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) switch (key->alg) { #else switch (key->cipher) { #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_WEP: if (key->keylen == 5) { algorithm = ACX_SEC_ALGO_WEP; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_WEP"); } else { algorithm = ACX_SEC_ALGO_WEP104; log(L_INIT, "algorithm=%i: %sn", "ACX_SEC_ALGO_WEP104"); } acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; #else case WLAN_CIPHER_SUITE_WEP40: algorithm = ACX_SEC_ALGO_WEP; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_WEP"); acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; case WLAN_CIPHER_SUITE_WEP104: algorithm = ACX_SEC_ALGO_WEP104; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_WEP104"); acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_TKIP: #else case WLAN_CIPHER_SUITE_TKIP: #endif algorithm = ACX_SEC_ALGO_TKIP; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_TKIP"); acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_CCMP: #else case WLAN_CIPHER_SUITE_CCMP: #endif algorithm = ACX_SEC_ALGO_AES; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_AES"); if(!adev->hw_encrypt_enabled){ ret=-EOPNOTSUPP; } else { acx111_set_key(adev, cmd, addr, key); ret = 0; } break; default: algorithm = ACX_SEC_ALGO_NONE; acx_set_hw_encryption_off(adev); ret = 0; break; } acx_sem_unlock(adev); return ret; } void acx_op_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, unsigned int *total_flags, u64 multicast) { acx_device_t *adev = hw2adev(hw); acx_sem_lock(adev); logf1(L_DEBUG, "1: changed_flags=0x%08x, *total_flags=0x%08xn", changed_flags, *total_flags); /* OWI TODO: Set also FIF_PROBE_REQ ? */ #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(4, 2, 0) *total_flags &= (FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL | FIF_OTHER_BSS); #else *total_flags &= (FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL | FIF_OTHER_BSS); #endif logf1(L_DEBUG, "2: *total_flags=0x%08xn", *total_flags); acx_sem_unlock(adev); } #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(3, 2, 0) int acx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) #else int acx_conf_tx(struct ieee80211_hw *hw, u16 queue, const struct ieee80211_tx_queue_params *params) #endif { acx_device_t *adev = hw2adev(hw); acx_sem_lock(adev); /* TODO */ acx_sem_unlock(adev); return 0; } int acx_op_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) { acx_device_t *adev = hw2adev(hw); acx_schedule_task(adev, ACX_AFTER_IRQ_UPDATE_TIM); return 0; } int acx_op_get_stats(struct ieee80211_hw *hw, struct ieee80211_low_level_stats *stats) { acx_device_t *adev = hw2adev(hw); acx_sem_lock(adev); memcpy(stats, &adev->ieee_stats, sizeof(*stats)); acx_sem_unlock(adev); return 0; } #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34) int acx_e_op_get_tx_stats(struct ieee80211_hw *hw, struct ieee80211_tx_queue_stats *stats) { acx_device_t *adev = hw2adev(hw); int err = -ENODEV; acx_sem_lock(adev); stats->len = 0; stats->limit = TX_CNT; stats->count = 0; acx_sem_unlock(adev); return err; } #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39) int acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) #elif CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 7, 0) void acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) #else void acx_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb) #endif { acx_device_t *adev = hw2adev(hw); skb_queue_tail(&adev->tx_queue, skb); ieee80211_queue_work(adev->hw, &adev->tx_work); if (skb_queue_len(&adev->tx_queue) >= ACX_TX_QUEUE_MAX_LENGTH) acx_stop_queue(adev->hw, NULL); #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39) return 0; #else return; #endif } int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_scan_request *req) { acx_device_t *adev = hw2adev(hw); struct sk_buff *skb; size_t ssid_len = 0; u8 *ssid = NULL; int ret=0; if (req->n_ssids) { ssid = req->ssids[0].ssid; ssid_len = req->ssids[0].ssid_len; } acx_sem_lock(adev); if (unlikely(!test_bit(ACX_FLAG_HW_UP, &adev->flags))) { ret = -EINVAL; goto out; } if (test_bit(ACX_FLAG_SCANNING, &adev->flags)) { log(L_INIT, "scan already in progressn"); ret = -EINVAL; goto out; } #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(3, 1, 0) #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 8, 0) skb = ieee80211_probereq_get(adev->hw, adev->vif, ssid, ssid_len, req->ie, req->ie_len); if (!skb) { ret = -ENOMEM; goto out; } #else skb = ieee80211_probereq_get(adev->hw, adev->vif, ssid, ssid_len, req->ie_len); if (!skb) { ret = -ENOMEM; goto out; } if (req->ie_len) memcpy(skb_put(skb, req->ie_len), req->ie, req->ie_len); #endif #else goto out; #endif ret = acx_set_probe_request_template(adev, skb->data, skb->len); dev_kfree_skb(skb); if (ret < 0) goto out; log(L_INIT, "scan startn"); set_bit(ACX_FLAG_SCANNING, &adev->flags); adev->scan_start=jiffies; ret = acx_cmd_scan(adev); if (ret < 0) { clear_bit(ACX_FLAG_SCANNING, &adev->flags); goto out; } out: acx_sem_unlock(adev); return ret; } int acx_recover_hw(acx_device_t *adev) { log(L_ANY, ""); acx_remove_interface(adev, adev->vif); acx_stop(adev); ieee80211_restart_hw(adev->hw); return 0; }
Pour le distinguer du précédent qui fonctionne aussi, j'ai changé la date au début...
Et toujours à mettre en lieu et place de l'ancien en /usr/src/acx-mac80211-git
Édité par kalagani Le 11/11/2017 à 23h33
PC1: HPxw9400 Mageia8 Xfce/Cinnamon (ex Plasma car "Freeze")
PC2: Dell Studio 540 Core2 Quad Q8300 en double boot: XPsp3/Mageia8 64bits Plasma
PC2: Dell Studio 540 Core2 Quad Q8300 en double boot: XPsp3/Mageia8 64bits Plasma

kalagani Membre non connecté
-
- Voir le profil du membre kalagani
- Inscrit le : 10/03/2012
- Groupes :
suite à nouvelle rupture d'interface depuis le kernel 4.7 comme décrit ici
nouveaux fichiers à mettre en lieu et place des anciens en /usr/src/acx-mac80211-git
main.c
Caché :
Code BASH :
/* * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2012 * The ACX100 Open Source Project <acx100-devel@lists.sourceforge.net> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * 2016/07/05: kalagani * not official release to avoid failed build with kernel > 4.2.0 * work around with kernel version test lines 411, 441, 766 * 2017/11/13: kalagani * not official release to avoid failed build with kernel > 4.7.0 */ #include "acx_debug.h" #include <linux/etherdevice.h> #include <net/mac80211.h> #include "acx.h" #include "usb.h" #include "merge.h" #include "mem.h" #include "pci.h" #include "cmd.h" #include "ie.h" #include "utils.h" #include "cardsetting.h" #include "tx.h" #include "main.h" #include "debug.h" #include "acx_func.h" #include "boot.h" /* * General Mac-related Definitions * ================================================== */ /* We define rates without short-preamble support fo now */ static struct ieee80211_rate acx100_rates[] = { { .bitrate = 10, .hw_value = RATE100_1, }, { .bitrate = 20, .hw_value = RATE100_2, }, { .bitrate = 55, .hw_value = RATE100_5, }, { .bitrate = 110, .hw_value = RATE100_11, }, { .bitrate = 220, .hw_value = RATE100_22, }, }; struct ieee80211_rate acx111_rates[] = { { .bitrate = 10, .hw_value = RATE111_1, }, { .bitrate = 20, .hw_value = RATE111_2, }, { .bitrate = 55, .hw_value = RATE111_5, }, { .bitrate = 60, .hw_value = RATE111_6, }, { .bitrate = 90, .hw_value = RATE111_9, }, { .bitrate = 110, .hw_value = RATE111_11, }, { .bitrate = 120, .hw_value = RATE111_12, }, { .bitrate = 180, .hw_value = RATE111_18, }, { .bitrate = 240, .hw_value = RATE111_24, }, { .bitrate = 360, .hw_value = RATE111_36, }, { .bitrate = 480, .hw_value = RATE111_48, }, { .bitrate = 540, .hw_value = RATE111_54, }, }; const int acx111_rates_sizeof=ARRAY_SIZE(acx111_rates); static struct ieee80211_channel channels[] = { { .center_freq = 2412, .hw_value = 1, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2417, .hw_value = 2, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2422, .hw_value = 3, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2427, .hw_value = 4, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2432, .hw_value = 5, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2437, .hw_value = 6, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2442, .hw_value = 7, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2447, .hw_value = 8, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2452, .hw_value = 9, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2457, .hw_value = 10, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2462, .hw_value = 11, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2467, .hw_value = 12, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2472, .hw_value = 13, .max_power = TX_CFG_MAX_DBM_POWER }, { .center_freq = 2484, .hw_value = 14, .max_power = TX_CFG_MAX_DBM_POWER }, }; static struct ieee80211_supported_band acx100_band_2GHz = { .channels = channels, .n_channels = ARRAY_SIZE(channels), .bitrates = acx100_rates, .n_bitrates = ARRAY_SIZE(acx100_rates), }; static struct ieee80211_supported_band acx111_band_2GHz = { .channels = channels, .n_channels = ARRAY_SIZE(channels), .bitrates = acx111_rates, .n_bitrates = ARRAY_SIZE(acx111_rates), }; const u8 bitpos2genframe_txrate[] = { [0] = 10, /* 1 Mbit/s */ [1] = 20, /* 2 Mbit/s */ [2] = 55, /* 5*5 Mbit/s */ [3] = 0x0B, /* 6 Mbit/s */ [4] = 0x0F, /* 9 Mbit/s */ [5] = 110, /* 11 Mbit/s */ [6] = 0x0A, /* 12 Mbit/s */ [7] = 0x0E, /* 18 Mbit/s */ [8] = 220, /* 22 Mbit/s */ [9] = 0x09, /* 24 Mbit/s */ [10] = 0x0D, /* 36 Mbit/s */ [11] = 0x08, /* 48 Mbit/s */ [12] = 0x0C, /* 54 Mbit/s */ [13] = 10, /* 1 Mbit/s, should never happen */ [14] = 10, /* 1 Mbit/s, should never happen */ [15] = 10, /* 1 Mbit/s, should never happen */ }; const u8 acx_bitpos2ratebyte[] = { DOT11RATEBYTE_1, DOT11RATEBYTE_2, DOT11RATEBYTE_5_5, DOT11RATEBYTE_6_G, DOT11RATEBYTE_9_G, DOT11RATEBYTE_11, DOT11RATEBYTE_12_G, DOT11RATEBYTE_18_G, DOT11RATEBYTE_22, DOT11RATEBYTE_24_G, DOT11RATEBYTE_36_G, DOT11RATEBYTE_48_G, DOT11RATEBYTE_54_G, }; const u8 acx_bitpos2rate100[] = { [0] = RATE100_1, [1] = RATE100_2, [2] = RATE100_5, [3] = RATE100_2, /* should not happen */ [4] = RATE100_2, /* should not happen */ [5] = RATE100_11, [6] = RATE100_2, /* should not happen */ [7] = RATE100_2, /* should not happen */ [8] = RATE100_22, [9] = RATE100_2, /* should not happen */ [10] = RATE100_2, /* should not happen */ [11] = RATE100_2, /* should not happen */ [12] = RATE100_2, /* should not happen */ [13] = RATE100_2, /* should not happen */ [14] = RATE100_2, /* should not happen */ [15] = RATE100_2, /* should not happen */ }; BUILD_BUG_DECL(Rates, ARRAY_SIZE(acx_bitpos2rate100) != ARRAY_SIZE(bitpos2genframe_txrate)); static int acx_do_job_update_tim(acx_device_t *adev) { int ret; struct sk_buff *beacon; u16 tim_offset; u16 tim_length; #if CONFIG_ACX_MAC80211_VERSION > KERNEL_VERSION(2, 6, 32) beacon = ieee80211_beacon_get_tim(adev->hw, adev->vif, &tim_offset, &tim_length); #else beacon = ieee80211_beacon_get(adev->hw, adev->vif); if (!beacon) goto out; tim_offset = acx_beacon_find_tim(beacon) - beacon->data; out: #endif if (!beacon) { logf0(L_ANY, "Error: beacon==NULL"); return NOT_OK; } if (IS_ACX111(adev)) { ret = acx_set_tim_template(adev, beacon->data + tim_offset, beacon->len - tim_offset); } dev_kfree_skb(beacon); return (ret); } static int acx_recalib_radio(acx_device_t *adev) { if (IS_ACX100(adev)) { logf0(L_INIT, "acx100: Doing radio re-calibration.n"); /* On ACX100, we need to recalibrate the radio * by issuing a GETSET_TX|GETSET_RX */ /* (OK == acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_TX, NULL, 0)) && (OK == acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_RX, NULL, 0)) && */ if ((acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_TX, &adev->channel, 1) == OK) && (acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_RX, &adev->channel, 1) == OK)) return OK; return NOT_OK; } else { logf0(L_INIT, "acx111: Enabling auto radio re-calibration.n"); return(acx111_set_recalib_auto(adev, 1)); } } static void acx_after_interrupt_recalib(acx_device_t *adev) { int res; /* this helps with ACX100 at least; hopefully ACX111 also does * a recalibration here */ /* clear flag beforehand, since we want to make sure it's * cleared; then only set it again on specific * circumstances */ CLEAR_BIT(adev->after_interrupt_jobs, ACX_AFTER_IRQ_CMD_RADIO_RECALIB); /* better wait a bit between recalibrations to prevent * overheating due to torturing the card into working too long * despite high temperature (just a safety measure) */ if (adev->recalib_time_last_success && time_before(jiffies, adev->recalib_time_last_success + RECALIB_PAUSE * 60 * HZ)) { if (adev->recalib_msg_ratelimit <= 4) { logf1(L_ANY, "%s: less than " STRING(RECALIB_PAUSE) " minutes since last radio recalibration, " "not recalibrating (maybe the card is too hot?)n", wiphy_name(adev->hw->wiphy)); adev->recalib_msg_ratelimit++; if (adev->recalib_msg_ratelimit == 5) logf0(L_ANY, "disabling the above message until next recalibn"); } return; } adev->recalib_msg_ratelimit = 0; /* note that commands sometimes fail (card busy), so only * clear flag if we were fully successful */ res = acx_recalib_radio(adev); if (res == OK) { pr_info("%s: successfully recalibrated radion", wiphy_name(adev->hw->wiphy)); adev->recalib_time_last_success = jiffies; adev->recalib_failure_count = 0; } else { /* failed: resubmit, but only limited amount of times * within some time range to prevent endless loop */ adev->recalib_time_last_success = 0; /* we failed */ /* if some time passed between last attempts, then * reset failure retry counter to be able to do next * recalib attempt */ if (time_after (jiffies, adev->recalib_time_last_attempt + 5 * HZ)) adev->recalib_failure_count = 0; if (adev->recalib_failure_count < 5) { /* increment inside only, for speedup of * outside path */ adev->recalib_failure_count++; adev->recalib_time_last_attempt = jiffies; acx_schedule_task(adev, ACX_AFTER_IRQ_CMD_RADIO_RECALIB); } } } void acx_after_interrupt_task(acx_device_t *adev) { if (!test_bit(ACX_FLAG_HW_UP, &adev->flags)) return; if (!adev->after_interrupt_jobs) return; /* we see lotsa tx errors */ if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_CMD_RADIO_RECALIB) { logf0(L_DEBUG, "Schedule CMD_RADIO_RECALIBn"); acx_after_interrupt_recalib(adev); } if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_UPDATE_TIM) { log(L_IRQ, "ACX_AFTER_IRQ_UPDATE_TIMn"); acx_do_job_update_tim(adev); CLEAR_BIT(adev->after_interrupt_jobs, ACX_AFTER_IRQ_UPDATE_TIM); } /* others */ if(adev->after_interrupt_jobs) { pr_info("Jobs still to be run: 0x%02Xn", adev->after_interrupt_jobs); adev->after_interrupt_jobs = 0; } } void acx_log_irq(u16 irqtype) { pr_info("%s: got: ", __func__); if (irqtype & HOST_INT_RX_DATA) pr_info("Rx_Data,"); if (irqtype & HOST_INT_TX_COMPLETE) pr_info("Tx_Complete,"); if (irqtype & HOST_INT_TX_XFER) pr_info("Tx_Xfer,"); if (irqtype & HOST_INT_RX_COMPLETE) pr_info("Rx_Complete,"); if (irqtype & HOST_INT_DTIM) pr_info("DTIM,"); if (irqtype & HOST_INT_BEACON) pr_info("Beacon,"); if (irqtype & HOST_INT_TIMER) log(L_IRQ, "Timer,"); if (irqtype & HOST_INT_KEY_NOT_FOUND) pr_info("Key_Not_Found,"); if (irqtype & HOST_INT_IV_ICV_FAILURE) pr_info("IV_ICV_Failure (crypto),"); if (irqtype & HOST_INT_CMD_COMPLETE) pr_info("Cmd_Complete,"); if (irqtype & HOST_INT_INFO) pr_info("Info,"); if (irqtype & HOST_INT_OVERFLOW) pr_info("Overflow,"); if (irqtype & HOST_INT_PROCESS_ERROR) pr_info("Process_Error,"); if (irqtype & HOST_INT_SCAN_COMPLETE) pr_info("Scan_Complete,"); if (irqtype & HOST_INT_FCS_THRESHOLD) pr_info("FCS_Threshold,"); if (irqtype & HOST_INT_UNKNOWN) pr_info("Unknown,"); pr_info(": IRQ(s)n"); } /* * acx_schedule_task * * Schedule the call of the after_interrupt method after leaving * the interrupt context. */ void acx_schedule_task(acx_device_t *adev, unsigned int set_flag) { SET_BIT(adev->after_interrupt_jobs, set_flag); ieee80211_queue_work(adev->hw, &adev->irq_work); } /* * acx_i_timer */ void acx_timer(unsigned long address) { /* acx_device_t *adev = (acx_device_t *) address; */ FIXME(); /* We need calibration and stats gather tasks to perform here */ } struct ieee80211_hw* acx_alloc_hw(const struct ieee80211_ops *hw_ops) { acx_device_t *adev; struct ieee80211_hw *hw; hw = ieee80211_alloc_hw(sizeof(struct acx_device), hw_ops); if (!hw) { pr_err("ieee80211_alloc_hw failedn"); return hw; } adev = hw2adev(hw); memset(adev, 0, sizeof(*adev)); adev->hw = hw; pr_info("wiphy: %s", wiphy_name(adev->hw->wiphy)); return hw; } #define ACX_WATCHDOG_DELAY 1 #define ACX_SCAN_TIMEOUT 5 int acx_start_watchdog(acx_device_t *adev) { schedule_delayed_work(&adev->watchdog_work, HZ*ACX_WATCHDOG_DELAY); set_bit(ACX_FLAG_WATCHDOG_RUNNING, &adev->flags); return 0; } int acx_stop_watchdog(acx_device_t *adev) { clear_bit(ACX_FLAG_WATCHDOG_RUNNING, &adev->flags); cancel_delayed_work_sync(&adev->watchdog_work); return 0; } static void acx_watchdog_work(struct work_struct *work) { acx_device_t *adev = container_of(work, struct acx_device, watchdog_work.work); if (!test_bit(ACX_FLAG_WATCHDOG_RUNNING, &adev->flags)) return; adev->watchdog_last = jiffies; log(L_DEBUG, "n"); if (!test_bit(ACX_FLAG_HW_UP, &adev->flags)) return; /* Check ongoing scan timeout */ if (test_bit(ACX_FLAG_SCANNING, &adev->flags)) { if (jiffies - adev->scan_start > ACX_SCAN_TIMEOUT * HZ) { log(L_ANY, "Scan completion timeout: triggering hw-recoveryn"); acx_sem_lock(adev); acx_recover_hw(adev); acx_sem_unlock(adev); } } schedule_delayed_work(&adev->watchdog_work, HZ*ACX_WATCHDOG_DELAY); return; } /* Locking, queueing, etc. mechanics */ int acx_init_mechanics(acx_device_t *adev) { /* Locking */ spin_lock_init(&adev->spinlock); mutex_init(&adev->mutex); /* Irq work */ if (IS_USB(adev)) INIT_WORK(&adev->irq_work, acxusb_irq_work); else INIT_WORK(&adev->irq_work, acx_irq_work); /* Skb tx-queue from mac80211 */ INIT_WORK(&adev->tx_work, acx_tx_work); skb_queue_head_init(&adev->tx_queue); INIT_DELAYED_WORK(&adev->watchdog_work, acx_watchdog_work); /* Allocate IE cmd buffer */ adev->ie_cmd_buf_len=acx_ie_get_max_len()+4; log(L_INIT, "ie_cmd_buf_len=%dn", adev->ie_cmd_buf_len); adev->ie_cmd_buf=kmalloc(adev->ie_cmd_buf_len, GFP_KERNEL); if (!adev->ie_cmd_buf) return -1; return 0; } int acx_free_mechanics(acx_device_t *adev) { kfree(adev->ie_cmd_buf); return 0; } int acx_init_ieee80211(acx_device_t *adev, struct ieee80211_hw *hw) { #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(4, 2, 0) unsigned long IEEE80211_HW_RX_INCLUDES_FCS = 1<<1; hw->flags[0] &= ~IEEE80211_HW_RX_INCLUDES_FCS; #else hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; #endif hw->queues = 1; hw->wiphy->max_scan_ssids = 1; /* OW TODO Check if RTS/CTS threshold can be included here */ /* TODO: although in the original driver the maximum value was * 100, the OpenBSD driver assigns maximum values depending on * the type of radio transceiver (i.e. Radia, Maxim, * etc.). This value is always a positive integer which most * probably indicates the gain of the AGC in the rx path of * the chip, in dB steps (0.625 dB, for example?). The * mapping of this rssi value to dBm is still unknown, but it * can nevertheless be used as a measure of relative signal * strength. The other two values, i.e. max_signal and * max_noise, do not seem to be supported on my acx111 card * (they are always 0), although iwconfig reports them (in * dBm) when using ndiswrapper with the Windows XP driver. The * GPL-licensed part of the AVM FRITZ!WLAN USB Stick driver * sources (for the TNETW1450, though) seems to also indicate * that only the RSSI is supported. In conclusion, the * max_signal and max_noise values will not be initialised by * now, as they do not seem to be supported or how to acquire * them is still unknown. */ /* We base signal quality on winlevel approach of previous driver * TODO OW 20100615 This should into a common init code */ #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(4, 2, 0) unsigned long IEEE80211_HW_SIGNAL_UNSPEC = 1<<5; hw->flags[0] |= IEEE80211_HW_SIGNAL_UNSPEC; #else hw->flags |= IEEE80211_HW_SIGNAL_UNSPEC; #endif hw->max_signal = 100; #if (LINUX_VERSION_CODE > KERNEL_VERSION(4, 7, 0)) #define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ #endif if (IS_ACX100(adev)) { adev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &acx100_band_2GHz; } else if (IS_ACX111(adev)) adev->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &acx111_band_2GHz; else { log(L_ANY, "Error: Unknown device"); return -1; } return 0; } /* * BOM Mac80211 Ops * ================================================== */ int acx_op_add_interface(struct ieee80211_hw *ieee, struct ieee80211_VIF *vif) { acx_device_t *adev = hw2adev(ieee); int err = -EOPNOTSUPP; u8 *mac_vif; char mac[MACSTR_SIZE]; int vif_type; acx_sem_lock(adev); vif_type = vif->type; adev->vif_type = vif_type; log(L_ANY, "vif_type=%04Xn", vif_type); if (vif_type == NL80211_IFTYPE_MONITOR) adev->vif_monitor++; else if (adev->vif) goto out_unlock; adev->vif = VIF_vif(vif); mac_vif = VIF_addr(vif); switch (adev->vif_type) { case NL80211_IFTYPE_AP: log(L_ANY, "NL80211_IFTYPE_APn"); adev->mode = ACX_MODE_3_AP; break; case NL80211_IFTYPE_ADHOC: log(L_ANY, "NL80211_IFTYPE_ADHOCn"); adev->mode = ACX_MODE_0_ADHOC; break; case NL80211_IFTYPE_STATION: log(L_ANY, "NL80211_IFTYPE_STATIONn"); adev->mode = ACX_MODE_2_STA; break; case NL80211_IFTYPE_MONITOR: logf0(L_ANY, "NL80211_IFTYPE_MONITORn"); break; case NL80211_IFTYPE_WDS: logf0(L_ANY, "NL80211_IFTYPE_WDS: Not implementedn"); goto out_unlock; default: logf1(L_ANY, "Unknown adev->vif_type=%dn", adev->vif_type); goto out_unlock; break; } /* Reconfigure mac-address globally, affecting all vifs */ if (!mac_is_equal(mac_vif, adev->dev_addr)) { memcpy(adev->dev_addr, mac_vif, ETH_ALEN); memcpy(adev->bssid, mac_vif, ETH_ALEN); acx1xx_set_station_id(adev, mac_vif); } acx_update_mode(adev); logf0(L_ANY, "Redoing cmd_join_bssid() after add_interfacen"); acx_cmd_join_bssid(adev, adev->bssid); pr_info("Virtual interface added (type: 0x%08X, MAC: %s)n", adev->vif_type, acx_print_mac(mac, mac_vif)); err = 0; out_unlock: acx_sem_unlock(adev); return err; } void acx_remove_interface(acx_device_t *adev, struct ieee80211_vif *vif) { if (vif->type == NL80211_IFTYPE_MONITOR) adev->vif_monitor--; else { adev->vif = NULL; } acx_set_mode(adev, ACX_MODE_OFF); } void acx_op_remove_interface(struct ieee80211_hw *hw, struct ieee80211_VIF *vif) { acx_device_t *adev = hw2adev(hw); char mac[MACSTR_SIZE]; u8 *mac_vif; acx_sem_lock(adev); mac_vif = VIF_addr(vif); acx_remove_interface(adev, VIF_vif(vif)); log(L_ANY, "Virtual interface removed: type=%d, MAC=%sn", vif->type, acx_print_mac(mac, mac_vif)); acx_sem_unlock(adev); } int acx_op_config(struct ieee80211_hw *hw, u32 changed) { acx_device_t *adev = hw2adev(hw); struct ieee80211_conf *conf = &hw->conf; int ret=0; u32 changed_not_done = changed; acx_sem_lock(adev); if (unlikely(!test_bit(ACX_FLAG_HW_UP, &adev->flags))) { ret = -EINVAL; goto out; } logf1(L_DEBUG, "changed=%08Xn", changed); /* Tx-Power power_level: requested transmit power (in dBm) */ if (changed & IEEE80211_CONF_CHANGE_POWER) { logf1(L_DEBUG, "IEEE80211_CONF_CHANGE_POWER: %dn", conf->power_level); acx1xx_set_tx_level_dbm(adev, conf->power_level); } if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { logf1(L_DEBUG, "IEEE80211_CONF_CHANGE_CHANNEL," #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) "channel->hw_value=%in", conf->chandef.chan->hw_value); acx_set_channel(adev, conf->chandef.chan->hw_value, conf->chandef.chan->center_freq); #else "channel->hw_value=%in", conf->channel->hw_value); acx_set_channel(adev, conf->channel->hw_value, conf->channel->center_freq); #endif changed_not_done &= ~IEEE80211_CONF_CHANGE_CHANNEL; } if (changed_not_done) logf1(L_DEBUG, "changed_not_done=%08Xn", changed_not_done); out: acx_sem_unlock(adev); return ret; } void acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u32 changed) { acx_device_t *adev = hw2adev(hw); int err = -ENODEV; struct sk_buff *beacon; acx_sem_lock(adev); logf1(L_DEBUG, "changed=%04Xn", changed); if (!adev->vif) goto end_sem_unlock; if (changed & BSS_CHANGED_BSSID) { MAC_COPY(adev->bssid, info->bssid); logf0(L_INIT, "Join following bssid updaten"); acx_cmd_join_bssid(adev, adev->bssid); } /* BOM BSS_CHANGED_BEACON */ if (changed & BSS_CHANGED_BEACON) { /* TODO Use ieee80211_beacon_get_tim instead */ beacon = ieee80211_beacon_get(hw, vif); if (!beacon) { pr_err("Error: BSS_CHANGED_BEACON: skb_tmp==NULL"); goto end_sem_unlock; } adev->beacon_interval = info->beacon_int; acx_set_beacon(adev, beacon); dev_kfree_skb(beacon); } err = 0; end_sem_unlock: acx_sem_unlock(adev); return; } static int acx111_set_key_type(acx_device_t *adev, acx111WEPDefaultKey_t *key, struct ieee80211_key_conf *mac80211_key, const u8 *addr) { #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) switch (mac80211_key->alg) { #else switch (mac80211_key->cipher) { #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_CCMP: #else case WLAN_CIPHER_SUITE_CCMP: #endif if (is_broadcast_ether_addr(addr)) key->type = KEY_AES_GROUP; else key->type = KEY_AES_PAIRWISE; break; default: #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(2, 6, 37) log(L_INIT, "Unknown key cipher 0x%x", mac80211_key->cipher); #endif return -EOPNOTSUPP; } return 0; } static int acx111_set_key(acx_device_t *adev, enum set_key_cmd cmd, const u8 *addr, struct ieee80211_key_conf *key) { int ret = -1; acx111WEPDefaultKey_t dk; memset(&dk, 0, sizeof(dk)); switch (cmd) { case SET_KEY: dk.action = cpu_to_le16(KEY_ADD_OR_REPLACE); break; case DISABLE_KEY: dk.action = cpu_to_le16(KEY_REMOVE); break; default: log(L_INIT, "Unsupported key cmd 0x%x", cmd); break; } ret = acx111_set_key_type(adev, &dk, key, addr); if (ret < 0) { log(L_INIT, "Set KEY type failed"); return ret; } memcpy(dk.MacAddr, addr, ETH_ALEN); dk.keySize = key->keylen; dk.defaultKeyNum = key->keyidx; /* ignored when setting default key */ dk.index = 0; memcpy(dk.key, key->key, dk.keySize); ret = acx_issue_cmd(adev, ACX1xx_CMD_WEP_MGMT, &dk, sizeof(dk)); return ret; } int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_key_conf *key) { struct acx_device *adev = hw2adev(hw); u8 algorithm; int ret=0; const u8 *addr; static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; acx_sem_lock(adev); addr = sta ? sta->addr : bcast_addr; #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(2, 6, 37) log(L_DEBUG, "cmd=%dn", cmd); log(L_DEBUG, "addr=" MACSTR, MAC(addr)); log(L_DEBUG, "key->: cipher=%08x, icv_len=%d, iv_len=%d, hw_key_idx=%d, " "flags=%02x, keyidx=%d, keylen=%dn", key->cipher, key->icv_len, key->iv_len, key->hw_key_idx, key->flags, key->keyidx, key->keylen); if (acx_debug & L_DEBUG) hexdump("key->: key", key->key, key->keylen); #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) switch (key->alg) { #else switch (key->cipher) { #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_WEP: if (key->keylen == 5) { algorithm = ACX_SEC_ALGO_WEP; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_WEP"); } else { algorithm = ACX_SEC_ALGO_WEP104; log(L_INIT, "algorithm=%i: %sn", "ACX_SEC_ALGO_WEP104"); } acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; #else case WLAN_CIPHER_SUITE_WEP40: algorithm = ACX_SEC_ALGO_WEP; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_WEP"); acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; case WLAN_CIPHER_SUITE_WEP104: algorithm = ACX_SEC_ALGO_WEP104; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_WEP104"); acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_TKIP: #else case WLAN_CIPHER_SUITE_TKIP: #endif algorithm = ACX_SEC_ALGO_TKIP; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_TKIP"); acx_set_hw_encryption_off(adev); ret = -EOPNOTSUPP; break; #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 37) case ALG_CCMP: #else case WLAN_CIPHER_SUITE_CCMP: #endif algorithm = ACX_SEC_ALGO_AES; log(L_INIT, "algorithm=%i: %sn", algorithm, "ACX_SEC_ALGO_AES"); if(!adev->hw_encrypt_enabled){ ret=-EOPNOTSUPP; } else { acx111_set_key(adev, cmd, addr, key); ret = 0; } break; default: algorithm = ACX_SEC_ALGO_NONE; acx_set_hw_encryption_off(adev); ret = 0; break; } acx_sem_unlock(adev); return ret; } void acx_op_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, unsigned int *total_flags, u64 multicast) { acx_device_t *adev = hw2adev(hw); acx_sem_lock(adev); logf1(L_DEBUG, "1: changed_flags=0x%08x, *total_flags=0x%08xn", changed_flags, *total_flags); /* OWI TODO: Set also FIF_PROBE_REQ ? */ #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(4, 2, 0) *total_flags &= (FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL | FIF_OTHER_BSS); #else *total_flags &= (FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL | FIF_OTHER_BSS); #endif logf1(L_DEBUG, "2: *total_flags=0x%08xn", *total_flags); acx_sem_unlock(adev); } #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(3, 2, 0) int acx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) #else int acx_conf_tx(struct ieee80211_hw *hw, u16 queue, const struct ieee80211_tx_queue_params *params) #endif { acx_device_t *adev = hw2adev(hw); acx_sem_lock(adev); /* TODO */ acx_sem_unlock(adev); return 0; } int acx_op_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) { acx_device_t *adev = hw2adev(hw); acx_schedule_task(adev, ACX_AFTER_IRQ_UPDATE_TIM); return 0; } int acx_op_get_stats(struct ieee80211_hw *hw, struct ieee80211_low_level_stats *stats) { acx_device_t *adev = hw2adev(hw); acx_sem_lock(adev); memcpy(stats, &adev->ieee_stats, sizeof(*stats)); acx_sem_unlock(adev); return 0; } #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34) int acx_e_op_get_tx_stats(struct ieee80211_hw *hw, struct ieee80211_tx_queue_stats *stats) { acx_device_t *adev = hw2adev(hw); int err = -ENODEV; acx_sem_lock(adev); stats->len = 0; stats->limit = TX_CNT; stats->count = 0; acx_sem_unlock(adev); return err; } #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39) int acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) #elif CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 7, 0) void acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) #else void acx_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb) #endif { acx_device_t *adev = hw2adev(hw); skb_queue_tail(&adev->tx_queue, skb); ieee80211_queue_work(adev->hw, &adev->tx_work); if (skb_queue_len(&adev->tx_queue) >= ACX_TX_QUEUE_MAX_LENGTH) acx_stop_queue(adev->hw, NULL); #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39) return 0; #else return; #endif } #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 17, 0) int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_scan_request *req) { #else int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *hw_req) { struct cfg80211_scan_request *req = &hw_req->req; #endif acx_device_t *adev = hw2adev(hw); struct sk_buff *skb; size_t ssid_len = 0; u8 *ssid = NULL; int ret=0; if (req->n_ssids) { ssid = req->ssids[0].ssid; ssid_len = req->ssids[0].ssid_len; } acx_sem_lock(adev); if (unlikely(!test_bit(ACX_FLAG_HW_UP, &adev->flags))) { ret = -EINVAL; goto out; } if (test_bit(ACX_FLAG_SCANNING, &adev->flags)) { log(L_INIT, "scan already in progressn"); ret = -EINVAL; goto out; } #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(3, 1, 0) #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 8, 0) skb = ieee80211_probereq_get(adev->hw, adev->vif, ssid, ssid_len, req->ie, req->ie_len); if (!skb) { ret = -ENOMEM; goto out; } #else #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 19, 0) skb = ieee80211_probereq_get(adev->hw, adev->vif, ssid, ssid_len, req->ie_len); #else skb = ieee80211_probereq_get(adev->hw, adev->vif->addr, ssid, ssid_len, req->ie_len); #endif if (!skb) { ret = -ENOMEM; goto out; } if (req->ie_len) memcpy(skb_put(skb, req->ie_len), req->ie, req->ie_len); #endif #else goto out; #endif ret = acx_set_probe_request_template(adev, skb->data, skb->len); dev_kfree_skb(skb); if (ret < 0) goto out; log(L_INIT, "scan startn"); set_bit(ACX_FLAG_SCANNING, &adev->flags); adev->scan_start=jiffies; ret = acx_cmd_scan(adev); if (ret < 0) { clear_bit(ACX_FLAG_SCANNING, &adev->flags); goto out; } out: acx_sem_unlock(adev); return ret; } int acx_recover_hw(acx_device_t *adev) { log(L_ANY, ""); acx_remove_interface(adev, adev->vif); acx_stop(adev); ieee80211_restart_hw(adev->hw); return 0; }
main.h
Caché :
Code BASH :
#ifndef _ACX_MAIN_H_ #define _ACX_MAIN_H_ /* Minutes to wait until next radio recalibration: */ #define RECALIB_PAUSE 5 extern struct ieee80211_rate acx111_rates[]; extern const int acx111_rates_sizeof; extern const u8 bitpos2genframe_txrate[]; struct ieee80211_hw* acx_alloc_hw(const struct ieee80211_ops *hw_ops); int acx_start_watchdog(acx_device_t *adev); int acx_stop_watchdog(acx_device_t *adev); int acx_init_mechanics(acx_device_t *adev); int acx_free_mechanics(acx_device_t *adev); int acx_init_ieee80211(acx_device_t *adev, struct ieee80211_hw *hw); void acx_after_interrupt_task(acx_device_t *adev); void acx_log_irq(u16 irqtype); void acx_schedule_task(acx_device_t *adev, unsigned int set_flag); void acx_timer(unsigned long address); int acx_op_add_interface(struct ieee80211_hw *ieee, struct ieee80211_VIF *vif); void acx_remove_interface(acx_device_t *adev, struct ieee80211_vif *vif); void acx_op_remove_interface(struct ieee80211_hw *hw, struct ieee80211_VIF *vif); int acx_op_config(struct ieee80211_hw *hw, u32 changed); void acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u32 changed); int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_key_conf *key); void acx_op_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, unsigned int *total_flags, u64 multicast); #if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(3, 2, 0) int acx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params); #else int acx_conf_tx(struct ieee80211_hw *hw, u16 queue, const struct ieee80211_tx_queue_params *params); #endif int acx_op_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set); int acx_op_get_stats(struct ieee80211_hw *hw, struct ieee80211_low_level_stats *stats); #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34) int acx_e_op_get_tx_stats(struct ieee80211_hw *hw, struct ieee80211_tx_queue_stats *stats); #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39) int acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb); #elif CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 7, 0) void acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb); #else void acx_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb); #endif #if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 17, 0) int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_scan_request *req); #else int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); #endif int acx_recover_hw(acx_device_t *adev); #endif
URLs sur les 2 fichiers pci.c et cardsetting.c trop gros pour être inséré selon la même méthode que les précédents
pci.c
cardsetting.c
Édité par kalagani Le 28/01/2018 à 13h04
PC1: HPxw9400 Mageia8 Xfce/Cinnamon (ex Plasma car "Freeze")
PC2: Dell Studio 540 Core2 Quad Q8300 en double boot: XPsp3/Mageia8 64bits Plasma
PC2: Dell Studio 540 Core2 Quad Q8300 en double boot: XPsp3/Mageia8 64bits Plasma
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie