Siocsifflags unknown error 132 centos

siocsifflags unknown error 132 centos

Keywords: wrf file, centos traceroute, traceroute centos, how to get ringtones on iphone 4 not working, phy0 siocsifflags unknown error 132. SIOCSIFADDR: File exists > > SIOCSIFFLAGS: Canot assign requested address _192_168_1_1: Unknown server error > > SIOCADDRT: No such device > > Best you. https://www.linuxquestions.org/questions/linux-newbie-8/ /linux-newbie-8/oracle-11gr2-installation-on-rhel-6-2-with-vmware-java-132-error-948634/ 0.6507.

Siocsifflags unknown error 132 centos - was registered

hosts' /etc/nsswitch.conf ==
#hosts: db files nisplus nis dns
hosts: files dns
#networks: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files
netmasks: files
networks: files
netgroup: nisplus
== END egrep 'net / Name                                          Version                     Architecture                Description +++-=============================================-===========================-===========================-=============================================================================================== hi  linux-headers-3.13.0-35-generic               3.13.0-35.62                amd64                       Linux kernel headers for version 3.13.0 on 64 bit x86 SMP hi  linux-image-3.13.0-35-generic                 3.13.0-35.62                amd64                       Linux kernel image for version 3.13.0 on 64 bit x86 SMP hi  linux-image-extra-3.13.0-35-generic           3.13.0-35.62                amd64                       Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP

Indeed, the “h” notes that the packages are held. To revert this, use “install” instead of “hold” in the input to dpkg –set-selections above.

Which package provides file X?

Following this page, install apt-file (simply with apt-get install apt-file), go “apt-file update” once and then go something like (not necessarily as root):

$ apt-file find libgnome-2.so

Note that the pattern can be a substring (as in the example above).

What files does package X generate?

$ dpkg -L libpulse-dev

Installing a deb file locally

# dpkg -i thepackage.deb

If there are failed dependencies, fix them with apt-get subsequently:

# apt-get -f install

and if it says that it wants to remove the package you tried to install, go

# apt-get install -f --fix-missing

That will probably not help directly, but odds are apt-get will at least explain why it wants to kick out the package.

To make apt ignore a failed post-installation script, consider this post.

A word on repositories

Say that we have a line like this in /etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu xenial main universe updates restricted security backports

It tells apt-update to go to http://archive.ubuntu.com/ubuntu/dists/ and look into xenial/main for the “main” part, xenial/universe for the “universe” part but e.g. xenial-updates/ for the “updates”. This site help with a better understanding on how a sources.list file is set up.

If we look at e.g. ubuntu/dists/xenial/main/, there’s a binary-amd64/ subdirectory for the amd64 platforms (64-bit Intel/AMD). That’s where the Packages.gz and Packages.xz files are found. These list the packages available in the repositories, but even more important: where to find them.

For example, the entry for the “adduser” package looks like this:

Package: adduser Priority: required Section: admin Installed-Size: 648 Maintainer: Ubuntu Core Developers <[email protected]> Original-Maintainer: Debian Adduser Developers <[email protected]> Architecture: all Version: 3.113+nmu3ubuntu4 Replaces: manpages-it (<< 0.3.4-2), manpages-pl (<= 20051117-1) Depends: perl-base (>= 5.6.0), passwd (>= 1:4.1.5.1-1.1ubuntu6), debconf defined(CONFIG_SMP) #define mb() do { dsb(); outer_sync(); } while (0) #define rmb() dsb() #define wmb() do { dsb(st); outer_sync(); } while (0) #else #define mb() barrier() #define rmb() barrier() #define wmb() barrier() #endif

Results on ARM

This is what the same module compiled for ARM Cortex A9, Little Endian gives (I’ve added extra newlines in the middle for clarity):

