2011-10-11 3 views
0

안녕하세요 내가 아래의 구조체에 정의 된 psched_time_t에 문제가 발생했습니다. 해당 헤더 파일이 포함되어 있지 않고 #include 인 파일을 포함하고이 파일에서 psched_time_t가 선언되었을 때 발생합니다. 그래서 내가 뭘 잘못하고 있니? 도와주세요포함/net/sch_generic.h : 199 : 오류 : 'psched_time_t'전에 예상 지정자 - 한정자 목록

 #ifndef __NET_SCHED_GENERIC_H 
    #define __NET_SCHED_GENERIC_H 

    #include <linux/netdevice.h> 
    #include <linux/types.h> 
    #include <linux/rcupdate.h> 
    #include <linux/module.h> 
    #include <linux/pkt_sched.h> 
    #include <linux/pkt_cls.h> 
    #include <net/gen_stats.h> 
    #include <net/rtnetlink.h> 


    struct agg_queue { 
      __be32    dest; 
      __u32    currSize; 
      __u32    maxSize; 
      psched_time_t  timestamp; //this is where the error is 
      struct agg_queue *next; 
      struct sk_buff_head skb_head; 

      }; 

아래의 파일 psched_time_t가 정의입니다 순/pkt_sched.h :

#ifndef __NET_PKT_SCHED_H 
#define __NET_PKT_SCHED_H 
#include <linux/jiffies.h> 
#include <linux/ktime.h> 
#include <net/sch_generic.h> 

    struct qdisc_walker { 
    int  stop; 
    int  skip; 
    int  count; 
    int  (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *); 

};

#define QDISC_ALIGNTO   64 
#define QDISC_ALIGN(len)  (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1)) 

    static inline void *qdisc_priv(struct Qdisc *q) 
    { 
     return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc)); 
     } 

    typedef u64  psched_time_t; 
    typedef long psched_tdiff_t; 

    /* Avoid doing 64 bit divide */ 
    #define PSCHED_SHIFT     6 
    #define PSCHED_TICKS2NS(x)    ((s64)(x) << PSCHED_SHIFT) 
    #define PSCHED_NS2TICKS(x)    ((x) >> PSCHED_SHIFT) 

    #define PSCHED_TICKS_PER_SEC   PSCHED_NS2TICKS(NSEC_PER_SEC) 
    #define PSCHED_PASTPERFECT    0 

    static inline psched_time_t psched_get_time(void) 
    { 
     return PSCHED_NS2TICKS(ktime_to_ns(ktime_get())); 
     } 

답변

0

어디서나 # ifdefs/# ifndefs하지만 #endif는 보이지 않습니다. 아시다시피, 전자는 각각 후자 중 하나가 필요합니다. 필요한 곳에 #endifs를 추가하면 더 나아갈 수 있습니다.

편집 : 문제는 psched_time_t이 아니지만 오류 메시지에 표시되는 것처럼 해당 줄 앞에 표시됩니다. 그렇다면 maxSize은 어디에 정의되어 있습니까?

+0

나는 코드의 끝 부분에 #endif를 가지고있다. 나는 문제가되는 부분을 포함했다. – docas

+0

pls 누군가 나를 돕는다. 아직도 붙어있다. – docas

+0

편집 된 답변보기. –

관련 문제