A problem with header file sonet.h

Bill Fink yellowdog-general@lists.terrasoftsolutions.com
Mon Aug 25 09:08:01 2003


Hi Charles,

On Sun Aug 24 2003, Charles Trois wrote:

> I am trying out speedbundle-1.0, the new package that installs the software
> for the Alcatel SpeedTouch USB modem.
> 
> When I run make in the speedbundle-1.0 directory, it fails; here are the
> last lines of the log:
> 
> <begin quote>
> Making all in maint
> make[4]: Entering directory
> `/home/travaux/adsl/speedbundle-1.0/linux-atm/src/maint'
> gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/qgen -I../../src/saal -I.
> -I../../src/include -g -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings
> -Wstrict-prototypes -c sonetdiag.c
> In file included from sonetdiag.c:18:
> /usr/include/linux/sonet.h:65: parse error before "__SONET_ITEMS"
> make[4]: *** [sonetdiag.o] Error 1
> make[4]: Leaving directory
> `/home/travaux/adsl/speedbundle-1.0/linux-atm/src/maint'
> make[3]: *** [all-recursive] Error 1
> make[3]: Leaving directory
> `/home/travaux/adsl/speedbundle-1.0/linux-atm/src'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/home/travaux/adsl/speedbundle-1.0/linux-atm'
> make[1]: *** [all-recursive-am] Error 2
> make[1]: Leaving directory `/home/travaux/adsl/speedbundle-1.0/linux-atm'
> make: *** [build-stamp] Error 2
> <end quote>
> 
> >From that, it appears that there is something wrong in my copy of sonet.h
> (which comes from YDL 3.0).
> 
> Hence my two questions:
> 
> 1.  How can I get hold of a clean copy of this sonet.h file?
> 
> 2.  Alternatively, I could try to put things right by editing the file.
> Although I have some knowledge of C, I cannot spot the error(s). Below is
> the copy of my sonet.h, in case someone more experienced than me can see the
> solution.

I don't know anything about the speedbundle package, but the include
file /usr/include/linux/sonet.h does appear to be really messed up.
If you compare it with the kernel version /usr/src/linux/include/linux/sonet.h,
you will see the following in the kernel version:

#ifndef __KERNEL__
#undef __SONET_ITEMS
#else

#include <asm/atomic.h>

struct k_sonet_stats {
#define __HANDLE_ITEM(i) atomic_t i
        __SONET_ITEMS
#undef __HANDLE_ITEM
};

extern void sonet_copy_stats(struct k_sonet_stats *from,struct sonet_stats *to);
extern void sonet_subtract_stats(struct k_sonet_stats *from,
    struct sonet_stats *to);

#endif

So everything in the #else section shouldn't appear in the
/usr/include/linux/sonet.h version of the include file, but in
fact it does.  This even causes there to be two #endif statements
to only one #if statement (and I see you have commented one of
them out.  So you should be able to delete everything from the
#else section that appears incorrectly in the /usr/include/linux/sonet.h
include file (keep a backup copy first), and see if that helps.

						-Bill