Sergio,
Maybe the actual problem is that 62 is not a multiple of 4. the
sizeof(void (*)) should be 4 on 32 bit platforms. So if you read that; you
get:
> 62-8 (=54)
> 54 / 4 (=13.5)
On the old value you get
> 48-8 (=40)
> 40/4 (=10)
What happens if you change it to
char cb[64];
The compiler could be having a issue because of 13.5 and just masking the
issue until later. (Gotta love C/C++ compilers, you can chase your tail
sometimes <G>)
Nathan
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Sergio Lembo
Sent: Thursday, June 17, 2010 1:59 PM
To: [email protected]
Subject: RE: N900 kernel 2.6.28 no compiles after changing cb[] array size
Hi,
Thank you for your answer.
I observe that in include/net/mac80211.h the defines pasted below are
introducing a non-linear sizing (observe the hardcoded number 8) that may
cause problems for some ranges and thus validating (sizeof(struct
ieee80211_tx_info) > sizeof(skb->cb)).
#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \
(sizeof(((struct sk_buff *)0)->cb) - 8)
#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
(IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
Although this is not directly the problem that I have and
BUILD_BUG_ON(sizeof(struct ieee80211_tx_info) > sizeof(skb->cb));
is failing for some other reason that I did not find yet..
Regards,
Sergio
Quoting Nathan Anderson <[email protected]>:
> Sergio,
>
> If I had a guess, I would guess that the n900 probably has a
> different set of compile time defines, that cause the ieee80211
> structure to be defined differently on the n900 vs a stock machine.
> The compile time failsafe is to make sure that the structure iee80211 is
larger than skb->cb.
> Run a grep on the code to find out where/how the ieee80211 structure
> is being defined and you will probably find the issue.
>
> Nathan.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Sergio Lembo
> Sent: Thursday, June 17, 2010 3:08 AM
> To: [email protected]
> Subject: N900 kernel 2.6.28 no compiles after changing cb[] array size
>
>
> Hi,
>
> I am having an inconsistent state in the N900 kernel 2.6.28 when I
> make a very simple
> change:
>
> The problem is reproduced easily by just increasing the size of the
> control buffer cb[] in struct sk_buff{} (include/linux/skbuff.h):
>
> - char cb[48];
> -
> + char cb[62];
>
> Using cb[62] I get a compilation error :
>
> CC [M] net/mac80211/main.o
> net/mac80211/main.c: In function 'ieee80211_init':
> net/mac80211/main.c:1026: error: size of array 'type name' is negative
> make[2]: *** [net/mac80211/main.o] Error 1
> make[1]: *** [net/mac80211] Error 2
> make: *** [net] Error 2
>
> The line with the error is a failsafe at compilation time
> (net/mac80211/main.c):
>
> BUILD_BUG_ON(sizeof(struct ieee80211_tx_info) >
> sizeof(skb->cb));
>
> Bypassing such failsafe line the kernel compiles Ok, but the binary
> flashed to the N900 fails to boot the system.
>
> I observe that such compilation error does not happen when
> compiling a plain 2.6.28 kernel for a PC.
>
> And note that this error is just caused by changing the size of
> cb[] from
> 48 to 62; that is the only modification we made to the kernel sources.
>
>
> Regards,
>
> Sergio
>
>
>
> _______________________________________________
> maemo-developers mailing list
> [email protected]
> https://lists.maemo.org/mailman/listinfo/maemo-developers
>
>
--
-----------------------
Sergio Lembo
[email protected]
-----------------------
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers