LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Wireles Atheros 5523 on Slackware 13.37 (http://www.linuxquestions.org/questions/slackware-14/wireles-atheros-5523-on-slackware-13-37-a-923493/)

gustavolz 01-12-2012 05:43 PM

Wireles Atheros 5523 on Slackware 13.37
 
Hi everyone!
So, that's is my problem:
I trying to make my Wireless USB Adapter work on Slack 13.37 and get the network WPA2-PSK. I already installed the windows driver by ndiswrapper and set the wpa_supplicant by:
Quote:

$ wpa_passphrase mynetwork mypassphrase
$ wpa_passphrase mynetwork mypassphrase > /etc/wpa_supplicant.conf
Until here it's ok. I initiate my USB Adapter by modprobe ndiswrapper, and it's flashing normally.
But for active the wpa_supplicant that's getting hard. Has to use this command, hasn't?
Quote:

wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf -d -D madwifi
But the madwifi isn't installed, and i'm not getting installe it, i think has something to do with kernel version, i'm new on distributions Linux so i don't know how. I tryed follow some tutorials of the forum but none work. I also tryed enter on my network by wicd, and it's showing all the networks availables, but when i try to connect at my network, stop on "Obtaining IP Address".

On Ubuntu it's just install the driver from Windows by ndiswrapper, and give a modprobe ndiswrapper that's OK.

So, any tip? :D

Uzuki 01-12-2012 11:30 PM

get the driver from http://linuxwireless.org/. Pick the latest one (choose bleeding edge download) and then you just need to extract, compile and install and don't forget to reboot after you finished. You must have kernel source installed. I did it on my laptop. It works.

gustavolz 01-13-2012 12:06 AM

The AR5523 driver?
On the page is showing this link: http://svn.berlios.de/svnroot/repos/.../ar5523/trunk/
So what i do next?
Sorry about that, how i said, i'm a new user.

Uzuki 01-13-2012 01:52 AM

Quote:

Originally Posted by gustavolz (Post 4573309)
The AR5523 driver?
On the page is showing this link: http://svn.berlios.de/svnroot/repos/.../ar5523/trunk/
So what i do next?
Sorry about that, how i said, i'm a new user.

Based on http://svn.berlios.de/svnroot/repos/...bian/changelog, the changelog last update was June 02, 2011. It's possible that they have a working driver by now. If you want the easy way, go to http://linuxwireless.org/download/compat-wireless-2.6/ and download the latest release (see the date). After you download, extract it. Make sure you have kernel source installed. Go inside the directory and run this command as root.
Code:

make
make install

reboot after you finish.

gustavolz 01-13-2012 11:36 AM

I made sure that the kernel headers, modules and source were installed, but during the "make" an error shows up, i copied just the part when the error appears:
Quote:

CC [M] /home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.o
/home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c: In function 'iwl_trans_rx_alloc':
/home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:91:2: error: implicit declaration of function 'dma_zalloc_coherent'
/home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:91:10: warning: assignment makes pointer from integer without a cast
/home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:97:15: warning: assignment makes pointer from integer without a cast
make[4]: *** [/home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.o] Error 1
make[3]: *** [/home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi] Error 2
make[2]: *** [/home/gustavo/Desktop/compat-wireless-2012-01-12/drivers/net/wireless] Error 2
make[1]: *** [_module_/home/gustavo/Desktop/compat-wireless-2012-01-12] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.6'
make: *** [modules] Error 2

gustavolz 01-16-2012 09:23 AM

So guys, any other tip?
I'm really thinking that the problem is it madwifi, and i'm not getting install it.

Ficelle 01-16-2012 10:03 AM

I had the same error as yours, and found the solution in:
comments.gmane.org/gmane.linux.kernel.wireless.general/83960
(sorry this is my first post and then I cannot write URLs)

My kernel is indeed older than 3.2.
What I did (since the information on the link are not very talkative) is that I just copied into iwl-trans-pcie.c (just after the "includes") the definition of the function dma_zalloc_coherent:
static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flag)
{
void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
if (ret)
memset(ret, 0, size);
return ret;
}

And I was able to build successfully!

gustavolz 01-16-2012 11:14 PM

Now it's giving this error:
Quote:

CC [M] /root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.o
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:85:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:85:22: error: too many decimal points in number
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:88:35: error: too many decimal points in number
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:88:64: error: too many decimal points in number
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:90:28: error: too many decimal points in number
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:91:28: error: too many decimal points in number
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:92:1: error: stray '@' in program
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:92:1: error: stray '@' in program
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:92:1: error: stray '@' in program
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:92:1: error: stray '@' in program
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c: In function '__inittest':
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:93:10: error: '__platform_driver_init' undeclared (first use in this function)
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:93:10: note: each undeclared identifier is reported only once for each function it appears in
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c: In function '__platform_driver_exit':
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:93:10: error: implicit declaration of function 'platform_driver_unregister'
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:93:10: error: '__platform_driver' undeclared (first use in this function)
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c: At top level:
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:96:1: error: expected identifier or '(' before '+' token
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:104:1: error: expected identifier or '(' before '+' token
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:105:3: error: #endif without #if
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:107:3: error: #endif without #if
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c: In function 'iwl_rx_init':
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:226:3: error: implicit declaration of function 'iwl_trans_rx_alloc'
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c: At top level:
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:93:10: error: 'init_module' aliased to undefined symbol '__platform_driver_init'
/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c:93:10: error: 'init_module' aliased to undefined symbol '__platform_driver_init'
make[4]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi/iwl-trans-pcie.o] Error 1
make[3]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless/iwlwifi] Error 2
make[2]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless] Error 2
make[1]: *** [_module_/root/compat-wireless-2012-01-12] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.6'
make: *** [modules] Error 2
I'm not a real programmer so i don't know what's the error, but i did the upload of the file:
http://www.mediafire.com/?v7fw92bcoiov72c

If i made something wrong or stupid (what i think that happened), sorry :D

Ficelle 01-17-2012 03:34 AM

That was a good idea to post your file, and indeed there is an error. ;)
Actually it seems you have integrated both corrections: mine, and the complete one as suggested by the link I gave.
So, just remove all the block from lines 85 to 108:
include/linux/compat-3.2.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h
index fb9ef68..a17c4ad 100644
--- a/include/linux/compat-3.2.h
+++ b/include/linux/compat-3.2.h
@@ -64,6 +64,15 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
module_driver(__platform_driver, platform_driver_register, \
platform_driver_unregister)

+static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
+ dma_addr_t *dma_handle, gfp_t flag)
+{
+ void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
+ if (ret)
+ memset(ret, 0, size);
+ return ret;
+}
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */

#endif /* LINUX_3_2_COMPAT_H */
--

Then it should work.

gustavolz 01-17-2012 09:03 AM

Oh man, when the "make" passed the iwl-trans-pcie i was so happy... Then this:
Quote:

CC [M] /root/compat-wireless-2012-01-12/drivers/net/wireless/wl12xx/sdio.o
/root/compat-wireless-2012-01-12/drivers/net/wireless/wl12xx/sdio.c: In function 'wl12xx_sdio_power_on':
/root/compat-wireless-2012-01-12/drivers/net/wireless/wl12xx/sdio.c:126:2: error: implicit declaration of function 'pm_runtime_enabled'
make[4]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless/wl12xx/sdio.o] Error 1
make[3]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless/wl12xx] Error 2
make[2]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless] Error 2
make[1]: *** [_module_/root/compat-wireless-2012-01-12] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.6'
make: *** [modules] Error 2
The code of sdio.c:

Quote:

