diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-12-26 18:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-12-26 18:37:42 -0800 |
| commit | e3fc88e7bc5fe394401eb60b1cb76aee78bc93b9 (patch) | |
| tree | 2c28be17851a056b24a1ad24f22e31ac3fc46d64 /include | |
| parent | 384263dc669ea70ad850232370541b1219f6b687 (diff) | |
| parent | 3e704faf505f2a676ee5cb372524fc44d6e773ac (diff) | |
Merge bk://linux-acpi.bkbits.net/26-latest-release
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'include')
41 files changed, 618 insertions, 170 deletions
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h index 3c750a362c44..059780a7d3d7 100644 --- a/include/asm-alpha/processor.h +++ b/include/asm-alpha/processor.h @@ -26,12 +26,6 @@ #define TASK_UNMAPPED_BASE \ ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2) -/* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - typedef struct { unsigned long seg; } mm_segment_t; diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index e2de28eec30a..06ab5f106a0f 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h @@ -19,9 +19,6 @@ #ifdef __KERNEL__ -#define MCA_bus 0 -#define MCA_bus__is_a_macro - #include <asm/atomic.h> #include <asm/ptrace.h> #include <asm/procinfo.h> diff --git a/include/asm-arm26/processor.h b/include/asm-arm26/processor.h index 9e0d90433795..1d2d5f7b467b 100644 --- a/include/asm-arm26/processor.h +++ b/include/asm-arm26/processor.h @@ -20,9 +20,6 @@ #ifdef __KERNEL__ -#define MCA_bus 0 -#define MCA_bus__is_a_macro - #include <asm/atomic.h> #include <asm/ptrace.h> #include <linux/string.h> diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h index 59900733c714..c6f0a7108ef3 100644 --- a/include/asm-h8300/processor.h +++ b/include/asm-h8300/processor.h @@ -45,11 +45,6 @@ static inline void wrusp(unsigned long usp) { */ #define TASK_UNMAPPED_BASE 0 -/* - * Bus types - */ -#define MCA_bus 0 - struct thread_struct { unsigned long ksp; /* kernel stack pointer */ unsigned long usp; /* user stack pointer */ diff --git a/include/asm-i386/agp.h b/include/asm-i386/agp.h index 82eb94e284b9..a917ff50354f 100644 --- a/include/asm-i386/agp.h +++ b/include/asm-i386/agp.h @@ -12,8 +12,8 @@ * data corruption on some CPUs. */ -#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE) -#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL) +int map_page_into_agp(struct page *page); +int unmap_page_from_agp(struct page *page); #define flush_agp_mappings() global_flush_tlb() /* Could use CLFLUSH here if the cpu supports it. But then it would diff --git a/include/asm-i386/mca.h b/include/asm-i386/mca.h index 44ba981e711f..09adf2eac4dc 100644 --- a/include/asm-i386/mca.h +++ b/include/asm-i386/mca.h @@ -40,7 +40,4 @@ */ #define MCA_NUMADAPTERS (MCA_MAX_SLOT_NR+3) -/* lock to protect access to the MCA registers */ -extern spinlock_t mca_lock; - #endif diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 147da2f7414b..c9d9c664b557 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -259,11 +259,6 @@ static inline void clear_in_cr4 (unsigned long mask) outb((data), 0x23); \ } while (0) -/* - * Bus types (default is ISA, but people can check others with these..) - */ -extern int MCA_bus; - static inline void __monitor(const void *eax, unsigned long ecx, unsigned long edx) { diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h index 736e3192f464..ee236dd23d97 100644 --- a/include/asm-m68knommu/processor.h +++ b/include/asm-m68knommu/processor.h @@ -55,11 +55,6 @@ extern inline void wrusp(unsigned long usp) */ #define TASK_UNMAPPED_BASE 0 -/* - * Bus types - */ -#define MCA_bus 0 - /* * if you change this structure, you must change the code and offsets * in m68k/machasm.S diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index b461fd0c9831..c815890dde94 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -33,12 +33,6 @@ extern void (*cpu_wait)(void); extern unsigned int vced_count, vcei_count; -/* - * Bus types (default is ISA, but people can check others with these..) - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - #ifdef CONFIG_MIPS32 /* * User space process size: 2GB. This is hardcoded into a few places, diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index 1a886a0f61ff..0b61f51d8467 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h @@ -107,9 +107,6 @@ extern struct cpuinfo_parisc cpu_data[NR_CPUS]; #define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF) -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - typedef struct { int seg; } mm_segment_t; diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index 63fc68e784c5..c8f84c3a56cd 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -78,12 +78,6 @@ extern void prepare_to_copy(struct task_struct *tsk); */ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); -/* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro - /* Lazy FPU handling on uni-processor */ extern struct task_struct *last_task_used_math; extern struct task_struct *last_task_used_altivec; diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index 518f551dba6a..774ca333df35 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h @@ -494,12 +494,6 @@ extern void prepare_to_copy(struct task_struct *tsk); /* Create a new kernel thread. */ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); -/* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - /* Lazy FPU handling on uni-processor */ extern struct task_struct *last_task_used_math; extern struct task_struct *last_task_used_altivec; diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index 5ae342e6b52d..c4904797d6df 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h @@ -191,12 +191,6 @@ extern void release_thread(struct task_struct *); */ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); -/* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - /* Copy and release all segment info associated with a VM */ #define copy_segments(p, mm) do { } while(0) #define release_segments(mm) do { } while(0) diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h index 0f45ae686110..a51bd41e6fbc 100644 --- a/include/asm-sh64/processor.h +++ b/include/asm-sh64/processor.h @@ -218,12 +218,6 @@ extern void release_thread(struct task_struct *); */ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); -/* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - /* Copy and release all segment info associated with a VM */ #define copy_segments(p, mm) do { } while (0) diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index 83feef80c494..32c9699367cf 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h @@ -24,12 +24,6 @@ #include <asm/page.h> /* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - -/* * The sparc has no problems with write protection */ #define wp_works_ok 1 diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index 416fad2ef1b1..bc1445b904ef 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h @@ -21,10 +21,6 @@ #include <asm/segment.h> #include <asm/page.h> -/* Bus types */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - /* The sparc has no problems with write protection */ #define wp_works_ok 1 #define wp_works_ok__is_a_macro /* for versions in ksyms.c */ diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h index b28582ecce02..d41f925f5182 100644 --- a/include/asm-v850/processor.h +++ b/include/asm-v850/processor.h @@ -48,13 +48,6 @@ */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) - -/* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro /* for versions in ksyms.c */ - /* If you change this, you must change the associated assembly-languages constants defined below, THREAD_*. */ struct thread_struct { diff --git a/include/asm-x86_64/agp.h b/include/asm-x86_64/agp.h index ecb3db37b624..0bb9019d58aa 100644 --- a/include/asm-x86_64/agp.h +++ b/include/asm-x86_64/agp.h @@ -10,9 +10,8 @@ * with different cachability attributes for the same page. */ -#define map_page_into_agp(page) \ - change_page_attr(page, 1, PAGE_KERNEL_NOCACHE) -#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL) +int map_page_into_agp(struct page *page); +int unmap_page_from_agp(struct page *page); #define flush_agp_mappings() global_flush_tlb() /* Could use CLFLUSH here if the cpu supports it. But then it would diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 0fc76da585f5..36c04fb3c0d0 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h @@ -157,12 +157,6 @@ static inline void clear_in_cr4 (unsigned long mask) :"ax"); } -/* - * Bus types - */ -#define MCA_bus 0 -#define MCA_bus__is_a_macro - /* * User space process size: 512GB - 1GB (default). diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index 9d2429f07a64..bd4364daf948 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h @@ -25,7 +25,6 @@ #define bool int #endif - /* * RECON_THRESHOLD is the maximum number of RECON messages to receive * within one minute before printing a "cabling problem" warning. The @@ -74,6 +73,7 @@ #define D_SKB 1024 /* show skb's */ #define D_SKB_SIZE 2048 /* show skb sizes */ #define D_TIMING 4096 /* show time needed to copy buffers to card */ +#define D_DEBUG 8192 /* Very detailed debug line for line */ #ifndef ARCNET_DEBUG_MAX #define ARCNET_DEBUG_MAX (127) /* change to ~0 if you want detailed debugging */ @@ -135,6 +135,7 @@ extern int arcnet_debug; #define TXACKflag 0x02 /* transmitted msg. ackd */ #define RECONflag 0x04 /* network reconfigured */ #define TESTflag 0x08 /* test flag */ +#define EXCNAKflag 0x08 /* excesive nak flag */ #define RESETflag 0x10 /* power-on-reset */ #define RES1flag 0x20 /* reserved - usually set by jumper */ #define RES2flag 0x40 /* reserved - usually set by jumper */ @@ -162,6 +163,8 @@ extern int arcnet_debug; #define RESETclear 0x08 /* power-on-reset */ #define CONFIGclear 0x10 /* system reconfigured */ +#define EXCNAKclear 0x0E /* Clear and acknowledge the excive nak bit */ + /* flags for "load test flags" command */ #define TESTload 0x08 /* test flag (diagnostic) */ @@ -187,6 +190,7 @@ extern int arcnet_debug; struct ArcProto { char suffix; /* a for RFC1201, e for ether-encap, etc. */ int mtu; /* largest possible packet */ + int is_ip; /* This is a ip plugin - not a raw thing */ void (*rx) (struct net_device * dev, int bufnum, struct archdr * pkthdr, int length); @@ -197,9 +201,11 @@ struct ArcProto { int (*prepare_tx) (struct net_device * dev, struct archdr * pkt, int length, int bufnum); int (*continue_tx) (struct net_device * dev, int bufnum); + int (*ack_tx) (struct net_device * dev, int acked); }; -extern struct ArcProto *arc_proto_map[256], *arc_proto_default, *arc_bcast_proto; +extern struct ArcProto *arc_proto_map[256], *arc_proto_default, + *arc_bcast_proto, *arc_raw_proto; extern struct ArcProto arc_proto_null; @@ -251,6 +257,10 @@ struct arcnet_local { char *card_name; /* card ident string */ int card_flags; /* special card features */ + + /* On preemtive and SMB a lock is needed */ + spinlock_t lock; + /* * Buffer management: an ARCnet card has 4 x 512-byte buffers, each of * which can be used for either sending or receiving. The new dynamic @@ -279,6 +289,8 @@ struct arcnet_local { int num_recons; /* number of RECONs between first and last. */ bool network_down; /* do we think the network is down? */ + bool excnak_pending; /* We just got an excesive nak interrupt */ + struct { uint16_t sequence; /* sequence number (incs with each packet) */ uint16_t aborted_seq; @@ -323,9 +335,10 @@ void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc); #endif #if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX) -void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc); +void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc, + int take_arcnet_lock); #else -#define arcnet_dump_packet(dev, bufnum, desc) ; +#define arcnet_dump_packet(dev, bufnum, desc,take_arcnet_lock) ; #endif void arcnet_unregister_proto(struct ArcProto *proto); diff --git a/include/linux/com20020.h b/include/linux/com20020.h index c88d530bf637..ac6d9a43e085 100644 --- a/include/linux/com20020.h +++ b/include/linux/com20020.h @@ -34,17 +34,24 @@ int com20020_found(struct net_device *dev, int shared); #define ARCNET_TOTAL_SIZE 8 /* various register addresses */ -#define _INTMASK (ioaddr+0) /* writable */ -#define _STATUS (ioaddr+0) /* readable */ -#define _COMMAND (ioaddr+1) /* standard arcnet commands */ -#define _DIAGSTAT (ioaddr+1) /* diagnostic status register */ -#define _ADDR_HI (ioaddr+2) /* control registers for IO-mapped memory */ -#define _ADDR_LO (ioaddr+3) -#define _MEMDATA (ioaddr+4) /* data port for IO-mapped memory */ -#define _SUBADR (ioaddr+5) /* the extended port _XREG refers to */ -#define _CONFIG (ioaddr+6) /* configuration register */ -#define _XREG (ioaddr+7) /* extra registers (indexed by _CONFIG - or _SUBADR) */ +#ifdef CONFIG_SA1100_CT6001 +#define BUS_ALIGN 2 /* 8 bit device on a 16 bit bus - needs padding */ +#else +#define BUS_ALIGN 1 +#endif + + +#define _INTMASK (ioaddr+BUS_ALIGN*0) /* writable */ +#define _STATUS (ioaddr+BUS_ALIGN*0) /* readable */ +#define _COMMAND (ioaddr+BUS_ALIGN*1) /* standard arcnet commands */ +#define _DIAGSTAT (ioaddr+BUS_ALIGN*1) /* diagnostic status register */ +#define _ADDR_HI (ioaddr+BUS_ALIGN*2) /* control registers for IO-mapped memory */ +#define _ADDR_LO (ioaddr+BUS_ALIGN*3) +#define _MEMDATA (ioaddr+BUS_ALIGN*4) /* data port for IO-mapped memory */ +#define _SUBADR (ioaddr+BUS_ALIGN*5) /* the extended port _XREG refers to */ +#define _CONFIG (ioaddr+BUS_ALIGN*6) /* configuration register */ +#define _XREG (ioaddr+BUS_ALIGN*7) /* extra registers (indexed by _CONFIG + or _SUBADR) */ /* in the ADDR_HI register */ #define RDDATAflag 0x80 /* next access is a read (not a write) */ @@ -99,6 +106,7 @@ int com20020_found(struct net_device *dev, int shared); } #define ASTATUS() inb(_STATUS) +#define ADIAGSTATUS() inb(_DIAGSTAT) #define ACOMMAND(cmd) outb((cmd),_COMMAND) #define AINTMASK(msk) outb((msk),_INTMASK) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 0f0d8a9f5b53..4626d40e8c6e 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -56,6 +56,9 @@ #define CRYPTO_UNSPEC 0 #define CRYPTO_MAX_ALG_NAME 64 +#define CRYPTO_DIR_ENCRYPT 1 +#define CRYPTO_DIR_DECRYPT 0 + struct scatterlist; /* diff --git a/include/linux/if_arcnet.h b/include/linux/if_arcnet.h index 08f413b0fceb..af380cb876a0 100644 --- a/include/linux/if_arcnet.h +++ b/include/linux/if_arcnet.h @@ -23,6 +23,9 @@ * These are the defined ARCnet Protocol ID's. */ +/* CAP mode */ +/* No macro but uses 1-8 */ + /* RFC1201 Protocol ID's */ #define ARC_P_IP 212 /* 0xD4 */ #define ARC_P_IPV6 196 /* 0xC4: RFC2497 */ @@ -86,6 +89,16 @@ struct arc_eth_encap #define ETH_ENCAP_HDR_SIZE 14 +struct arc_cap +{ + uint8_t proto; + uint8_t cookie[sizeof(int)]; /* Actually NOT sent over the network */ + union { + uint8_t ack; + uint8_t raw[0]; /* 507 bytes */ + } mes; +}; + /* * The data needed by the actual arcnet hardware. * @@ -116,6 +129,7 @@ struct archdr struct arc_rfc1201 rfc1201; struct arc_rfc1051 rfc1051; struct arc_eth_encap eth_encap; + struct arc_cap cap; uint8_t raw[0]; /* 508 bytes */ } soft; }; diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 4037aaab7aa9..75c1a290c8c2 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -91,6 +91,7 @@ #define ETH_P_IRDA 0x0017 /* Linux-IrDA */ #define ETH_P_ECONET 0x0018 /* Acorn Econet */ #define ETH_P_HDLC 0x0019 /* HDLC frames */ +#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ /* * This is an Ethernet frame header. diff --git a/include/linux/mca.h b/include/linux/mca.h index a80124c4a05d..5cff2923092b 100644 --- a/include/linux/mca.h +++ b/include/linux/mca.h @@ -6,22 +6,14 @@ #ifndef _LINUX_MCA_H #define _LINUX_MCA_H -/* FIXME: This shouldn't happen, but we need everything that previously - * included mca.h to compile. Take it out later when the MCA #includes - * are sorted out */ #include <linux/device.h> -/* get the platform specific defines */ #ifdef CONFIG_MCA #include <asm/mca.h> -#endif -/* The detection of MCA bus is done in the real mode (using BIOS). - * The information is exported to the protected code, where this - * variable is set to one in case MCA bus was detected. - */ -#ifndef MCA_bus__is_a_macro -extern int MCA_bus; +extern int MCA_bus; +#else +#define MCA_bus 0 #endif /* This sets up an information callback for /proc/mca/slot?. The diff --git a/include/linux/netfilter_bridge/ebt_ulog.h b/include/linux/netfilter_bridge/ebt_ulog.h new file mode 100644 index 000000000000..b677e2671541 --- /dev/null +++ b/include/linux/netfilter_bridge/ebt_ulog.h @@ -0,0 +1,36 @@ +#ifndef _EBT_ULOG_H +#define _EBT_ULOG_H + +#define EBT_ULOG_DEFAULT_NLGROUP 0 +#define EBT_ULOG_DEFAULT_QTHRESHOLD 1 +#define EBT_ULOG_MAXNLGROUPS 32 /* hardcoded netlink max */ +#define EBT_ULOG_PREFIX_LEN 32 +#define EBT_ULOG_MAX_QLEN 50 +#define EBT_ULOG_WATCHER "ulog" +#define EBT_ULOG_VERSION 1 + +struct ebt_ulog_info { + uint32_t nlgroup; + unsigned int cprange; + unsigned int qthreshold; + char prefix[EBT_ULOG_PREFIX_LEN]; +}; + +typedef struct ebt_ulog_packet_msg { + int version; + char indev[IFNAMSIZ]; + char outdev[IFNAMSIZ]; + char physindev[IFNAMSIZ]; + char physoutdev[IFNAMSIZ]; + char prefix[EBT_ULOG_PREFIX_LEN]; + struct timeval stamp; + unsigned long mark; + unsigned int hook; + size_t data_len; + /* The complete packet, including Ethernet header and perhaps + * the VLAN header is appended */ + unsigned char data[0] __attribute__ + ((aligned (__alignof__(struct ebt_ulog_info)))); +} ebt_ulog_packet_msg_t; + +#endif /* _EBT_ULOG_H */ diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index b9fcbf85f047..b1a7cc90877b 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h @@ -201,9 +201,9 @@ struct ebt_watcher { struct list_head list; const char name[EBT_FUNCTION_MAXNAMELEN]; - void (*watcher)(const struct sk_buff *skb, const struct net_device *in, - const struct net_device *out, const void *watcherdata, - unsigned int datalen); + void (*watcher)(const struct sk_buff *skb, unsigned int hooknr, + const struct net_device *in, const struct net_device *out, + const void *watcherdata, unsigned int datalen); /* 0 == let it in */ int (*check)(const char *tablename, unsigned int hookmask, const struct ebt_entry *e, void *watcherdata, unsigned int datalen); diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index c4a3622604b7..16fc49298174 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h @@ -11,13 +11,8 @@ enum ip_nat_manip_type IP_NAT_MANIP_DST }; -#ifndef CONFIG_IP_NF_NAT_LOCAL -/* SRC manip occurs only on POST_ROUTING */ -#define HOOK2MANIP(hooknum) ((hooknum) != NF_IP_POST_ROUTING) -#else /* SRC manip occurs POST_ROUTING or LOCAL_IN */ #define HOOK2MANIP(hooknum) ((hooknum) != NF_IP_POST_ROUTING && (hooknum) != NF_IP_LOCAL_IN) -#endif #define IP_NAT_RANGE_MAP_IPS 1 #define IP_NAT_RANGE_PROTO_SPECIFIED 2 diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 5b149a650793..b99e86369597 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -176,10 +176,20 @@ #define PCI_DEVICE_ID_LSI_FC919 0x0624 #define PCI_DEVICE_ID_LSI_FC919_LAN 0x0625 #define PCI_DEVICE_ID_LSI_FC929X 0x0626 +#define PCI_DEVICE_ID_LSI_FC939X 0x0642 +#define PCI_DEVICE_ID_LSI_FC949X 0x0640 #define PCI_DEVICE_ID_LSI_FC919X 0x0628 #define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701 #define PCI_DEVICE_ID_LSI_61C102 0x0901 #define PCI_DEVICE_ID_LSI_63C815 0x1000 +#define PCI_DEVICE_ID_LSI_SAS1064 0x0050 +#define PCI_DEVICE_ID_LSI_SAS1066 0x005E +#define PCI_DEVICE_ID_LSI_SAS1068 0x0054 +#define PCI_DEVICE_ID_LSI_SAS1064A 0x005C +#define PCI_DEVICE_ID_LSI_SAS1064E 0x0056 +#define PCI_DEVICE_ID_LSI_SAS1066E 0x005A +#define PCI_DEVICE_ID_LSI_SAS1068E 0x0058 +#define PCI_DEVICE_ID_LSI_SAS1078 0x0060 #define PCI_VENDOR_ID_ATI 0x1002 /* Mach64 */ @@ -1017,6 +1027,7 @@ #define PCI_DEVICE_ID_AL_M1531 0x1531 #define PCI_DEVICE_ID_AL_M1533 0x1533 #define PCI_DEVICE_ID_AL_M1541 0x1541 +#define PCI_DEVICE_ID_AL_M1543 0x1543 #define PCI_DEVICE_ID_AL_M1563 0x1563 #define PCI_DEVICE_ID_AL_M1621 0x1621 #define PCI_DEVICE_ID_AL_M1631 0x1631 @@ -1026,7 +1037,9 @@ #define PCI_DEVICE_ID_AL_M1647 0x1647 #define PCI_DEVICE_ID_AL_M1651 0x1651 #define PCI_DEVICE_ID_AL_M1671 0x1671 -#define PCI_DEVICE_ID_AL_M1543 0x1543 +#define PCI_DEVICE_ID_AL_M1681 0x1681 +#define PCI_DEVICE_ID_AL_M1683 0x1683 +#define PCI_DEVICE_ID_AL_M1689 0x1689 #define PCI_DEVICE_ID_AL_M3307 0x3307 #define PCI_DEVICE_ID_AL_M4803 0x5215 #define PCI_DEVICE_ID_AL_M5219 0x5219 diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 45ac289f1bbf..45ed903d247c 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h @@ -192,6 +192,7 @@ enum TCA_U32_ACT, TCA_U32_INDEV, TCA_U32_PCNT, + TCA_U32_MARK, __TCA_U32_MAX }; diff --git a/include/linux/random.h b/include/linux/random.h index 4aaffb57349d..bb7c6e64e3eb 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -52,6 +52,7 @@ extern void get_random_bytes(void *buf, int nbytes); void generate_random_uuid(unsigned char uuid_out[16]); extern __u32 secure_ip_id(__u32 daddr); +extern u32 secure_tcp_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, __u16 sport, __u16 dport); extern __u32 secure_tcp_syn_cookie(__u32 saddr, __u32 daddr, diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 71fc2bdc0cd6..57a2843faa21 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -292,6 +292,8 @@ struct sk_buff { extern void __kfree_skb(struct sk_buff *skb); extern struct sk_buff *alloc_skb(unsigned int size, int priority); +extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, + unsigned int size, int priority); extern void kfree_skbmem(struct sk_buff *skb); extern struct sk_buff *skb_clone(struct sk_buff *skb, int priority); extern struct sk_buff *skb_copy(const struct sk_buff *skb, int priority); @@ -935,6 +937,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) * * %NULL is returned in there is no free memory. */ +#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB static inline struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask) { @@ -943,6 +946,9 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length, skb_reserve(skb, 16); return skb; } +#else +extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask); +#endif /** * dev_alloc_skb - allocate an skbuff for sending diff --git a/include/linux/swap.h b/include/linux/swap.h index b0f07148e0eb..10eb41367104 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -269,6 +269,7 @@ static inline void put_swap_token(struct mm_struct *mm) #define move_from_swap_cache(p, i, m) 1 #define __delete_from_swap_cache(p) /*NOTHING*/ #define delete_from_swap_cache(p) /*NOTHING*/ +#define swap_token_default_timeout 0 static inline int remove_exclusive_swap_page(struct page *p) { diff --git a/include/net/act_api.h b/include/net/act_api.h index 749637e1694d..221ea5ed6b34 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -76,8 +76,8 @@ extern int tcf_register_action(struct tc_action_ops *a); extern int tcf_unregister_action(struct tc_action_ops *a); extern void tcf_action_destroy(struct tc_action *a, int bind); extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res); -extern int tcf_action_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind); -extern int tcf_action_init_1(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind); +extern struct tc_action *tcf_action_init(struct rtattr *rta, struct rtattr *est, char *n, int ovr, int bind, int *err); +extern struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, char *n, int ovr, int bind, int *err); extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 3dd20562a196..973680c7537e 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -70,17 +70,10 @@ tcf_change_act_police(struct tcf_proto *tp, struct tc_action **action, int ret; struct tc_action *act; - act = kmalloc(sizeof(*act), GFP_KERNEL); - if (NULL == act) - return -ENOMEM; - memset(act, 0, sizeof(*act)); - - ret = tcf_action_init_1(act_police_tlv, rate_tlv, act, "police", - TCA_ACT_NOREPLACE, TCA_ACT_BIND); - if (ret < 0) { - tcf_action_destroy(act, TCA_ACT_UNBIND); + act = tcf_action_init_1(act_police_tlv, rate_tlv, "police", + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &ret); + if (act == NULL) return ret; - } act->type = TCA_OLD_COMPAT; @@ -103,17 +96,10 @@ tcf_change_act(struct tcf_proto *tp, struct tc_action **action, int ret; struct tc_action *act; - act = kmalloc(sizeof(*act), GFP_KERNEL); - if (NULL == act) - return -ENOMEM; - memset(act, 0, sizeof(*act)); - - ret = tcf_action_init(act_tlv, rate_tlv, act, NULL, - TCA_ACT_NOREPLACE, TCA_ACT_BIND); - if (ret < 0) { - tcf_action_destroy(act, TCA_ACT_UNBIND); + act = tcf_action_init(act_tlv, rate_tlv, NULL, + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &ret); + if (act == NULL) return ret; - } if (*action) { tcf_tree_lock(tp); diff --git a/include/net/x25.h b/include/net/x25.h index 0db97e75853f..53a19c468c1b 100644 --- a/include/net/x25.h +++ b/include/net/x25.h @@ -243,6 +243,7 @@ extern int x25_validate_nr(struct sock *, unsigned short); extern void x25_write_internal(struct sock *, int); extern int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *, int *); extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char); +extern int x25_check_calluserdata(struct x25_calluserdata *,struct x25_calluserdata *); /* x25_timer.c */ extern void x25_start_heartbeat(struct sock *); diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 0be7907110e2..a22a274fbd7a 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -216,13 +216,35 @@ struct scsi_host_template { void (* slave_destroy)(struct scsi_device *); /* + * fill in this function to allow the queue depth of this host + * to be changeable (on a per device basis). returns either + * the current queue depth setting (may be different from what + * was passed in) or an error. An error should only be + * returned if the requested depth is legal but the driver was + * unable to set it. If the requested depth is illegal, the + * driver should set and return the closest legal queue depth. + * + */ + int (* change_queue_depth)(struct scsi_device *, int); + + /* + * fill in this function to allow the changing of tag types + * (this also allows the enabling/disabling of tag command + * queueing). An error should only be returned if something + * went wrong in the driver while trying to set the tag type. + * If the driver doesn't support the requested tag type, then + * it should set the closest type it does support without + * returning an error. Returns the actual tag type set. + */ + int (* change_queue_type)(struct scsi_device *, int); + + /* * This function determines the bios parameters for a given * harddisk. These tend to be numbers that are made up by * the host adapter. Parameters: * size, device, list (heads, sectors, cylinders) * - * Status: OPTIONAL - */ + * Status: OPTIONAL */ int (* bios_param)(struct scsi_device *, struct block_device *, sector_t, int []); @@ -527,6 +549,9 @@ struct Scsi_Host { extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int); extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *); extern void scsi_scan_host(struct Scsi_Host *); +extern void scsi_scan_single_target(struct Scsi_Host *, unsigned int, + unsigned int); +extern void scsi_rescan_device(struct device *); extern void scsi_remove_host(struct Scsi_Host *); extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); extern void scsi_host_put(struct Scsi_Host *t); diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 78039d0f1a57..e47e36a4ef49 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h @@ -13,6 +13,43 @@ #define SCSI_NO_TAG (-1) /* identify no tag in use */ + +/** + * scsi_get_tag_type - get the type of tag the device supports + * @sdev: the scsi device + * + * Notes: + * If the drive only supports simple tags, returns MSG_SIMPLE_TAG + * if it supports all tag types, returns MSG_ORDERED_TAG. + */ +static inline int scsi_get_tag_type(struct scsi_device *sdev) +{ + if (!sdev->tagged_supported) + return 0; + if (sdev->ordered_tags) + return MSG_ORDERED_TAG; + if (sdev->simple_tags) + return MSG_SIMPLE_TAG; + return 0; +} + +static inline void scsi_set_tag_type(struct scsi_device *sdev, int tag) +{ + switch (tag) { + case MSG_ORDERED_TAG: + sdev->ordered_tags = 1; + /* fall through */ + case MSG_SIMPLE_TAG: + sdev->simple_tags = 1; + break; + case 0: + /* fall through */ + default: + sdev->ordered_tags = 0; + sdev->simple_tags = 0; + break; + } +} /** * scsi_activate_tcq - turn on tag command queueing * @SDpnt: device to turn on TCQ for @@ -25,11 +62,13 @@ **/ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) { - if (sdev->tagged_supported) { - if (!blk_queue_tagged(sdev->request_queue)) - blk_queue_init_tags(sdev->request_queue, depth, NULL); - scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth); - } + if (!sdev->tagged_supported) + return; + + if (!blk_queue_tagged(sdev->request_queue)) + blk_queue_init_tags(sdev->request_queue, depth, NULL); + + scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); } /** @@ -56,9 +95,10 @@ static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg) { struct request *req = cmd->request; + struct scsi_device *sdev = cmd->device; if (blk_rq_tagged(req)) { - if (req->flags & REQ_HARDBARRIER) + if (sdev->ordered_tags && req->flags & REQ_HARDBARRIER) *msg++ = MSG_ORDERED_TAG; else *msg++ = MSG_SIMPLE_TAG; diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index 2a84cece5ba7..705e9ef3cae8 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h @@ -33,6 +33,7 @@ struct scsi_transport_template { struct class *device_class; struct class *target_class; struct class *host_class; + struct attribute_group *host_statistics; /* Constructor functions */ int (*device_setup)(struct scsi_device *); @@ -40,6 +41,11 @@ struct scsi_transport_template { int (*target_setup)(struct scsi_target *); int (*host_setup)(struct Scsi_Host *); + /* Destructor functions */ + void (*device_destroy)(struct scsi_device *); + void (*target_destroy)(struct scsi_target *); + void (*host_destroy)(struct Scsi_Host *); + /* The size of the specific transport attribute structure (a * space of this size will be left at the end of the * scsi_* structure */ diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 2085903aea47..3b7128327791 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h @@ -24,12 +24,102 @@ struct scsi_transport_template; + +/* + * FC Port definitions - Following FC HBAAPI guidelines + * + * Note: Not all binary values for the different fields match HBAAPI. + * Instead, we use densely packed ordinal values or enums. + * We get away with this as we never present the actual binary values + * externally. For sysfs, we always present the string that describes + * the value. Thus, an admin doesn't need a magic HBAAPI decoder ring + * to understand the values. The HBAAPI user-space library is free to + * convert the strings into the HBAAPI-specified binary values. + * + * Note: Not all HBAAPI-defined values are contained in the definitions + * below. Those not appropriate to an fc_host (e.g. FCP initiator) have + * been removed. + */ + +/* + * fc_port_type: If you alter this, you also need to alter scsi_transport_fc.c + * (for the ascii descriptions). + */ +enum fc_port_type { + FC_PORTTYPE_UNKNOWN, + FC_PORTTYPE_OTHER, + FC_PORTTYPE_NOTPRESENT, + FC_PORTTYPE_NPORT, /* Attached to FPort */ + FC_PORTTYPE_NLPORT, /* (Public) Loop w/ FLPort */ + FC_PORTTYPE_LPORT, /* (Private) Loop w/o FLPort */ + FC_PORTTYPE_PTP, /* Point to Point w/ another NPort */ +}; + +/* + * fc_port_state: If you alter this, you also need to alter scsi_transport_fc.c + * (for the ascii descriptions). + */ +enum fc_port_state { + FC_PORTSTATE_UNKNOWN, + FC_PORTSTATE_ONLINE, + FC_PORTSTATE_OFFLINE, /* User has taken Port Offline */ + FC_PORTSTATE_BYPASSED, + FC_PORTSTATE_DIAGNOSTICS, + FC_PORTSTATE_LINKDOWN, + FC_PORTSTATE_ERROR, + FC_PORTSTATE_LOOPBACK, +}; + + +/* + * FC Classes of Service + * Note: values are not enumerated, as they can be "or'd" together + * for reporting (e.g. report supported_classes). If you alter this list, + * you also need to alter scsi_transport_fc.c (for the ascii descriptions). + */ +#define FC_COS_UNSPECIFIED 0 +#define FC_COS_CLASS1 2 +#define FC_COS_CLASS2 4 +#define FC_COS_CLASS3 8 +#define FC_COS_CLASS4 0x10 +#define FC_COS_CLASS6 0x40 + +/* + * FC Port Speeds + * Note: values are not enumerated, as they can be "or'd" together + * for reporting (e.g. report supported_speeds). If you alter this list, + * you also need to alter scsi_transport_fc.c (for the ascii descriptions). + */ +#define FC_PORTSPEED_UNKNOWN 0 /* Unknown - transceiver + incapable of reporting */ +#define FC_PORTSPEED_1GBIT 1 +#define FC_PORTSPEED_2GBIT 2 +#define FC_PORTSPEED_10GBIT 4 +#define FC_PORTSPEED_4GBIT 8 +#define FC_PORTSPEED_NOT_NEGOTIATED (1 << 15) /* Speed not established */ + +/* + * fc_tgtid_binding_type: If you alter this, you also need to alter + * scsi_transport_fc.c (for the ascii descriptions). + */ +enum fc_tgtid_binding_type { + FC_TGTID_BIND_BY_WWPN, + FC_TGTID_BIND_BY_WWNN, + FC_TGTID_BIND_BY_ID, +}; + + + +/* + * FC Remote Port (Target) Attributes + */ + struct fc_starget_attrs { /* aka fc_target_attrs */ int port_id; - uint64_t node_name; - uint64_t port_name; - uint32_t dev_loss_tmo; /* Remote Port loss timeout in seconds. */ - struct timer_list dev_loss_timer; + u64 node_name; + u64 port_name; + u32 dev_loss_tmo; /* Remote Port loss timeout in seconds. */ + struct work_struct dev_loss_work; }; #define fc_starget_port_id(x) \ @@ -40,18 +130,120 @@ struct fc_starget_attrs { /* aka fc_target_attrs */ (((struct fc_starget_attrs *)&(x)->starget_data)->port_name) #define fc_starget_dev_loss_tmo(x) \ (((struct fc_starget_attrs *)&(x)->starget_data)->dev_loss_tmo) -#define fc_starget_dev_loss_timer(x) \ - (((struct fc_starget_attrs *)&(x)->starget_data)->dev_loss_timer) +#define fc_starget_dev_loss_work(x) \ + (((struct fc_starget_attrs *)&(x)->starget_data)->dev_loss_work) + + +/* + * FC Local Port (Host) Statistics + */ + +/* FC Statistics - Following FC HBAAPI v2.0 guidelines */ +struct fc_host_statistics { + /* port statistics */ + u64 seconds_since_last_reset; + u64 tx_frames; + u64 tx_words; + u64 rx_frames; + u64 rx_words; + u64 lip_count; + u64 nos_count; + u64 error_frames; + u64 dumped_frames; + u64 link_failure_count; + u64 loss_of_sync_count; + u64 loss_of_signal_count; + u64 prim_seq_protocol_err_count; + u64 invalid_tx_word_count; + u64 invalid_crc_count; + + /* fc4 statistics (only FCP supported currently) */ + u64 fcp_input_requests; + u64 fcp_output_requests; + u64 fcp_control_requests; + u64 fcp_input_megabytes; + u64 fcp_output_megabytes; +}; + + +/* + * FC Local Port (Host) Attributes + * + * Attributes are based on HBAAPI V2.0 definitions. + * Note: OSDeviceName is determined by user-space library + * + * Fixed attributes are not expected to change. The driver is + * expected to set these values after successfully calling scsi_add_host(). + * The transport fully manages all get functions w/o driver interaction. + * + * Dynamic attributes are expected to change. The driver participates + * in all get/set operations via functions provided by the driver. + * + * Private attributes are transport-managed values. They are fully + * managed by the transport w/o driver interaction. + */ + +#define FC_FC4_LIST_SIZE 32 +#define FC_SYMBOLIC_NAME_SIZE 256 struct fc_host_attrs { - uint32_t link_down_tmo; /* Link Down timeout in seconds. */ - struct timer_list link_down_timer; + /* Fixed Attributes */ + u64 node_name; + u64 port_name; + u32 supported_classes; + u8 supported_fc4s[FC_FC4_LIST_SIZE]; + char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; + u32 supported_speeds; + u32 maxframe_size; + + /* Dynamic Attributes */ + u32 port_id; + enum fc_port_type port_type; + enum fc_port_state port_state; + u8 active_fc4s[FC_FC4_LIST_SIZE]; + u32 speed; + u64 fabric_name; + u32 link_down_tmo; /* Link Down timeout in seconds. */ + + /* Private (Transport-managed) Attributes */ + enum fc_tgtid_binding_type tgtid_bind_type; + + /* internal data */ + struct work_struct link_down_work; }; +#define fc_host_node_name(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->node_name) +#define fc_host_port_name(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->port_name) +#define fc_host_supported_classes(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->supported_classes) +#define fc_host_supported_fc4s(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->supported_fc4s) +#define fc_host_symbolic_name(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->symbolic_name) +#define fc_host_supported_speeds(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds) +#define fc_host_maxframe_size(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size) +#define fc_host_port_id(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->port_id) +#define fc_host_port_type(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->port_type) +#define fc_host_port_state(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->port_state) +#define fc_host_active_fc4s(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->active_fc4s) +#define fc_host_speed(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->speed) +#define fc_host_fabric_name(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->fabric_name) #define fc_host_link_down_tmo(x) \ (((struct fc_host_attrs *)(x)->shost_data)->link_down_tmo) -#define fc_host_link_down_timer(x) \ - (((struct fc_host_attrs *)(x)->shost_data)->link_down_timer) +#define fc_host_tgtid_bind_type(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->tgtid_bind_type) +#define fc_host_link_down_work(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->link_down_work) /* The functions by which the transport class and the driver communicate */ @@ -60,10 +252,19 @@ struct fc_function_template { void (*get_starget_node_name)(struct scsi_target *); void (*get_starget_port_name)(struct scsi_target *); void (*get_starget_dev_loss_tmo)(struct scsi_target *); - void (*set_starget_dev_loss_tmo)(struct scsi_target *, uint32_t); + void (*set_starget_dev_loss_tmo)(struct scsi_target *, u32); + void (*get_host_port_id)(struct Scsi_Host *); + void (*get_host_port_type)(struct Scsi_Host *); + void (*get_host_port_state)(struct Scsi_Host *); + void (*get_host_active_fc4s)(struct Scsi_Host *); + void (*get_host_speed)(struct Scsi_Host *); + void (*get_host_fabric_name)(struct Scsi_Host *); void (*get_host_link_down_tmo)(struct Scsi_Host *); - void (*set_host_link_down_tmo)(struct Scsi_Host *, uint32_t); + void (*set_host_link_down_tmo)(struct Scsi_Host *, u32); + + struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *); + void (*reset_fc_host_stats)(struct Scsi_Host *); /* * The driver sets these to tell the transport class it @@ -76,11 +277,25 @@ struct fc_function_template { unsigned long show_starget_port_name:1; unsigned long show_starget_dev_loss_tmo:1; + /* host fixed attributes */ + unsigned long show_host_node_name:1; + unsigned long show_host_port_name:1; + unsigned long show_host_supported_classes:1; + unsigned long show_host_supported_fc4s:1; + unsigned long show_host_symbolic_name:1; + unsigned long show_host_supported_speeds:1; + unsigned long show_host_maxframe_size:1; + /* host dynamic attributes */ + unsigned long show_host_port_id:1; + unsigned long show_host_port_type:1; + unsigned long show_host_port_state:1; + unsigned long show_host_active_fc4s:1; + unsigned long show_host_speed:1; + unsigned long show_host_fabric_name:1; unsigned long show_host_link_down_tmo:1; - - /* Private Attributes */ }; + struct scsi_transport_template *fc_attach_transport(struct fc_function_template *); void fc_release_transport(struct scsi_transport_template *); int fc_target_block(struct scsi_target *starget); diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h new file mode 100644 index 000000000000..1b26a6c0aa2a --- /dev/null +++ b/include/scsi/scsi_transport_iscsi.h @@ -0,0 +1,178 @@ +/* + * iSCSI transport class definitions + * + * Copyright (C) IBM Corporation, 2004 + * Copyright (C) Mike Christie, 2004 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +#ifndef SCSI_TRANSPORT_ISCSI_H +#define SCSI_TRANSPORT_ISCSI_H + +#include <linux/config.h> +#include <linux/in6.h> +#include <linux/in.h> + +struct scsi_transport_template; + +struct iscsi_class_session { + uint8_t isid[6]; + uint16_t tsih; + int header_digest; /* 1 CRC32, 0 None */ + int data_digest; /* 1 CRC32, 0 None */ + uint16_t tpgt; + union { + struct in6_addr sin6_addr; + struct in_addr sin_addr; + } u; + sa_family_t addr_type; /* must be AF_INET or AF_INET6 */ + uint16_t port; /* must be in network byte order */ + int initial_r2t; /* 1 Yes, 0 No */ + int immediate_data; /* 1 Yes, 0 No */ + uint32_t max_recv_data_segment_len; + uint32_t max_burst_len; + uint32_t first_burst_len; + uint16_t def_time2wait; + uint16_t def_time2retain; + uint16_t max_outstanding_r2t; + int data_pdu_in_order; /* 1 Yes, 0 No */ + int data_sequence_in_order; /* 1 Yes, 0 No */ + int erl; +}; + +/* + * accessor macros + */ +#define iscsi_isid(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->isid) +#define iscsi_tsih(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->tsih) +#define iscsi_header_digest(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->header_digest) +#define iscsi_data_digest(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->data_digest) +#define iscsi_port(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->port) +#define iscsi_addr_type(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->addr_type) +#define iscsi_sin_addr(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->u.sin_addr) +#define iscsi_sin6_addr(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->u.sin6_addr) +#define iscsi_tpgt(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->tpgt) +#define iscsi_initial_r2t(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->initial_r2t) +#define iscsi_immediate_data(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->immediate_data) +#define iscsi_max_recv_data_segment_len(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->max_recv_data_segment_len) +#define iscsi_max_burst_len(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->max_burst_len) +#define iscsi_first_burst_len(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->first_burst_len) +#define iscsi_def_time2wait(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->def_time2wait) +#define iscsi_def_time2retain(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->def_time2retain) +#define iscsi_max_outstanding_r2t(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->max_outstanding_r2t) +#define iscsi_data_pdu_in_order(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->data_pdu_in_order) +#define iscsi_data_sequence_in_order(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->data_sequence_in_order) +#define iscsi_erl(x) \ + (((struct iscsi_class_session *)&(x)->starget_data)->erl) + +/* + * The functions by which the transport class and the driver communicate + */ +struct iscsi_function_template { + /* + * target attrs + */ + void (*get_isid)(struct scsi_target *); + void (*get_tsih)(struct scsi_target *); + void (*get_header_digest)(struct scsi_target *); + void (*get_data_digest)(struct scsi_target *); + void (*get_port)(struct scsi_target *); + void (*get_tpgt)(struct scsi_target *); + /* + * In get_ip_address the lld must set the address and + * the address type + */ + void (*get_ip_address)(struct scsi_target *); + /* + * The lld should snprintf the name or alias to the buffer + */ + ssize_t (*get_target_name)(struct scsi_target *, char *, ssize_t); + ssize_t (*get_target_alias)(struct scsi_target *, char *, ssize_t); + void (*get_initial_r2t)(struct scsi_target *); + void (*get_immediate_data)(struct scsi_target *); + void (*get_max_recv_data_segment_len)(struct scsi_target *); + void (*get_max_burst_len)(struct scsi_target *); + void (*get_first_burst_len)(struct scsi_target *); + void (*get_def_time2wait)(struct scsi_target *); + void (*get_def_time2retain)(struct scsi_target *); + void (*get_max_outstanding_r2t)(struct scsi_target *); + void (*get_data_pdu_in_order)(struct scsi_target *); + void (*get_data_sequence_in_order)(struct scsi_target *); + void (*get_erl)(struct scsi_target *); + + /* + * host atts + */ + + /* + * The lld should snprintf the name or alias to the buffer + */ + ssize_t (*get_initiator_alias)(struct Scsi_Host *, char *, ssize_t); + ssize_t (*get_initiator_name)(struct Scsi_Host *, char *, ssize_t); + /* + * The driver sets these to tell the transport class it + * wants the attributes displayed in sysfs. If the show_ flag + * is not set, the attribute will be private to the transport + * class. We could probably just test if a get_ fn was set + * since we only use the values for sysfs but this is how + * fc does it too. + */ + unsigned long show_isid:1; + unsigned long show_tsih:1; + unsigned long show_header_digest:1; + unsigned long show_data_digest:1; + unsigned long show_port:1; + unsigned long show_tpgt:1; + unsigned long show_ip_address:1; + unsigned long show_target_name:1; + unsigned long show_target_alias:1; + unsigned long show_initial_r2t:1; + unsigned long show_immediate_data:1; + unsigned long show_max_recv_data_segment_len:1; + unsigned long show_max_burst_len:1; + unsigned long show_first_burst_len:1; + unsigned long show_def_time2wait:1; + unsigned long show_def_time2retain:1; + unsigned long show_max_outstanding_r2t:1; + unsigned long show_data_pdu_in_order:1; + unsigned long show_data_sequence_in_order:1; + unsigned long show_erl:1; + unsigned long show_initiator_name:1; + unsigned long show_initiator_alias:1; +}; + +struct scsi_transport_template *iscsi_attach_transport(struct iscsi_function_template *); +void iscsi_release_transport(struct scsi_transport_template *); + +#endif |
