summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/tlb.h2
-rw-r--r--include/asm-ppc/smp.h1
-rw-r--r--include/asm-x86_64/bitops.h4
-rw-r--r--include/asm-x86_64/ia32_unistd.h15
-rw-r--r--include/asm-x86_64/io.h6
-rw-r--r--include/asm-x86_64/nmi.h2
-rw-r--r--include/asm-x86_64/pci-direct.h21
-rw-r--r--include/asm-x86_64/pci.h35
-rw-r--r--include/asm-x86_64/percpu.h58
-rw-r--r--include/asm-x86_64/proto.h2
-rw-r--r--include/asm-x86_64/siginfo.h2
-rw-r--r--include/asm-x86_64/unistd.h2
-rw-r--r--include/linux/if_tun.h2
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/ppp-comp.h5
-rw-r--r--include/linux/xfrm.h3
-rw-r--r--include/net/dst.h8
-rw-r--r--include/net/ipv6.h4
-rw-r--r--include/net/xfrm.h45
-rw-r--r--include/scsi/scsi_device.h20
-rw-r--r--include/scsi/scsi_host.h27
21 files changed, 188 insertions, 78 deletions
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 368f65b64360..f14d581fda8a 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -99,7 +99,7 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
}
-/* void tlb_remove_page(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr)
+/* tlb_remove_page
* Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while
* handling the additional races in SMP caused by other CPUs caching valid
* mappings in their TLBs.
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
index 0f458a0f115e..baabf274f815 100644
--- a/include/asm-ppc/smp.h
+++ b/include/asm-ppc/smp.h
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/errno.h>
+#include <linux/threads.h>
#ifdef CONFIG_SMP
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h
index 493aa82d889c..92260e080c5a 100644
--- a/include/asm-x86_64/bitops.h
+++ b/include/asm-x86_64/bitops.h
@@ -402,12 +402,12 @@ static inline void set_bit_string(unsigned long *bitmap, unsigned long i,
}
}
-static inline void clear_bit_string(unsigned long *bitmap, unsigned long i,
+static inline void __clear_bit_string(unsigned long *bitmap, unsigned long i,
int len)
{
unsigned long end = i + len;
while (i < end) {
- clear_bit(i, bitmap);
+ __clear_bit(i, bitmap);
i++;
}
}
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h
index 45b50bf2679c..3d8256926d7c 100644
--- a/include/asm-x86_64/ia32_unistd.h
+++ b/include/asm-x86_64/ia32_unistd.h
@@ -264,7 +264,20 @@
#define __NR_ia32_sys_epoll_wait 256
#define __NR_ia32_remap_file_pages 257
#define __NR_ia32_set_tid_address 258
+#define __NR_ia32_timer_create 259
+#define __NR_ia32_timer_settime (__NR_ia32_timer_create+1)
+#define __NR_ia32_timer_gettime (__NR_ia32_timer_create+2)
+#define __NR_ia32_timer_getoverrun (__NR_ia32_timer_create+3)
+#define __NR_ia32_timer_delete (__NR_ia32_timer_create+4)
+#define __NR_ia32_clock_settime (__NR_ia32_timer_create+5)
+#define __NR_ia32_clock_gettime (__NR_ia32_timer_create+6)
+#define __NR_ia32_clock_getres (__NR_ia32_timer_create+7)
+#define __NR_ia32_clock_nanosleep (__NR_ia32_timer_create+8)
+#define __NR_ia32_statfs64 268
+#define __NR_ia32_fstatfs64 269
+#define __NR_ia32_tgkill 270
+#define __NR_ia32_utimes 271
-#define IA32_NR_syscalls 265 /* must be > than biggest syscall! */
+#define IA32_NR_syscalls 275 /* must be > than biggest syscall! */
#endif /* _ASM_X86_64_IA32_UNISTD_H_ */
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h
index b2cc4f1a241a..bf9738f9a23b 100644
--- a/include/asm-x86_64/io.h
+++ b/include/asm-x86_64/io.h
@@ -301,6 +301,12 @@ out:
#define flush_write_buffers()
+/* Disable vmerge for now. Need to fix the block layer code
+ to check for non iommu addresses first.
+ When the IOMMU is force it is safe to enable. */
+extern int force_iommu;
+#define BIO_VERMGE_BOUNDARY (force_iommu ? 4096 : 0)
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h
index 66e9c5efc5e6..df002c539f58 100644
--- a/include/asm-x86_64/nmi.h
+++ b/include/asm-x86_64/nmi.h
@@ -48,6 +48,4 @@ static inline void unset_nmi_pm_callback(struct pm_dev * dev)
extern void default_do_nmi(struct pt_regs *);
-extern void default_do_nmi(struct pt_regs *);
-
#endif /* ASM_NMI_H */
diff --git a/include/asm-x86_64/pci-direct.h b/include/asm-x86_64/pci-direct.h
index 5d9e1bec7144..08a2b783889f 100644
--- a/include/asm-x86_64/pci-direct.h
+++ b/include/asm-x86_64/pci-direct.h
@@ -14,7 +14,26 @@ static inline u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset)
u32 v;
outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
v = inl(0xcfc);
- PDprintk("%x reading from %x: %x\n", slot, offset, v);
+ if (v != 0xffffffff)
+ PDprintk("%x reading 4 from %x: %x\n", slot, offset, v);
+ return v;
+}
+
+static inline u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset)
+{
+ u8 v;
+ outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
+ v = inb(0xcfc + (offset&3));
+ PDprintk("%x reading 1 from %x: %x\n", slot, offset, v);
+ return v;
+}
+
+static inline u8 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset)
+{
+ u16 v;
+ outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
+ v = inw(0xcfc + (offset&2));
+ PDprintk("%x reading 2 from %x: %x\n", slot, offset, v);
return v;
}
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index 33550880dcbd..b072364de2bd 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -8,9 +8,6 @@
#include <linux/mm.h> /* for struct page */
-
-extern dma_addr_t bad_dma_address;
-
/* Can be used to override the logic in pci_scan_bus for skipping
already-configured bus numbers - to be used for buggy BIOSes
or architectures with incomplete PCI setup by the loader */
@@ -21,6 +18,8 @@ extern unsigned int pcibios_assign_all_busses(void);
#define pcibios_assign_all_busses() 0
#endif
+extern int no_iommu, force_iommu;
+
extern unsigned long pci_mem_start;
#define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM (pci_mem_start)
@@ -46,6 +45,9 @@ struct pci_dev;
extern int iommu_setup(char *opt);
+extern dma_addr_t bad_dma_address;
+#define pci_dma_error(x) ((x) == bad_dma_address)
+
/* Allocate and map kernel buffer using consistent mode DMA for a device.
* hwdev should be valid struct pci_dev pointer for PCI devices,
* NULL for PCI-like buses (ISA, EISA).
@@ -119,10 +121,16 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
/* The PCI address space does equal the physical memory
* address space. The networking and block device layers use
- * this boolean for bounce buffer decisions.
+ * this boolean for bounce buffer decisions
+ *
+ * On AMD64 it mostly equals, but we set it to zero to tell some subsystems
+ * that an IOMMU is available.
*/
-#define PCI_DMA_BUS_IS_PHYS (0)
+#define PCI_DMA_BUS_IS_PHYS (no_iommu ? 1 : 0)
+/* We lie slightly when the IOMMU is forced to get the device to
+ use SAC instead of DAC. */
+#define pci_dac_dma_supported(pci_dev, mask) (force_iommu ? 0 : 1)
#else
static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
@@ -206,6 +214,7 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
#define PCI_DMA_BUS_IS_PHYS 1
+#define pci_dac_dma_supported(pci_dev, mask) 1
#endif
extern int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
@@ -220,21 +229,7 @@ extern void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
* only drive the low 24-bits during PCI bus mastering, then
* you would pass 0x00ffffff as the mask to this function.
*/
-static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
-{
- /*
- * we fall back to GFP_DMA when the mask isn't all 1s,
- * so we can't guarantee allocations that must be
- * within a tighter range than GFP_DMA..
- */
- if(mask < 0x00ffffff)
- return 0;
-
- return 1;
-}
-
-/* This is always fine. */
-#define pci_dac_dma_supported(pci_dev, mask) (1)
+extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
static __inline__ dma64_addr_t
pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index 578c6b12cf2b..832fc326fb02 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -1,53 +1,51 @@
#ifndef _ASM_X8664_PERCPU_H_
#define _ASM_X8664_PERCPU_H_
+#include <linux/compiler.h>
-#include <asm/pda.h>
+/* Same as asm-generic/percpu.h, except that we store the per cpu offset
+ in the PDA. Longer term the PDA and every per cpu variable
+ should be just put into a single section and referenced directly
+ from %gs */
#ifdef CONFIG_SMP
-/* Same as the generic code except that we cache the per cpu offset
- in the pda. This gives an 3 instruction reference for per cpu data */
-
-#include <linux/compiler.h>
#include <asm/pda.h>
-#define __my_cpu_offset() read_pda(data_offset)
+
#define __per_cpu_offset(cpu) (cpu_pda[cpu].data_offset)
+#define __my_cpu_offset() read_pda(data_offset)
/* Separate out the type, so (int[3], foo) works. */
#define DEFINE_PER_CPU(type, name) \
- __attribute__((__section__(".data.percpu"))) __typeof__(type) name##__per_cpu
+ __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name
/* var is in discarded region: offset to particular copy we want */
-#define per_cpu(var, cpu) (*RELOC_HIDE(&var##__per_cpu, __per_cpu_offset(cpu)))
-#define __get_cpu_var(var) \
- (*RELOC_HIDE(&var##__per_cpu, __my_cpu_offset()))
-
-static inline void percpu_modcopy(void *pcpudst, const void *src,
- unsigned long size)
-{
- unsigned int i;
- for (i = 0; i < NR_CPUS; i++)
- if (cpu_possible(i))
- memcpy(pcpudst + __per_cpu_offset(i), src, size);
-}
-
-extern void setup_per_cpu_areas(void);
-
+#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
+#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
+
+/* A macro to avoid #include hell... */
+#define percpu_modcopy(pcpudst, src, size) \
+do { \
+ unsigned int __i; \
+ for (__i = 0; __i < NR_CPUS; __i++) \
+ if (cpu_possible(__i)) \
+ memcpy((pcpudst)+__per_cpu_offset(__i), \
+ (src), (size)); \
+} while (0)
#else /* ! SMP */
#define DEFINE_PER_CPU(type, name) \
- __typeof__(type) name##__per_cpu
+ __typeof__(type) per_cpu__##name
-#define per_cpu(var, cpu) ((void)cpu, var##__per_cpu)
-#define __get_cpu_var(var) var##__per_cpu
+#define per_cpu(var, cpu) ((void)cpu, per_cpu__##var)
+#define __get_cpu_var(var) per_cpu__##var
#endif /* SMP */
-#define DECLARE_PER_CPU(type, name) extern __typeof__(type) name##__per_cpu
+#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
-#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var##__per_cpu)
-#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var##__per_cpu)
+#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
+#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
-DECLARE_PER_CPU(struct x8664_pda, per_cpu_pda);
+extern void setup_per_cpu_areas(void);
-#endif
+#endif /* _ASM_X8664_PERCPU_H_ */
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index ed86ba7abf06..5e176402f5c1 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -77,7 +77,7 @@ extern unsigned long end_pfn;
extern unsigned long table_start, table_end;
extern int exception_trace;
-extern int no_iommu, force_mmu;
+extern int force_iommu, no_iommu;
extern int using_apic_timer;
extern int disable_apic;
extern unsigned cpu_khz;
diff --git a/include/asm-x86_64/siginfo.h b/include/asm-x86_64/siginfo.h
index dcb6b5731012..d09a1e6e7246 100644
--- a/include/asm-x86_64/siginfo.h
+++ b/include/asm-x86_64/siginfo.h
@@ -1,6 +1,8 @@
#ifndef _X8664_SIGINFO_H
#define _X8664_SIGINFO_H
+#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+
#include <asm-generic/siginfo.h>
#endif
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 027d47e870ff..ac85fa9cd769 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -461,7 +461,7 @@ __SYSCALL(__NR_fremovexattr, sys_fremovexattr)
#define __NR_tkill 200
__SYSCALL(__NR_tkill, sys_tkill)
#define __NR_time 201
-__SYSCALL(__NR_time, sys_time)
+__SYSCALL(__NR_time, sys_time64)
#define __NR_futex 202
__SYSCALL(__NR_futex, sys_futex)
#define __NR_sched_setaffinity 203
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index f8459e01c896..ad1e168004ee 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -32,7 +32,7 @@
#endif
struct tun_struct {
- char *name;
+ struct list_head list;
unsigned long flags;
int attached;
uid_t owner;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 49207c629e4f..e4f91218676d 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -71,7 +71,7 @@ struct rt0_hdr {
__u32 bitmap; /* strict/loose bit map */
struct in6_addr addr[0];
-#define rt0_type rt_hdr.type;
+#define rt0_type rt_hdr.type
};
struct ipv6_auth_hdr {
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index 82dd01c38920..7227e653b3be 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -185,10 +185,9 @@ struct compressor {
#define DEFLATE_MIN_SIZE 9
#define DEFLATE_MAX_SIZE 15
#define DEFLATE_METHOD_VAL 8
-#define DEFLATE_SIZE(x) (((x) >> 4) + DEFLATE_MIN_SIZE)
+#define DEFLATE_SIZE(x) (((x) >> 4) + 8)
#define DEFLATE_METHOD(x) ((x) & 0x0F)
-#define DEFLATE_MAKE_OPT(w) ((((w) - DEFLATE_MIN_SIZE) << 4) \
- + DEFLATE_METHOD_VAL)
+#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
#define DEFLATE_CHK_SEQUENCE 0
/*
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index a4dd169d9f6f..430370b12d13 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -37,6 +37,7 @@ struct xfrm_selector
__u16 dport_mask;
__u16 sport;
__u16 sport_mask;
+ __u16 family;
__u8 prefixlen_d;
__u8 prefixlen_s;
__u8 proto;
@@ -125,6 +126,7 @@ enum
struct xfrm_user_tmpl {
struct xfrm_id id;
+ __u16 family;
xfrm_address_t saddr;
__u32 reqid;
__u8 mode;
@@ -189,7 +191,6 @@ struct xfrm_userpolicy_info {
struct xfrm_lifetime_cur curlft;
__u32 priority;
__u32 index;
- __u16 family;
__u8 dir;
__u8 action;
#define XFRM_POLICY_ALLOW 0
diff --git a/include/net/dst.h b/include/net/dst.h
index 8282f41ec600..42dd8f511cef 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -247,8 +247,16 @@ static inline int dst_input(struct sk_buff *skb)
extern void dst_init(void);
struct flowi;
+#ifndef CONFIG_XFRM
+static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
+ struct sock *sk, int flags)
+{
+ return 0;
+}
+#else
extern int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
struct sock *sk, int flags);
#endif
+#endif
#endif /* _NET_DST_H */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8aeb974d8592..9ed62a7db079 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -353,9 +353,7 @@ extern int ip6_push_pending_frames(struct sock *sk);
extern void ip6_flush_pending_frames(struct sock *sk);
-extern int ip6_dst_lookup(struct sock *sk,
- struct dst_entry **dst,
- struct flowi *fl);
+extern struct dst_entry * ip6_dst_lookup(struct sock *sk, struct flowi *fl);
/*
* skb processing functions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 337061ce242e..bca38f50f681 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -588,6 +588,8 @@ xfrm_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x, unsigned short
return !0;
}
+#ifdef CONFIG_XFRM
+
extern int __xfrm_policy_check(struct sock *, int dir, struct sk_buff *skb, unsigned short family);
static inline int xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, unsigned short family)
@@ -653,6 +655,26 @@ static inline void xfrm_sk_free_policy(struct sock *sk)
}
}
+#else
+
+static inline void xfrm_sk_free_policy(struct sock *sk) {}
+static inline int xfrm_sk_clone_policy(struct sock *sk) { return 0; }
+static inline int xfrm6_route_forward(struct sk_buff *skb) { return 1; }
+static inline int xfrm4_route_forward(struct sk_buff *skb) { return 1; }
+static inline int xfrm6_policy_check(struct sock *sk, int dir, struct sk_buff *skb)
+{
+ return 1;
+}
+static inline int xfrm4_policy_check(struct sock *sk, int dir, struct sk_buff *skb)
+{
+ return 1;
+}
+static inline int xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, unsigned short family)
+{
+ return 1;
+}
+#endif
+
static __inline__
xfrm_address_t *xfrm_flowi_daddr(struct flowi *fl, unsigned short family)
{
@@ -783,12 +805,32 @@ extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq);
extern int xfrm_check_selectors(struct xfrm_state **x, int n, struct flowi *fl);
extern int xfrm_check_output(struct xfrm_state *x, struct sk_buff *skb, unsigned short family);
extern int xfrm4_rcv(struct sk_buff *skb);
-extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
extern int xfrm4_tunnel_check_size(struct sk_buff *skb);
extern int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp);
+
+#ifdef CONFIG_XFRM
+extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type);
extern int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen);
+extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family);
+#else
+static inline int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen)
+{
+ return -ENOPROTOOPT;
+}
+
+static inline int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
+{
+ /* should not happen */
+ kfree_skb(skb);
+ return 0;
+}
+static inline int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family)
+{
+ return -EINVAL;
+}
+#endif
void xfrm_policy_init(void);
void xfrm4_policy_init(void);
@@ -810,7 +852,6 @@ extern void xfrm_policy_kill(struct xfrm_policy *);
extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
extern struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl);
extern int xfrm_flush_bundles(struct xfrm_state *x);
-extern int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family);
extern wait_queue_head_t km_waitq;
extern void km_state_expired(struct xfrm_state *x, int hard);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index de5ff9fd6c4a..04b8f47837a9 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -10,6 +10,16 @@ struct scsi_cmnd;
struct scsi_mode_data;
+/*
+ * sdev state
+ */
+enum {
+ SDEV_ADD,
+ SDEV_DEL,
+ SDEV_CANCEL,
+ SDEV_RECOVERY,
+};
+
struct scsi_device {
struct list_head siblings; /* list of all devices on this host */
struct list_head same_target_siblings; /* just the devices sharing same target id */
@@ -86,14 +96,19 @@ struct scsi_device {
struct device sdev_gendev;
struct class_device sdev_classdev;
+
+ unsigned long sdev_state;
};
#define to_scsi_device(d) \
container_of(d, struct scsi_device, sdev_gendev)
+#define class_to_sdev(d) \
+ container_of(d, struct scsi_device, sdev_classdev)
extern struct scsi_device *scsi_add_device(struct Scsi_Host *,
uint, uint, uint);
-extern int scsi_remove_device(struct scsi_device *);
-extern void scsi_set_device_offline(struct scsi_device *);
+extern void scsi_remove_device(struct scsi_device *);
+extern int scsi_device_cancel_cb(struct device *, void *);
+extern int scsi_device_cancel(struct scsi_device *, int);
extern int scsi_device_get(struct scsi_device *);
extern void scsi_device_put(struct scsi_device *);
@@ -106,5 +121,4 @@ extern int scsi_set_medium_removal(struct scsi_device *, char);
extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
unsigned char *buffer, int len, int timeout,
int retries, struct scsi_mode_data *data);
-
#endif /* _SCSI_SCSI_DEVICE_H */
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 3ef701078fef..7a2ccdf81e55 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -262,6 +262,12 @@ struct scsi_host_template {
unsigned short max_sectors;
/*
+ * dma scatter gather segment boundary limit. a segment crossing this
+ * boundary will be split in two.
+ */
+ unsigned long dma_boundary;
+
+ /*
* This specifies "machine infinity" for host templates which don't
* limit the transfer size. Note this limit represents an absolute
* maximum, and may be over the transfer limits allowed for
@@ -306,8 +312,6 @@ struct scsi_host_template {
*/
unsigned emulated:1;
- unsigned highmem_io:1;
-
/*
* True if the driver wishes to use the generic block layer
* tag queueing functions
@@ -348,6 +352,16 @@ struct scsi_host_template {
struct list_head legacy_hosts;
};
+/*
+ * shost states
+ */
+enum {
+ SHOST_ADD,
+ SHOST_DEL,
+ SHOST_CANCEL,
+ SHOST_RECOVERY,
+};
+
struct Scsi_Host {
struct list_head my_devices;
struct scsi_host_cmd_pool *cmd_pool;
@@ -412,8 +426,8 @@ struct Scsi_Host {
short cmd_per_lun;
short unsigned int sg_tablesize;
short unsigned int max_sectors;
+ unsigned long dma_boundary;
- unsigned in_recovery:1;
unsigned unchecked_isa_dma:1;
unsigned use_clustering:1;
unsigned highmem_io:1;
@@ -448,6 +462,9 @@ struct Scsi_Host {
unsigned char n_io_port;
unsigned char dma_channel;
unsigned int irq;
+
+
+ unsigned long shost_state;
/* ldm bits */
struct device shost_gendev;
@@ -478,8 +495,8 @@ struct Scsi_Host {
extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
extern int scsi_add_host(struct Scsi_Host *, struct device *);
extern void scsi_scan_host(struct Scsi_Host *);
-extern int scsi_remove_host(struct Scsi_Host *);
-extern void scsi_host_get(struct Scsi_Host *);
+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);
extern struct Scsi_Host *scsi_host_lookup(unsigned short);