static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
{
int ret;
struct sdio_func *func = dev_to_sdio_func(glue->dev);

/* If enabled, tell runtime PM not to power off the card */
if (pm_runtime_enabled(&func->dev)) {
ret = pm_runtime_get_sync(&func->dev);
if (ret < 0)
goto out;
} else {
/* Runtime PM is disabled: power up the card manually */
ret = mmc_power_restore_host(func->card->host);
if (ret < 0)
goto out;
}

sdio_claim_host(func);
sdio_enable_func(func);

out:
return ret;
}

static int wl12xx_sdio_power_off(struct wl12xx_sdio_glue *glue)
{
int ret;
struct sdio_func *func = dev_to_sdio_func(glue->dev);

sdio_disable_func(func);
sdio_release_host(func);

/* Power off the card manually, even if runtime PM is enabled. */
ret = mmc_power_save_host(func->card->host);
if (ret < 0)
return ret;

/* If enabled, let runtime PM know the card is powered off */
if (pm_runtime_enabled(&func->dev))
ret = pm_runtime_put_sync(&func->dev);

return ret;
}
This is "C" isn't? I'll have to learn. And how i put a scrollbar on the quote?
Anyway, this is the entire code:
http://www.mediafire.com/?4yex4swu27d3f1f

Ficelle 01-17-2012 09:28 AM

It seems that you don't have Linux headers installed.
(to answer your question, yes, this is C code)
(but for your 2nd question about the scrollbar, I have no idea. I am a newbie, like you! :-) )
Linux headers are files were all the references to Linux functions are declared.

In order to do this (I just did it yesterday too when installing my compat-wireless package) you have to run:
/lib/modules/`uname -r`/build
as specified by the linuxwireless page (search for "headers" in: http://linuxwireless.org/en/users/Download)

I think it should help (at least to go further).

gustavolz 01-17-2012 10:18 AM

bash: /lib/modules/2.6.37.6-smp/build: is a directory
In the folder modules has the folder 2.6.37.6 and 2.6.37.6-smp. My kernel version is 2.6.37.6-smp.
I already installed the kernel-headers and i did again just for confirm:
+==============================================================================
| Skipping package kernel-headers-2.6.37.6_smp-x86-2 (already installed)
+=============================

Ficelle 01-17-2012 10:44 AM

OK.
Then I don't know.
My kernel is 3.0.0-14-generic and I didn't get this issue.
When looking for pm_runtime_enabled function in Google, I saw that it is defined in include/linux/pm_runtime.h.
Just need to find where it is (or should be) and why you don't have it.

Somebody else's help would be good now... because I am not an expert at all.

gustavolz 01-17-2012 03:43 PM

Ok, i'm really thankful for your help.
I found a guy in a Russian forum that has the exacly problem, i don't if find this forum too. No one solved the problem, the last post was yesterday.

gustavolz 01-21-2012 06:16 AM

So, i research a little and find a provisional solution...
I added to the code on /include/linux/compat-2.6.37.h or something like that.

Quote:

static inline bool pm_runtime_enabled(struct device *dev)
{
return !dev->power.disable_depth;
}

/* Exponentially weighted moving average (EWMA) */
But another error shows up... I'm almost given up. But, here goes:

Quote:

CC [M] /root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi/base.o
/root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi/base.c:30:0: warning: "pr_fmt" redefined
include/linux/printk.h:161:0: note: this is the location of the previous definition

CC [M] /root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi/cam.o
/root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi/cam.c:30:0: warning: "pr_fmt" redefined
include/linux/printk.h:161:0: note: this is the location of the previous definition

CC [M] /root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi/core.o
/root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi/core.c:1154:1: internal compiler error: in pop_scope, at c-decl.c:1248
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[4]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi/core.o] Error 1
make[3]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless/rtlwifi] Error 2
make[2]: *** [/root/compat-wireless-2012-01-12/drivers/net/wireless] Error 2
make[1]: *** [_module_/root/compat-wireless-2012-01-12] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.37.6'
make: *** [modules] Error 2
So guys, any type?


All times are GMT -5. The time now is 07:21 AM.