minimodule.o: file format elf32-littlearm Disassembly of section .text: 00000000 <try_iowrite32>: 0: e92d4038 push {r3, r4, r5, lr} 4: f57ff04e dsb st 8: e59f2118 ldr r2, [pc, #280] ; 128 <try_iowrite32+0x128> c: e1a04002 mov r4, r2 10: e5923018 ldr r3, [r2, #24] 14: e3530000 cmp r3, #0 18: 0a000000 beq 20 <try_iowrite32+0x20> 1c: e12fff33 blx r3 20: e59f3104 ldr r3, [pc, #260] ; 12c <try_iowrite32+0x12c> 24: e59f1104 ldr r1, [pc, #260] ; 130 <try_iowrite32+0x130> 28: e5831678 str r1, [r3, #1656] ; 0x678 2c: f57ff04e dsb st 30: e5942018 ldr r2, [r4, #24] 34: e1a05001 mov r5, r1 38: e1a04003 mov r4, r3 3c: e3520000 cmp r2, #0 40: 0a000000 beq 48 <try_iowrite32+0x48> 44: e12fff32 blx r2 48: e5845678 str r5, [r4, #1656] ; 0x678 4c: f57ff04e dsb st 50: e59f20d0 ldr r2, [pc, #208] ; 128 <try_iowrite32+0x128> 54: e1a04002 mov r4, r2 58: e5923018 ldr r3, [r2, #24] 5c: e3530000 cmp r3, #0 60: 0a000000 beq 68 <try_iowrite32+0x68> 64: e12fff33 blx r3 68: e59f30bc ldr r3, [pc, #188] ; 12c <try_iowrite32+0x12c> 6c: e59f20c0 ldr r2, [pc, #192] ; 134 <try_iowrite32+0x134> 70: e5832678 str r2, [r3, #1656] ; 0x678 74: f57ff04e dsb st 78: e5942018 ldr r2, [r4, #24] 7c: e1a04003 mov r4, r3 80: e3520000 cmp r2, #0 84: 0a000000 beq 8c <try_iowrite32+0x8c> 88: e12fff32 blx r2 8c: e59f30a4 ldr r3, [pc, #164] ; 138 <try_iowrite32+0x138> 90: e5843678 str r3, [r4, #1656] ; 0x678 94: f57ff04e dsb st 98: e59f2088 ldr r2, [pc, #136] ; 128 <try_iowrite32+0x128> 9c: e1a04002 mov r4, r2 a0: e5923018 ldr r3, [r2, #24] a4: e3530000 cmp r3, #0 a8: 0a000000 beq b0 <try_iowrite32+0xb0> ac: e12fff33 blx r3 b0: f57ff04e dsb st b4: e5943018 ldr r3, [r4, #24] b8: e3530000 cmp r3, #0 bc: 0a000000 beq c4 <try_iowrite32+0xc4> c0: e12fff33 blx r3 c4: e59f3060 ldr r3, [pc, #96] ; 12c <try_iowrite32+0x12c> c8: e59f206c ldr r2, [pc, #108] ; 13c <try_iowrite32+0x13c> cc: e5832678 str r2, [r3, #1656] ; 0x678 d0: f57ff04f dsbsy d4: f57ff04e dsb st d8: e59f1048 ldr r1, [pc, #72] ; 128 <try_iowrite32+0x128> dc: e1a04003 mov r4, r3 e0: e1a05001 mov r5, r1 e4: e5912018 ldr r2, [r1, #24] e8: e3520000 cmp r2, #0 ec: 0a000000 beq f4 <try_iowrite32+0xf4> f0: e12fff32 blx r2 f4: e59f3044 ldr r3, [pc, #68] ; 140 <try_iowrite32+0x140> f8: e5843678 str r3, [r4, #1656] ; 0x678 fc: f57ff05a dmb ishst 100: f57ff04e dsb st 104: e5953018 ldr r3, [r5, #24] 108: e3530000 cmp r3, #0 10c: 0a000000 beq 114 <try_iowrite32+0x114> 110: e12fff33 blx r3 114: e59f3010 ldr r3, [pc, #16] ; 12c <try_iowrite32+0x12c> 118: e59f2024 ldr r2, [pc, #36] ; 144 <try_iowrite32+0x144> 11c: e5832678 str r2, [r3, #1656] ; 0x678 120: f57ff05b dmb ish 124: e8bd8038 pop {r3, r4, r5, pc} 128: 00000000 .word 0x00000000 12c: 12345000 .word 0x12345000 130: abcd0001 .word 0xabcd0001 134: abcd0002 .word 0xabcd0002 138: abcd0003 .word 0xabcd0003 13c: abcd0004 .word 0xabcd0004 140: abcd0005 .word 0xabcd0005 144: abcd0006 .word 0xabcd0006

This was a lot of code (somehow that’s what you get with ARM). There are no calls to iowrite32(), so this is done inline for ARM (consistent with the sources).

This requires some translation from ARM opcodes to human language (taken from this page):

  • DSB SY — Data Synchronization Barrier: No instruction in program order after this instruction executes until all explicit memory accesses before this instruction complete, as well as all cache, branch predictor and TLB maintenance operations before this instruction complete.
  • DSB ST — Like DSB SY, but waits only for data writes to complete.
  • DMB ISHST — Data Memory Barrier, operation that waits only for stores to complete, and only to the inner shareable domain (whatever that “inner shareable domain” is).
  • DMB ISH — Data Memory Barrier, operation that waits only to the inner shareable domain.

Now let’s decipher the assembly code, which is quite tangled. Luckily, it’s easy to spot the seven write operations as the seven “str” commands in the assembly code. It’s also easy to see that all each iowrite32() starts with an “dsb st” which forces waiting until previous writes has completed. So each iowrite32() spans from a “dsb st” to a “str”. This matches the definition of iowrite32() as __iowmb() and then __raw_writel(…).

The memory barriers are quite clear too:

  • wmb() becomes “dsb st”, the full synchronization barrier for writes (which is also issued automatically before each iowrite32).
  • rmb() becomes “dsb sy”, the full synchronization barrier for reads and writes
  • smp_wmb() becomes “dmb ishst”, the “inner shareable domain” memory barrier for writes
  • smp_rmb() becomes “dmb ish”, the “inner shareable domain” memory barrier for reads and writes

Now with writel()

So I through it would be nice to repeat all this with writel(). Spoiler: Nothing thrilling happens here.

Module code (includes omitted):

void try_writel(void) { void __iomem *p = (void *) 0x12345678; writel(0xabcd0001, p); writel(0xabcd0001, p); writel(0xabcd0002, p); mmiowb(); writel(0xabcd0003, p); wmb(); writel(0xabcd0004, p); rmb(); writel(0xabcd0005, p); smp_wmb(); writel(0xabcd0006, p); smp_rmb(); } EXPORT_SYMBOL(try_writel);

Assembly on 64-bit Intel:

minimodule.ko: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <try_writel>: 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: e8 00 00 00 00 callq 9 <try_writel+0x9> 9: b8 01 00 cd ab mov $0xabcd0001,%eax e: 89 04 25 78 56 34 12 mov %eax,0x12345678 15: 89 04 25 78 56 34 12 mov %eax,0x12345678 1c: b8 02 00 cd ab mov $0xabcd0002,%eax 21: 89 04 25 78 56 34 12 mov %eax,0x12345678 28: b8 03 00 cd ab mov $0xabcd0003,%eax 2d: 89 04 25 78 56 34 12 mov %eax,0x12345678 34: 0f ae f8 sfence 37: b8 04 00 cd ab mov $0xabcd0004,%eax 3c: 89 04 25 78 56 34 12 mov %eax,0x12345678 43: 0f ae e8 lfence 46: b8 05 00 cd ab mov $0xabcd0005,%eax 4b: 89 04 25 78 56 34 12 mov %eax,0x12345678 52: b8 06 00 cd ab mov $0xabcd0006,%eax 57: 89 04 25 78 56 34 12 mov %eax,0x12345678 5e: c9 leaveq 5f: c3 retq

OK, so writel() just translated into a couple of inline “mov” opcodes. There’s even an optimization between the first and second move, so %eax isn’t set twice. Hi-tec, I’m telling you.

And on 32-bit Intel:

minimodule.ko: file format elf32-i386 Disassembly of section .text: 00000000 <try_writel>: 0: b8 01 00 cd ab mov $0xabcd0001,%eax 5: a3 78 56 34 12 mov %eax,0x12345678 a: a3 78 56 34 12 mov %eax,0x12345678 f: b0 02 mov $0x2,%al 11: a3 78 56 34 12 mov %eax,0x12345678 16: b0 03 mov $0x3,%al 18: a3 78 56 34 12 mov %eax,0x12345678 1d: f0 83 04 24 00 lock addl $0x0,(%esp) 22: b0 04 mov $0x4,%al 24: a3 78 56 34 12 mov %eax,0x12345678 29: f0 83 04 24 00 lock addl $0x0,(%esp) 2e: b0 05 mov $0x5,%al 30: a3 78 56 34 12 mov %eax,0x12345678 35: b0 06 mov $0x6,%al 37: a3 78 56 34 12 mov %eax,0x12345678 3c: f0 83 04 24 00 lock addl $0x0,(%esp) 41: c3 ret ... Disassembly of section .altinstr_replacement: 00000000 <.altinstr_replacement>: 0: 0f ae f8 sfence 3: 0f ae e8 lfence 6: 0f ae e8 lfence

And for ARM, it’s exactly the same code (to the byte) as iowrite32() is an alias for writel(). But I listed it here anyhow for those who don’t take my word for it:

minimodule.o: file format elf32-littlearm Disassembly of section .word 0x00000000 12c: 12345000 .word 0x12345000 130: abcd0001 .word 0xabcd0001 134: abcd0002 .word 0xabcd0002 138: abcd0003 .word 0xabcd0003 13c: abcd0004 .word 0xabcd0004 140: abcd0005 .word 0xabcd0005 144: abcd0006 .word 0xabcd0006

Posted Under: ARM,Linux kernel
This post was written by eli on August 14, 2014 Comments (0)

SOLVED: Lenovo Yoga 2 13″ with “hardware-disabled” Wifi

Overview

Having a Lenovo Yoga 2 13″ (non-pro) running Ubuntu 14.04.1, I couldn’t get Wireless LAN up and running, as the WLAN NIC appeared to be “hardware locked”. This is the summary of how I solved this issue. If you’re not interested in the gory details, you may jump right to bottom, where I offer a replacement module that fixes it. At least for me.

Environment details: Distribution kernel 3.13.0-32-generic on an Intel i5-4210U CPU @ 1.70GHz. The Wifi device is an Intel Dual Band Wireless-AC 7260 (8086:08b1) connected to the PCIe bus, taken care of by the iwlwifi driver.

The problem

Laptops have a mechanism for working in “flight mode” which means turning off any device that could emit RF power, so that the airplane can crash for whatever different reason. Apparently, some laptops have a physical on-off switch to request this, but on Lenovo Yoga 13, the arrangement is to press a button on the keyboard with an airplane drawn on it. The one shared with F7.

It seems to be, that on Lenovo Yoga 13, the ACPI interface, which is responsible for reporting the Wifi’s buttons state, always reports that it’s in flight mode. So Linux turns off Wifi, and on the desktop’s Gnome network applet it says “Wi-Fi is disabled by hardware switch”.

In the dmesg log one can tell the problem with a line like

iwlwifi 0000:01:00.0: RF_KILL bit toggled to disable radio.

which is issued by the interrupt request handler defined in drivers/net/wireless/iwlwifi/pcie/rx.c, which responds to an interrupt from the device that informs the host that the hardware RF kill bit is set. So the iwlwifi module is not to blame here — it just responds to a request from the ACPI subsystem.

rfkill

The management of RF-related devices is handled by the rfkill subsystem. On my laptop, before solving the problem, a typical output went

$ rfkill list all 0: ideapad_wlan: Wireless LAN Soft blocked: yes Hard blocked: yes 1: ideapad_bluetooth: Bluetooth Soft blocked: no Hard blocked: yes 6: hci0: Bluetooth Soft blocked: no Hard blocked: no 7: phy1: Wireless LAN Soft blocked: yes Hard blocked: yes

So there are different entities that can be controlled with rfkill, enumerated and assigned soft and hard blocks. Each of these relate to a directory in /sys/class/rfkill/. For example, the last device, “phy7″ enumerated as 7 corresponds to /sys/class/rfkill/rfkill7, where the “hard” and “soft” pseudo-files signify the status with “0″ or “1″ values.

The soft block can be changed by “rfkill unblock 0″ or “rfkill unblock 7″, but this doesn’t really help with the hardware block. Both has to be “off” to use the device.

As can be seen easily from the rkfill list above, each of the physical devices are registered twice as rfkill devices: Once by their driver, and a second time by the ideapad_laptop driver. This will be used in the solution below.

The ideapad_laptop module

The ideapad-laptop module is responsible for talking with the ACPI layer on machines that match “VPC2004″ as a platform (as in /sys/devices/platform/VPC2004:00, or /sys/bus/acpi/devices/VPC2004:00, but doesn’t fit anything found in /sys/class/dmi/id/).

Blacklisting this module has been suggested for Yoga laptops all over the web. In particular this post suggests to insmod the module once with a hack that forces the Wifi on, and then blacklist it.

But by blacklisting ideapad-laptop, the computer loses some precious functionality, including disabling Wifi and the touchpad by pressing a button. So this is not an appealing solution.

Ideapad’s two debugfs output files go:

# cat /sys/kernel/debug/ideapad/cfg cfg: 0x017DE014 Capability: Bluetooth Wireless Camera Graphic: # cat /sys/kernel/debug/ideapad/status Backlight max: 16 Backlight now: 9 BL power value: On ===================== Radio status: Off(0) Wifi status: Off(0) BT status: On(1) 3G status: Off(0) ===================== Touchpad status:Off(0) Camera status: On(1)

So the Radio and Wifi statuses, which are read from the ACPI registers, are off. This makes the ideapad_laptop module conclude that everything should go off.

The solution

In essence, the solution for the problem is to take the ideapad_laptop’s hands off the Wifi hardware, except for turning the hardware block off when it’s loaded. It consists of making the following changes in drivers/platform/x86/ideapad-laptop.c:

  • First, remove the driver’s rfkill registration. Somewhere at the beginning of the file, change #define IDEAPAD_RFKILL_DEV_NUM (3)

    to

    #define IDEAPAD_RFKILL_DEV_NUM (2)

    and in the definition of ideapad_rfk_data[], remove the line saying

    { "ideapad_wlan", CFG_WIFI_BIT, VPCCMD_W_WIFI, RFKILL_TYPE_WLAN }

    This prevents the driver from presenting an rfkill interface, so it keeps its hands off.

  • There is however a chance that the relevant bit in the ACPI layer already has the hardware block on. So let’s turn it off every time the driver loads. In ideapad_acpi_add(), after the call to ideapad_sync_rfk_state(), more or less, add the following two lines: pr_warn("Hack: Forcing WLAN hardware block off\n"); write_ec_cmd(priv->adev->handle, VPCCMD_W_WIFI, 1);
  • And finally, solve a rather bizarre phenomenon, that when reading for the RF state with a VPCCMD_R_RF command, the Wifi interface is hardware blocked for some reason. Note that radio is always in off mode, so it’s a meaningless register on Yoga 2. This is handled in two places. First, empty ideapad_sync_rfk_state() completely, by turning it into static void ideapad_sync_rfk_state(struct ideapad_private *priv) { }

    This function reads VPCCMD_R_RF and calls rfkill_set_hw_state() accordingly, but on Yoga 2 it will always block everything, so what’s the point?
    Next, in debugfs_status_show() which prints out /sys/kernel/debug/ideapad/status, remove the following three lines:

    if (!read_ec_data(priv->adev->handle, VPCCMD_R_RF, &value)) seq_printf(s, "Radio status:\t%s(%lu)\n", value ? "On" : "Off", value);

Having these changes made, the Wifi works properly, regardless of it was previously reported hardware blocked.

This can’t be submitted as a patch to the kernel, because presumably some laptops need the rfkill interface for Wifi through ideapad_laptop (or else, why was it put there in the first place?).

Also, maybe I should have done this for Bluetooth too? Don’t know. I don’t use Bluetooth right now, and the desktop applet seems to say all is fine with it anyhow.

Download the driver fix

For the lazy ones, I’ve prepared a little kit for compiling the relevant driver. I’ve taken the driver as it appears in kernel 3.16, more or less, and applied the changes above. And I then added a Makefile to make it compile easily. Since the kernel API changes rather rapidly, this will probably work well for kernels around 3.16 (that includes 3.13), and then you’ll have to apply the changes manually. If it isn’t fixed in the kernel itself by then.

Download it from here, unzip it, change directory, and compile it with typing “make”. This works only if you have the kernel headers and gcc compiler installed, which is usually the case in recent distributions. So a session like this is expected:

$ make make -C /lib/modules/3.13.0-32-generic/build SUBDIRS=/home/eli/yoga-wifi-fix modules make[1]: Entering directory `/usr/src/linux-headers-3.13.0-32-generic' CC [M] /home/eli/yoga-wifi-fix/ideapad-laptop.o Building modules, stage 2. MODPOST 1 modules CC /home/eli/yoga-wifi-fix/ideapad-laptop.mod.o LD [M] /home/eli/yoga-wifi-fix/ideapad-laptop.ko make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-32-generic'

Then replace the fresh ideapad-laptop.ko with the one the kernel uses. First, let’s figure out where to. The modinfo command help here:

$ modinfo ideapad_laptop filename: /lib/modules/3.13.0-32-generic/kernel/drivers/platform/x86/ideapad-laptop.ko license: GPL description: IdeaPad ACPI Extras author: David Woodhouse <[email protected]> srcversion: BA339D663FA3B10105A1DC0 alias: acpi*:VPC2004:* depends: sparse-keymap vermagic: 3.13.0-32-generic SMP mod_unload modversions parm: no_bt_rfkill:No rfkill for bluetooth. (bool)

So the directory is now known (marked in red). This leaves us with copying it into the right place:

$ sudo cp ideapad-laptop.ko /lib/modules/3.13.0-32-generic/kernel/drivers/platform/x86/

The new module is valid on the next reboot. Or the next insmod/modprobe, if you’re have the same allergy as myself regarding rebooting a Linux system.

Posted Under: Internet,Linux,Linux kernel,wifi
This post was written by eli on August 1, 2014 Comments (82)