Merge branch 'master'
This commit is contained in:
commit
3b621ee5df
2441 changed files with 118882 additions and 51905 deletions
|
@ -117,12 +117,15 @@ struct acct_v3
|
|||
#include <linux/config.h>
|
||||
|
||||
#ifdef CONFIG_BSD_PROCESS_ACCT
|
||||
struct vfsmount;
|
||||
struct super_block;
|
||||
extern void acct_auto_close_mnt(struct vfsmount *m);
|
||||
extern void acct_auto_close(struct super_block *sb);
|
||||
extern void acct_process(long exitcode);
|
||||
extern void acct_update_integrals(struct task_struct *tsk);
|
||||
extern void acct_clear_integrals(struct task_struct *tsk);
|
||||
#else
|
||||
#define acct_auto_close_mnt(x) do { } while (0)
|
||||
#define acct_auto_close(x) do { } while (0)
|
||||
#define acct_process(x) do { } while (0)
|
||||
#define acct_update_integrals(x) do { } while (0)
|
||||
|
|
|
@ -183,6 +183,7 @@ struct kioctx {
|
|||
struct list_head active_reqs; /* used for cancellation */
|
||||
struct list_head run_list; /* used for kicked reqs */
|
||||
|
||||
/* sys_io_setup currently limits this to an unsigned int */
|
||||
unsigned max_reqs;
|
||||
|
||||
struct aio_ring_info ring_info;
|
||||
|
@ -234,7 +235,7 @@ static inline struct kiocb *list_kiocb(struct list_head *h)
|
|||
}
|
||||
|
||||
/* for sysctl: */
|
||||
extern atomic_t aio_nr;
|
||||
extern unsigned aio_max_nr;
|
||||
extern unsigned long aio_nr;
|
||||
extern unsigned long aio_max_nr;
|
||||
|
||||
#endif /* __LINUX__AIO_H */
|
||||
|
|
127
include/linux/cn_proc.h
Normal file
127
include/linux/cn_proc.h
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* cn_proc.h - process events connector
|
||||
*
|
||||
* Copyright (C) Matt Helsley, IBM Corp. 2005
|
||||
* Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
|
||||
* Original copyright notice follows:
|
||||
* Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
* Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
|
||||
*
|
||||
* 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 CN_PROC_H
|
||||
#define CN_PROC_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/connector.h>
|
||||
|
||||
/*
|
||||
* Userspace sends this enum to register with the kernel that it is listening
|
||||
* for events on the connector.
|
||||
*/
|
||||
enum proc_cn_mcast_op {
|
||||
PROC_CN_MCAST_LISTEN = 1,
|
||||
PROC_CN_MCAST_IGNORE = 2
|
||||
};
|
||||
|
||||
/*
|
||||
* From the user's point of view, the process
|
||||
* ID is the thread group ID and thread ID is the internal
|
||||
* kernel "pid". So, fields are assigned as follow:
|
||||
*
|
||||
* In user space - In kernel space
|
||||
*
|
||||
* parent process ID = parent->tgid
|
||||
* parent thread ID = parent->pid
|
||||
* child process ID = child->tgid
|
||||
* child thread ID = child->pid
|
||||
*/
|
||||
|
||||
struct proc_event {
|
||||
enum what {
|
||||
/* Use successive bits so the enums can be used to record
|
||||
* sets of events as well
|
||||
*/
|
||||
PROC_EVENT_NONE = 0x00000000,
|
||||
PROC_EVENT_FORK = 0x00000001,
|
||||
PROC_EVENT_EXEC = 0x00000002,
|
||||
PROC_EVENT_UID = 0x00000004,
|
||||
PROC_EVENT_GID = 0x00000040,
|
||||
/* "next" should be 0x00000400 */
|
||||
/* "last" is the last process event: exit */
|
||||
PROC_EVENT_EXIT = 0x80000000
|
||||
} what;
|
||||
__u32 cpu;
|
||||
union { /* must be last field of proc_event struct */
|
||||
struct {
|
||||
__u32 err;
|
||||
} ack;
|
||||
|
||||
struct fork_proc_event {
|
||||
pid_t parent_pid;
|
||||
pid_t parent_tgid;
|
||||
pid_t child_pid;
|
||||
pid_t child_tgid;
|
||||
} fork;
|
||||
|
||||
struct exec_proc_event {
|
||||
pid_t process_pid;
|
||||
pid_t process_tgid;
|
||||
} exec;
|
||||
|
||||
struct id_proc_event {
|
||||
pid_t process_pid;
|
||||
pid_t process_tgid;
|
||||
union {
|
||||
uid_t ruid; /* current->uid */
|
||||
gid_t rgid; /* current->gid */
|
||||
} r;
|
||||
union {
|
||||
uid_t euid;
|
||||
gid_t egid;
|
||||
} e;
|
||||
} id;
|
||||
|
||||
struct exit_proc_event {
|
||||
pid_t process_pid;
|
||||
pid_t process_tgid;
|
||||
__u32 exit_code, exit_signal;
|
||||
} exit;
|
||||
} event_data;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_PROC_EVENTS
|
||||
void proc_fork_connector(struct task_struct *task);
|
||||
void proc_exec_connector(struct task_struct *task);
|
||||
void proc_id_connector(struct task_struct *task, int which_id);
|
||||
void proc_exit_connector(struct task_struct *task);
|
||||
#else
|
||||
static inline void proc_fork_connector(struct task_struct *task)
|
||||
{}
|
||||
|
||||
static inline void proc_exec_connector(struct task_struct *task)
|
||||
{}
|
||||
|
||||
static inline void proc_id_connector(struct task_struct *task,
|
||||
int which_id)
|
||||
{}
|
||||
|
||||
static inline void proc_exit_connector(struct task_struct *task)
|
||||
{}
|
||||
#endif /* CONFIG_PROC_EVENTS */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* CN_PROC_H */
|
|
@ -10,6 +10,10 @@
|
|||
#define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl)
|
||||
#endif
|
||||
|
||||
|
||||
COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
|
||||
COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
|
||||
|
||||
/* Big T */
|
||||
COMPATIBLE_IOCTL(TCGETA)
|
||||
COMPATIBLE_IOCTL(TCSETA)
|
||||
|
@ -52,13 +56,6 @@ ULONG_IOCTL(TIOCSCTTY)
|
|||
COMPATIBLE_IOCTL(TIOCGPTN)
|
||||
COMPATIBLE_IOCTL(TIOCSPTLCK)
|
||||
COMPATIBLE_IOCTL(TIOCSERGETLSR)
|
||||
/* Big F */
|
||||
COMPATIBLE_IOCTL(FBIOBLANK)
|
||||
COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO)
|
||||
COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO)
|
||||
COMPATIBLE_IOCTL(FBIOPAN_DISPLAY)
|
||||
COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP)
|
||||
COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP)
|
||||
/* Little f */
|
||||
COMPATIBLE_IOCTL(FIOCLEX)
|
||||
COMPATIBLE_IOCTL(FIONCLEX)
|
||||
|
@ -81,6 +78,8 @@ COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
|
|||
COMPATIBLE_IOCTL(HDIO_DRIVE_TASK)
|
||||
COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
|
||||
COMPATIBLE_IOCTL(HDIO_SET_NICE)
|
||||
COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS)
|
||||
COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
|
||||
/* 0x02 -- Floppy ioctls */
|
||||
COMPATIBLE_IOCTL(FDMSGON)
|
||||
COMPATIBLE_IOCTL(FDMSGOFF)
|
||||
|
@ -99,6 +98,7 @@ COMPATIBLE_IOCTL(FDTWADDLE)
|
|||
COMPATIBLE_IOCTL(FDFMTTRK)
|
||||
COMPATIBLE_IOCTL(FDRAWCMD)
|
||||
/* 0x12 */
|
||||
COMPATIBLE_IOCTL(BLKRASET)
|
||||
COMPATIBLE_IOCTL(BLKROSET)
|
||||
COMPATIBLE_IOCTL(BLKROGET)
|
||||
COMPATIBLE_IOCTL(BLKRRPART)
|
||||
|
@ -262,6 +262,7 @@ COMPATIBLE_IOCTL(RTC_WKALM_RD)
|
|||
/* Little m */
|
||||
COMPATIBLE_IOCTL(MTIOCTOP)
|
||||
/* Socket level stuff */
|
||||
COMPATIBLE_IOCTL(FIOQSIZE)
|
||||
COMPATIBLE_IOCTL(FIOSETOWN)
|
||||
COMPATIBLE_IOCTL(SIOCSPGRP)
|
||||
COMPATIBLE_IOCTL(FIOGETOWN)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _LINUX_CONFIG_H
|
||||
#define _LINUX_CONFIG_H
|
||||
|
||||
/* This file is no longer in use and kept only for backward compatibility.
|
||||
* autoconf.h is now included via -imacros on the commandline
|
||||
*/
|
||||
#include <linux/autoconf.h>
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,6 +27,14 @@
|
|||
#define CN_IDX_CONNECTOR 0xffffffff
|
||||
#define CN_VAL_CONNECTOR 0xffffffff
|
||||
|
||||
/*
|
||||
* Process Events connector unique ids -- used for message routing
|
||||
*/
|
||||
#define CN_IDX_PROC 0x1
|
||||
#define CN_VAL_PROC 0x1
|
||||
#define CN_IDX_CIFS 0x2
|
||||
#define CN_VAL_CIFS 0x1
|
||||
|
||||
#define CN_NETLINK_USERS 1
|
||||
|
||||
/*
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
* to achieve effects such as fast scrolling by changing the origin.
|
||||
*/
|
||||
|
||||
#include <linux/vt.h>
|
||||
|
||||
struct vt_struct;
|
||||
|
||||
#define NPAR 16
|
||||
|
|
|
@ -42,6 +42,7 @@ struct notifier_block;
|
|||
/* Need to know about CPUs going up/down? */
|
||||
extern int register_cpu_notifier(struct notifier_block *nb);
|
||||
extern void unregister_cpu_notifier(struct notifier_block *nb);
|
||||
extern int current_in_cpu_hotplug(void);
|
||||
|
||||
int cpu_up(unsigned int cpu);
|
||||
|
||||
|
@ -54,6 +55,10 @@ static inline int register_cpu_notifier(struct notifier_block *nb)
|
|||
static inline void unregister_cpu_notifier(struct notifier_block *nb)
|
||||
{
|
||||
}
|
||||
static inline int current_in_cpu_hotplug(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
extern struct sysdev_class cpu_sysdev_class;
|
||||
|
|
|
@ -329,6 +329,7 @@ static inline int d_mountpoint(struct dentry *dentry)
|
|||
}
|
||||
|
||||
extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
|
||||
extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
|
||||
extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
|
||||
|
||||
extern int sysctl_vfs_cache_pressure;
|
||||
|
|
|
@ -1,136 +0,0 @@
|
|||
/* credit winbond-840.c
|
||||
*/
|
||||
#include <asm/io.h>
|
||||
struct eeprom_ops {
|
||||
void (*set_cs)(void *ee);
|
||||
void (*clear_cs)(void *ee);
|
||||
};
|
||||
|
||||
#define EEPOL_EEDI 0x01
|
||||
#define EEPOL_EEDO 0x02
|
||||
#define EEPOL_EECLK 0x04
|
||||
#define EEPOL_EESEL 0x08
|
||||
|
||||
struct eeprom {
|
||||
void *dev;
|
||||
struct eeprom_ops *ops;
|
||||
|
||||
void __iomem * addr;
|
||||
|
||||
unsigned ee_addr_bits;
|
||||
|
||||
unsigned eesel;
|
||||
unsigned eeclk;
|
||||
unsigned eedo;
|
||||
unsigned eedi;
|
||||
unsigned polarity;
|
||||
unsigned ee_state;
|
||||
|
||||
spinlock_t *lock;
|
||||
u32 *cache;
|
||||
};
|
||||
|
||||
|
||||
u8 eeprom_readb(struct eeprom *ee, unsigned address);
|
||||
void eeprom_read(struct eeprom *ee, unsigned address, u8 *bytes,
|
||||
unsigned count);
|
||||
void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data);
|
||||
void eeprom_write(struct eeprom *ee, unsigned address, u8 *bytes,
|
||||
unsigned count);
|
||||
|
||||
/* The EEPROM commands include the alway-set leading bit. */
|
||||
enum EEPROM_Cmds {
|
||||
EE_WriteCmd=(5 << 6), EE_ReadCmd=(6 << 6), EE_EraseCmd=(7 << 6),
|
||||
};
|
||||
|
||||
void setup_ee_mem_bitbanger(struct eeprom *ee, void __iomem *memaddr, int eesel_bit, int eeclk_bit, int eedo_bit, int eedi_bit, unsigned polarity)
|
||||
{
|
||||
ee->addr = memaddr;
|
||||
ee->eesel = 1 << eesel_bit;
|
||||
ee->eeclk = 1 << eeclk_bit;
|
||||
ee->eedo = 1 << eedo_bit;
|
||||
ee->eedi = 1 << eedi_bit;
|
||||
|
||||
ee->polarity = polarity;
|
||||
|
||||
*ee->cache = readl(ee->addr);
|
||||
}
|
||||
|
||||
/* foo. put this in a .c file */
|
||||
static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 data;
|
||||
|
||||
spin_lock_irqsave(ee->lock, flags);
|
||||
data = *ee->cache;
|
||||
|
||||
data &= ~mask;
|
||||
if (pol)
|
||||
data |= mask;
|
||||
|
||||
*ee->cache = data;
|
||||
//printk("update: %08x\n", data);
|
||||
writel(data, ee->addr);
|
||||
spin_unlock_irqrestore(ee->lock, flags);
|
||||
}
|
||||
|
||||
void eeprom_clk_lo(struct eeprom *ee)
|
||||
{
|
||||
int pol = !!(ee->polarity & EEPOL_EECLK);
|
||||
|
||||
eeprom_update(ee, ee->eeclk, pol);
|
||||
udelay(2);
|
||||
}
|
||||
|
||||
void eeprom_clk_hi(struct eeprom *ee)
|
||||
{
|
||||
int pol = !!(ee->polarity & EEPOL_EECLK);
|
||||
|
||||
eeprom_update(ee, ee->eeclk, !pol);
|
||||
udelay(2);
|
||||
}
|
||||
|
||||
void eeprom_send_addr(struct eeprom *ee, unsigned address)
|
||||
{
|
||||
int pol = !!(ee->polarity & EEPOL_EEDI);
|
||||
unsigned i;
|
||||
address |= 6 << 6;
|
||||
|
||||
/* Shift the read command bits out. */
|
||||
for (i=0; i<11; i++) {
|
||||
eeprom_update(ee, ee->eedi, ((address >> 10) & 1) ^ pol);
|
||||
address <<= 1;
|
||||
eeprom_clk_hi(ee);
|
||||
eeprom_clk_lo(ee);
|
||||
}
|
||||
eeprom_update(ee, ee->eedi, pol);
|
||||
}
|
||||
|
||||
u16 eeprom_readw(struct eeprom *ee, unsigned address)
|
||||
{
|
||||
unsigned i;
|
||||
u16 res = 0;
|
||||
|
||||
eeprom_clk_lo(ee);
|
||||
eeprom_update(ee, ee->eesel, 1 ^ !!(ee->polarity & EEPOL_EESEL));
|
||||
eeprom_send_addr(ee, address);
|
||||
|
||||
for (i=0; i<16; i++) {
|
||||
u32 data;
|
||||
eeprom_clk_hi(ee);
|
||||
res <<= 1;
|
||||
data = readl(ee->addr);
|
||||
//printk("eeprom_readw: %08x\n", data);
|
||||
res |= !!(data & ee->eedo) ^ !!(ee->polarity & EEPOL_EEDO);
|
||||
eeprom_clk_lo(ee);
|
||||
}
|
||||
eeprom_update(ee, ee->eesel, 0 ^ !!(ee->polarity & EEPOL_EESEL));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data)
|
||||
{
|
||||
}
|
|
@ -453,10 +453,11 @@ struct ethtool_ops {
|
|||
* it was foced up into this mode or autonegotiated.
|
||||
*/
|
||||
|
||||
/* The forced speed, 10Mb, 100Mb, gigabit, 10GbE. */
|
||||
/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
|
||||
#define SPEED_10 10
|
||||
#define SPEED_100 100
|
||||
#define SPEED_1000 1000
|
||||
#define SPEED_2500 2500
|
||||
#define SPEED_10000 10000
|
||||
|
||||
/* Duplex, half or full. */
|
||||
|
|
|
@ -201,6 +201,14 @@ struct fb_bitfield {
|
|||
#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
|
||||
#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
|
||||
|
||||
/*
|
||||
* Display rotation support
|
||||
*/
|
||||
#define FB_ROTATE_UR 0
|
||||
#define FB_ROTATE_CW 1
|
||||
#define FB_ROTATE_UD 2
|
||||
#define FB_ROTATE_CCW 3
|
||||
|
||||
#define PICOS2KHZ(a) (1000000000UL/(a))
|
||||
#define KHZ2PICOS(a) (1000000000UL/(a))
|
||||
|
||||
|
@ -489,9 +497,9 @@ struct fb_cursor_user {
|
|||
#define FB_EVENT_MODE_DELETE 0x04
|
||||
/* A driver registered itself */
|
||||
#define FB_EVENT_FB_REGISTERED 0x05
|
||||
/* get console to framebuffer mapping */
|
||||
/* CONSOLE-SPECIFIC: get console to framebuffer mapping */
|
||||
#define FB_EVENT_GET_CONSOLE_MAP 0x06
|
||||
/* set console to framebuffer mapping */
|
||||
/* CONSOLE-SPECIFIC: set console to framebuffer mapping */
|
||||
#define FB_EVENT_SET_CONSOLE_MAP 0x07
|
||||
/* A display blank is requested */
|
||||
#define FB_EVENT_BLANK 0x08
|
||||
|
@ -500,6 +508,12 @@ struct fb_cursor_user {
|
|||
/* The resolution of the passed in fb_info about to change and
|
||||
all vc's should be changed */
|
||||
#define FB_EVENT_MODE_CHANGE_ALL 0x0A
|
||||
/* CONSOLE-SPECIFIC: set console rotation */
|
||||
#define FB_EVENT_SET_CON_ROTATE 0x0B
|
||||
/* CONSOLE-SPECIFIC: get console rotation */
|
||||
#define FB_EVENT_GET_CON_ROTATE 0x0C
|
||||
/* CONSOLE-SPECIFIC: rotate all consoles */
|
||||
#define FB_EVENT_SET_CON_ROTATE_ALL 0x0D
|
||||
|
||||
struct fb_event {
|
||||
struct fb_info *info;
|
||||
|
@ -810,7 +824,6 @@ struct fb_info {
|
|||
extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var);
|
||||
extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var);
|
||||
extern int fb_blank(struct fb_info *info, int blank);
|
||||
extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
|
||||
extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
|
||||
extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
|
||||
extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);
|
||||
|
@ -818,8 +831,8 @@ extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);
|
|||
/* drivers/video/fbmem.c */
|
||||
extern int register_framebuffer(struct fb_info *fb_info);
|
||||
extern int unregister_framebuffer(struct fb_info *fb_info);
|
||||
extern int fb_prepare_logo(struct fb_info *fb_info);
|
||||
extern int fb_show_logo(struct fb_info *fb_info);
|
||||
extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
|
||||
extern int fb_show_logo(struct fb_info *fb_info, int rotate);
|
||||
extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
|
||||
extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx,
|
||||
u32 height, u32 shift_high, u32 shift_low, u32 mod);
|
||||
|
@ -829,6 +842,7 @@ extern int fb_get_color_depth(struct fb_var_screeninfo *var,
|
|||
struct fb_fix_screeninfo *fix);
|
||||
extern int fb_get_options(char *name, char **option);
|
||||
extern int fb_new_modelist(struct fb_info *info);
|
||||
extern int fb_con_duit(struct fb_info *info, int event, void *data);
|
||||
|
||||
extern struct fb_info *registered_fb[FB_MAX];
|
||||
extern int num_registered_fb;
|
||||
|
@ -898,11 +912,13 @@ extern struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var,
|
|||
struct list_head *head);
|
||||
extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var,
|
||||
struct list_head *head);
|
||||
extern struct fb_videomode *fb_find_nearest_mode(struct fb_var_screeninfo *var,
|
||||
extern struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode,
|
||||
struct list_head *head);
|
||||
extern void fb_destroy_modelist(struct list_head *head);
|
||||
extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num,
|
||||
struct list_head *head);
|
||||
extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs,
|
||||
struct list_head *head);
|
||||
|
||||
/* drivers/video/fbcmap.c */
|
||||
extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
|
||||
|
|
|
@ -59,9 +59,9 @@ extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag));
|
|||
extern void put_filp(struct file *);
|
||||
extern int get_unused_fd(void);
|
||||
extern void FASTCALL(put_unused_fd(unsigned int fd));
|
||||
struct kmem_cache_s;
|
||||
extern void filp_ctor(void * objp, struct kmem_cache_s *cachep, unsigned long cflags);
|
||||
extern void filp_dtor(void * objp, struct kmem_cache_s *cachep, unsigned long dflags);
|
||||
struct kmem_cache;
|
||||
extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long cflags);
|
||||
extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long dflags);
|
||||
|
||||
extern struct file ** alloc_fd_array(int);
|
||||
extern void free_fd_array(struct file **, int);
|
||||
|
|
|
@ -31,6 +31,7 @@ struct font_desc {
|
|||
#define SUN12x22_IDX 7
|
||||
#define ACORN8x8_IDX 8
|
||||
#define MINI4x6_IDX 9
|
||||
#define RL_IDX 10
|
||||
|
||||
extern const struct font_desc font_vga_8x8,
|
||||
font_vga_8x16,
|
||||
|
@ -41,6 +42,7 @@ extern const struct font_desc font_vga_8x8,
|
|||
font_sun_8x16,
|
||||
font_sun_12x22,
|
||||
font_acorn_8x8,
|
||||
font_rl,
|
||||
font_mini_4x6;
|
||||
|
||||
/* Find a font with a specific name */
|
||||
|
|
|
@ -104,6 +104,10 @@ extern int dir_notify_enable;
|
|||
#define MS_MOVE 8192
|
||||
#define MS_REC 16384
|
||||
#define MS_VERBOSE 32768
|
||||
#define MS_UNBINDABLE (1<<17) /* change to unbindable */
|
||||
#define MS_PRIVATE (1<<18) /* change to private */
|
||||
#define MS_SLAVE (1<<19) /* change to slave */
|
||||
#define MS_SHARED (1<<20) /* change to shared */
|
||||
#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
|
||||
#define MS_ACTIVE (1<<30)
|
||||
#define MS_NOUSER (1<<31)
|
||||
|
@ -264,6 +268,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
|
|||
#define ATTR_ATTR_FLAG 1024
|
||||
#define ATTR_KILL_SUID 2048
|
||||
#define ATTR_KILL_SGID 4096
|
||||
#define ATTR_FILE 8192
|
||||
|
||||
/*
|
||||
* This is the Inode Attributes structure, used for notify_change(). It
|
||||
|
@ -283,6 +288,13 @@ struct iattr {
|
|||
struct timespec ia_atime;
|
||||
struct timespec ia_mtime;
|
||||
struct timespec ia_ctime;
|
||||
|
||||
/*
|
||||
* Not an attribute, but an auxilary info for filesystems wanting to
|
||||
* implement an ftruncate() like method. NOTE: filesystem should
|
||||
* check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL).
|
||||
*/
|
||||
struct file *ia_file;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -862,6 +874,7 @@ static inline void unlock_super(struct super_block * sb)
|
|||
/*
|
||||
* VFS helper functions..
|
||||
*/
|
||||
extern int vfs_permission(struct nameidata *, int);
|
||||
extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
|
||||
extern int vfs_mkdir(struct inode *, struct dentry *, int);
|
||||
extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
|
||||
|
@ -876,6 +889,11 @@ extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct de
|
|||
*/
|
||||
extern void dentry_unhash(struct dentry *dentry);
|
||||
|
||||
/*
|
||||
* VFS file helper functions.
|
||||
*/
|
||||
extern int file_permission(struct file *, int);
|
||||
|
||||
/*
|
||||
* File types
|
||||
*
|
||||
|
@ -1088,6 +1106,8 @@ int sync_inode(struct inode *inode, struct writeback_control *wbc);
|
|||
* @get_name: find the name for a given inode in a given directory
|
||||
* @get_parent: find the parent of a given directory
|
||||
* @get_dentry: find a dentry for the inode given a file handle sub-fragment
|
||||
* @find_exported_dentry:
|
||||
* set by the exporting module to a standard helper function.
|
||||
*
|
||||
* Description:
|
||||
* The export_operations structure provides a means for nfsd to communicate
|
||||
|
@ -1239,7 +1259,12 @@ extern int unregister_filesystem(struct file_system_type *);
|
|||
extern struct vfsmount *kern_mount(struct file_system_type *);
|
||||
extern int may_umount_tree(struct vfsmount *);
|
||||
extern int may_umount(struct vfsmount *);
|
||||
extern void umount_tree(struct vfsmount *, int, struct list_head *);
|
||||
extern void release_mounts(struct list_head *);
|
||||
extern long do_mount(char *, char *, char *, unsigned long, void *);
|
||||
extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
|
||||
extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
|
||||
struct vfsmount *);
|
||||
|
||||
extern int vfs_statfs(struct super_block *, struct kstatfs *);
|
||||
|
||||
|
@ -1288,7 +1313,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
|
|||
|
||||
/* fs/open.c */
|
||||
|
||||
extern int do_truncate(struct dentry *, loff_t start);
|
||||
extern int do_truncate(struct dentry *, loff_t start, struct file *filp);
|
||||
extern long do_sys_open(const char __user *filename, int flags, int mode);
|
||||
extern struct file *filp_open(const char *, int, int);
|
||||
extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#ifndef FS_ENET_PD_H
|
||||
#define FS_ENET_PD_H
|
||||
|
||||
#include <linux/version.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
#define FS_ENET_NAME "fs_enet"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 2
|
||||
#define FUSE_KERNEL_MINOR_VERSION 3
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
|
@ -61,6 +61,7 @@ struct fuse_kstatfs {
|
|||
#define FATTR_SIZE (1 << 3)
|
||||
#define FATTR_ATIME (1 << 4)
|
||||
#define FATTR_MTIME (1 << 5)
|
||||
#define FATTR_FH (1 << 6)
|
||||
|
||||
/**
|
||||
* Flags returned by the OPEN request
|
||||
|
@ -99,7 +100,9 @@ enum fuse_opcode {
|
|||
FUSE_OPENDIR = 27,
|
||||
FUSE_READDIR = 28,
|
||||
FUSE_RELEASEDIR = 29,
|
||||
FUSE_FSYNCDIR = 30
|
||||
FUSE_FSYNCDIR = 30,
|
||||
FUSE_ACCESS = 34,
|
||||
FUSE_CREATE = 35
|
||||
};
|
||||
|
||||
/* Conservative buffer size for the client */
|
||||
|
@ -152,12 +155,25 @@ struct fuse_link_in {
|
|||
struct fuse_setattr_in {
|
||||
__u32 valid;
|
||||
__u32 padding;
|
||||
struct fuse_attr attr;
|
||||
__u64 fh;
|
||||
__u64 size;
|
||||
__u64 unused1;
|
||||
__u64 atime;
|
||||
__u64 mtime;
|
||||
__u64 unused2;
|
||||
__u32 atimensec;
|
||||
__u32 mtimensec;
|
||||
__u32 unused3;
|
||||
__u32 mode;
|
||||
__u32 unused4;
|
||||
__u32 uid;
|
||||
__u32 gid;
|
||||
__u32 unused5;
|
||||
};
|
||||
|
||||
struct fuse_open_in {
|
||||
__u32 flags;
|
||||
__u32 padding;
|
||||
__u32 mode;
|
||||
};
|
||||
|
||||
struct fuse_open_out {
|
||||
|
@ -222,6 +238,11 @@ struct fuse_getxattr_out {
|
|||
__u32 padding;
|
||||
};
|
||||
|
||||
struct fuse_access_in {
|
||||
__u32 mask;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct fuse_init_in_out {
|
||||
__u32 major;
|
||||
__u32 minor;
|
||||
|
|
51
include/linux/genetlink.h
Normal file
51
include/linux/genetlink.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
#ifndef __LINUX_GENERIC_NETLINK_H
|
||||
#define __LINUX_GENERIC_NETLINK_H
|
||||
|
||||
#include <linux/netlink.h>
|
||||
|
||||
#define GENL_NAMSIZ 16 /* length of family name */
|
||||
|
||||
#define GENL_MIN_ID NLMSG_MIN_TYPE
|
||||
#define GENL_MAX_ID 1023
|
||||
|
||||
struct genlmsghdr {
|
||||
__u8 cmd;
|
||||
__u8 version;
|
||||
__u16 reserved;
|
||||
};
|
||||
|
||||
#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
|
||||
|
||||
/*
|
||||
* List of reserved static generic netlink identifiers:
|
||||
*/
|
||||
#define GENL_ID_GENERATE 0
|
||||
#define GENL_ID_CTRL NLMSG_MIN_TYPE
|
||||
|
||||
/**************************************************************************
|
||||
* Controller
|
||||
**************************************************************************/
|
||||
|
||||
enum {
|
||||
CTRL_CMD_UNSPEC,
|
||||
CTRL_CMD_NEWFAMILY,
|
||||
CTRL_CMD_DELFAMILY,
|
||||
CTRL_CMD_GETFAMILY,
|
||||
CTRL_CMD_NEWOPS,
|
||||
CTRL_CMD_DELOPS,
|
||||
CTRL_CMD_GETOPS,
|
||||
__CTRL_CMD_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
|
||||
|
||||
enum {
|
||||
CTRL_ATTR_UNSPEC,
|
||||
CTRL_ATTR_FAMILY_ID,
|
||||
CTRL_ATTR_FAMILY_NAME,
|
||||
__CTRL_ATTR_MAX,
|
||||
};
|
||||
|
||||
#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
|
||||
|
||||
#endif /* __LINUX_GENERIC_NETLINK_H */
|
|
@ -27,10 +27,10 @@
|
|||
* ---- Driver types -----------------------------------------------------
|
||||
* device id name + number function description, i2c address(es)
|
||||
*
|
||||
* Range 1000-1999 range is defined in sensors/sensors.h
|
||||
* Range 0x100 - 0x1ff is for V4L2 Common Components
|
||||
* Range 1000-1999 range is defined in sensors/sensors.h
|
||||
* Range 0x100 - 0x1ff is for V4L2 Common Components
|
||||
* Range 0xf000 - 0xffff is reserved for local experimentation, and should
|
||||
* never be used in official drivers
|
||||
* never be used in official drivers
|
||||
*/
|
||||
|
||||
#define I2C_DRIVERID_MSP3400 1
|
||||
|
@ -99,7 +99,14 @@
|
|||
#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */
|
||||
#define I2C_DRIVERID_SAA7114H 64 /* video decoder */
|
||||
#define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */
|
||||
|
||||
#define I2C_DRIVERID_TDA9874 66 /* TV sound decoder */
|
||||
#define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */
|
||||
#define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */
|
||||
#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */
|
||||
#define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */
|
||||
#define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */
|
||||
#define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */
|
||||
#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */
|
||||
|
||||
#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
|
||||
#define I2C_DRIVERID_EXP1 0xF1
|
||||
|
@ -111,7 +118,7 @@
|
|||
#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
|
||||
#define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */
|
||||
|
||||
/* IDs -- Use DRIVERIDs 1000-1999 for sensors.
|
||||
/* IDs -- Use DRIVERIDs 1000-1999 for sensors.
|
||||
These were originally in sensors.h in the lm_sensors package */
|
||||
#define I2C_DRIVERID_LM78 1002
|
||||
#define I2C_DRIVERID_LM75 1003
|
||||
|
@ -190,6 +197,7 @@
|
|||
#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */
|
||||
#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */
|
||||
#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */
|
||||
#define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */
|
||||
|
||||
/* --- PCF 8584 based algorithms */
|
||||
#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
|
||||
|
|
|
@ -230,6 +230,7 @@ typedef struct hw_regs_s {
|
|||
int dma; /* our dma entry */
|
||||
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
|
||||
hwif_chipset_t chipset;
|
||||
struct device *dev;
|
||||
} hw_regs_t;
|
||||
|
||||
/*
|
||||
|
@ -266,6 +267,10 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
|
|||
|
||||
#include <asm/ide.h>
|
||||
|
||||
#ifndef MAX_HWIFS
|
||||
#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
|
||||
#endif
|
||||
|
||||
/* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */
|
||||
#ifndef IDE_ARCH_OBSOLETE_DEFAULTS
|
||||
# define ide_default_io_base(index) (0)
|
||||
|
@ -1324,7 +1329,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
|
|||
extern int ideprobe_init(void);
|
||||
|
||||
extern void ide_scan_pcibus(int scan_direction) __init;
|
||||
extern int ide_pci_register_driver(struct pci_driver *driver);
|
||||
extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner);
|
||||
#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE)
|
||||
extern void ide_pci_unregister_driver(struct pci_driver *driver);
|
||||
void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
|
||||
extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#ifndef _LINUX_IF_ETHER_H
|
||||
#define _LINUX_IF_ETHER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
|
||||
* and FCS/CRC (frame check sequence).
|
||||
|
@ -100,7 +102,7 @@
|
|||
struct ethhdr {
|
||||
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
|
||||
unsigned char h_source[ETH_ALEN]; /* source ether addr */
|
||||
unsigned short h_proto; /* packet type ID field */
|
||||
__be16 h_proto; /* packet type ID field */
|
||||
} __attribute__((packed));
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* ==FILEVERSION 20000724==
|
||||
* ==FILEVERSION 20050812==
|
||||
*
|
||||
* NOTE TO MAINTAINERS:
|
||||
* If you modify this file at all, please set the above date.
|
||||
|
@ -35,6 +35,8 @@
|
|||
#ifndef _IF_PPP_H_
|
||||
#define _IF_PPP_H_
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/*
|
||||
* Packet sizes
|
||||
*/
|
||||
|
@ -70,7 +72,8 @@
|
|||
#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
|
||||
#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
|
||||
#define SC_SYNC 0x00200000 /* synchronous serial mode */
|
||||
#define SC_MASK 0x0f200fff /* bits that user can change */
|
||||
#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
|
||||
#define SC_MASK 0x0f600fff /* bits that user can change */
|
||||
|
||||
/* state bits */
|
||||
#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
#ifndef _WANPIPE_SOCK_DRIVER_COMMON_H
|
||||
#define _WANPIPE_SOCK_DRIVER_COMMON_H
|
||||
|
||||
#include <linux/version.h>
|
||||
|
||||
typedef struct {
|
||||
struct net_device *slave;
|
||||
atomic_t packet_sent;
|
||||
|
|
|
@ -1007,7 +1007,7 @@ static inline void input_put_device(struct input_dev *dev)
|
|||
class_device_put(&dev->cdev);
|
||||
}
|
||||
|
||||
void input_register_device(struct input_dev *);
|
||||
int input_register_device(struct input_dev *);
|
||||
void input_unregister_device(struct input_dev *);
|
||||
|
||||
void input_register_handler(struct input_handler *);
|
||||
|
|
|
@ -94,7 +94,7 @@ extern struct resource iomem_resource;
|
|||
extern int request_resource(struct resource *root, struct resource *new);
|
||||
extern struct resource * ____request_resource(struct resource *root, struct resource *new);
|
||||
extern int release_resource(struct resource *new);
|
||||
extern int insert_resource(struct resource *parent, struct resource *new);
|
||||
extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
|
||||
extern int allocate_resource(struct resource *root, struct resource *new,
|
||||
unsigned long size,
|
||||
unsigned long min, unsigned long max,
|
||||
|
|
|
@ -256,10 +256,7 @@ struct ipmi_recv_msg
|
|||
};
|
||||
|
||||
/* Allocate and free the receive message. */
|
||||
static inline void ipmi_free_recv_msg(struct ipmi_recv_msg *msg)
|
||||
{
|
||||
msg->done(msg);
|
||||
}
|
||||
void ipmi_free_recv_msg(struct ipmi_recv_msg *msg);
|
||||
|
||||
struct ipmi_user_hndl
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/config.h>
|
||||
#include <asm/smp.h> /* cpu_online_map */
|
||||
|
||||
#if !defined(CONFIG_ARCH_S390)
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/version.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
#ifndef _ISTALLION_H
|
||||
#define _ISTALLION_H
|
||||
|
|
|
@ -611,6 +611,9 @@ struct transaction_s
|
|||
* @j_revoke: The revoke table - maintains the list of revoked blocks in the
|
||||
* current transaction.
|
||||
* @j_revoke_table: alternate revoke tables for j_revoke
|
||||
* @j_wbuf: array of buffer_heads for journal_commit_transaction
|
||||
* @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the
|
||||
* number that will fit in j_blocksize
|
||||
* @j_private: An opaque pointer to fs-private information.
|
||||
*/
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
*
|
||||
* Created by David Woodhouse <dwmw2@infradead.org>
|
||||
*
|
||||
* For licensing information, see the file 'LICENCE' in the
|
||||
* For licensing information, see the file 'LICENCE' in the
|
||||
* jffs2 directory.
|
||||
*
|
||||
* $Id: jffs2.h,v 1.34 2004/11/16 20:36:14 dwmw2 Exp $
|
||||
* $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -28,6 +28,9 @@
|
|||
#define JFFS2_EMPTY_BITMASK 0xffff
|
||||
#define JFFS2_DIRTY_BITMASK 0x0000
|
||||
|
||||
/* Summary node MAGIC marker */
|
||||
#define JFFS2_SUM_MAGIC 0x02851885
|
||||
|
||||
/* We only allow a single char for length, and 0xFF is empty flash so
|
||||
we don't want it confused with a real length. Hence max 254.
|
||||
*/
|
||||
|
@ -43,8 +46,6 @@
|
|||
#define JFFS2_COMPR_COPY 0x04
|
||||
#define JFFS2_COMPR_DYNRUBIN 0x05
|
||||
#define JFFS2_COMPR_ZLIB 0x06
|
||||
#define JFFS2_COMPR_LZO 0x07
|
||||
#define JFFS2_COMPR_LZARI 0x08
|
||||
/* Compatibility flags. */
|
||||
#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
|
||||
#define JFFS2_NODE_ACCURATE 0x2000
|
||||
|
@ -62,15 +63,17 @@
|
|||
#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
|
||||
#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
|
||||
|
||||
#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
|
||||
|
||||
// Maybe later...
|
||||
//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
|
||||
//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
|
||||
|
||||
|
||||
#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
|
||||
mount time, don't wait for it to
|
||||
#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
|
||||
mount time, don't wait for it to
|
||||
happen later */
|
||||
#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
|
||||
#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
|
||||
compression type */
|
||||
|
||||
|
||||
|
@ -101,7 +104,7 @@ struct jffs2_unknown_node
|
|||
struct jffs2_raw_dirent
|
||||
{
|
||||
jint16_t magic;
|
||||
jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */
|
||||
jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */
|
||||
jint32_t totlen;
|
||||
jint32_t hdr_crc;
|
||||
jint32_t pino;
|
||||
|
@ -117,7 +120,7 @@ struct jffs2_raw_dirent
|
|||
} __attribute__((packed));
|
||||
|
||||
/* The JFFS2 raw inode structure: Used for storage on physical media. */
|
||||
/* The uid, gid, atime, mtime and ctime members could be longer, but
|
||||
/* The uid, gid, atime, mtime and ctime members could be longer, but
|
||||
are left like this for space efficiency. If and when people decide
|
||||
they really need them extended, it's simple enough to add support for
|
||||
a new type of raw node.
|
||||
|
@ -125,7 +128,7 @@ struct jffs2_raw_dirent
|
|||
struct jffs2_raw_inode
|
||||
{
|
||||
jint16_t magic; /* A constant magic number. */
|
||||
jint16_t nodetype; /* == JFFS_NODETYPE_INODE */
|
||||
jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */
|
||||
jint32_t totlen; /* Total length of this node (inc data, etc.) */
|
||||
jint32_t hdr_crc;
|
||||
jint32_t ino; /* Inode number. */
|
||||
|
@ -148,9 +151,25 @@ struct jffs2_raw_inode
|
|||
uint8_t data[0];
|
||||
} __attribute__((packed));
|
||||
|
||||
union jffs2_node_union {
|
||||
struct jffs2_raw_summary
|
||||
{
|
||||
jint16_t magic;
|
||||
jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */
|
||||
jint32_t totlen;
|
||||
jint32_t hdr_crc;
|
||||
jint32_t sum_num; /* number of sum entries*/
|
||||
jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */
|
||||
jint32_t padded; /* sum of the size of padding nodes */
|
||||
jint32_t sum_crc; /* summary information crc */
|
||||
jint32_t node_crc; /* node crc */
|
||||
jint32_t sum[0]; /* inode summary info */
|
||||
} __attribute__((packed));
|
||||
|
||||
union jffs2_node_union
|
||||
{
|
||||
struct jffs2_raw_inode i;
|
||||
struct jffs2_raw_dirent d;
|
||||
struct jffs2_raw_summary s;
|
||||
struct jffs2_unknown_node u;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: jffs2_fs_i.h,v 1.17 2004/11/11 23:51:27 dwmw2 Exp $ */
|
||||
/* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */
|
||||
|
||||
#ifndef _JFFS2_FS_I
|
||||
#define _JFFS2_FS_I
|
||||
|
@ -25,13 +25,16 @@ struct jffs2_inode_info {
|
|||
/* There may be one datanode which isn't referenced by any of the
|
||||
above fragments, if it contains a metadata update but no actual
|
||||
data - or if this is a directory inode */
|
||||
/* This also holds the _only_ dnode for symlinks/device nodes,
|
||||
/* This also holds the _only_ dnode for symlinks/device nodes,
|
||||
etc. */
|
||||
struct jffs2_full_dnode *metadata;
|
||||
|
||||
/* Directory entries */
|
||||
struct jffs2_full_dirent *dents;
|
||||
|
||||
/* The target path if this is the inode of a symlink */
|
||||
unsigned char *target;
|
||||
|
||||
/* Some stuff we just have to keep in-core at all times, for each inode. */
|
||||
struct jffs2_inode_cache *inocache;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: jffs2_fs_sb.h,v 1.52 2005/05/19 16:12:17 gleixner Exp $ */
|
||||
/* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */
|
||||
|
||||
#ifndef _JFFS2_FS_SB
|
||||
#define _JFFS2_FS_SB
|
||||
|
@ -20,7 +20,7 @@
|
|||
struct jffs2_inodirty;
|
||||
|
||||
/* A struct for the overall file system control. Pointers to
|
||||
jffs2_sb_info structs are named `c' in the source code.
|
||||
jffs2_sb_info structs are named `c' in the source code.
|
||||
Nee jffs_control
|
||||
*/
|
||||
struct jffs2_sb_info {
|
||||
|
@ -35,7 +35,7 @@ struct jffs2_sb_info {
|
|||
struct completion gc_thread_start; /* GC thread start completion */
|
||||
struct completion gc_thread_exit; /* GC thread exit completion port */
|
||||
|
||||
struct semaphore alloc_sem; /* Used to protect all the following
|
||||
struct semaphore alloc_sem; /* Used to protect all the following
|
||||
fields, and also to protect against
|
||||
out-of-order writing of nodes. And GC. */
|
||||
uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER
|
||||
|
@ -64,7 +64,7 @@ struct jffs2_sb_info {
|
|||
uint32_t nospc_dirty_size;
|
||||
|
||||
uint32_t nr_blocks;
|
||||
struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
|
||||
struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
|
||||
* from the offset (blocks[ofs / sector_size]) */
|
||||
struct jffs2_eraseblock *nextblock; /* The block we're currently filling */
|
||||
|
||||
|
@ -82,25 +82,26 @@ struct jffs2_sb_info {
|
|||
struct list_head bad_list; /* Bad blocks. */
|
||||
struct list_head bad_used_list; /* Bad blocks with valid data in. */
|
||||
|
||||
spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
|
||||
spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
|
||||
against erase completion handler */
|
||||
wait_queue_head_t erase_wait; /* For waiting for erases to complete */
|
||||
|
||||
wait_queue_head_t inocache_wq;
|
||||
struct jffs2_inode_cache **inocache_list;
|
||||
spinlock_t inocache_lock;
|
||||
|
||||
|
||||
/* Sem to allow jffs2_garbage_collect_deletion_dirent to
|
||||
drop the erase_completion_lock while it's holding a pointer
|
||||
drop the erase_completion_lock while it's holding a pointer
|
||||
to an obsoleted node. I don't like this. Alternatives welcomed. */
|
||||
struct semaphore erase_free_sem;
|
||||
|
||||
uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
|
||||
|
||||
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
|
||||
/* Write-behind buffer for NAND flash */
|
||||
unsigned char *wbuf;
|
||||
uint32_t wbuf_ofs;
|
||||
uint32_t wbuf_len;
|
||||
uint32_t wbuf_pagesize;
|
||||
struct jffs2_inodirty *wbuf_inodes;
|
||||
|
||||
struct rw_semaphore wbuf_sem; /* Protects the write buffer */
|
||||
|
@ -112,6 +113,8 @@ struct jffs2_sb_info {
|
|||
uint32_t fsdata_len;
|
||||
#endif
|
||||
|
||||
struct jffs2_summary *summary; /* Summary information */
|
||||
|
||||
/* OS-private pointer for getting back to master superblock info */
|
||||
void *os_priv;
|
||||
};
|
||||
|
|
|
@ -168,7 +168,7 @@ static inline void console_verbose(void)
|
|||
|
||||
extern void bust_spinlocks(int yes);
|
||||
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
|
||||
extern int panic_timeout;
|
||||
extern __deprecated_for_modules int panic_timeout;
|
||||
extern int panic_on_oops;
|
||||
extern int tainted;
|
||||
extern const char *print_tainted(void);
|
||||
|
@ -266,7 +266,6 @@ extern void dump_stack(void);
|
|||
|
||||
/**
|
||||
* container_of - cast a member of a structure out to the containing structure
|
||||
*
|
||||
* @ptr: the pointer to the member.
|
||||
* @type: the type of the container struct this is embedded in.
|
||||
* @member: the name of the member within the struct.
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <linux/smp.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/cpumask.h>
|
||||
#include <asm/cputime.h>
|
||||
|
||||
/*
|
||||
|
@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void);
|
|||
*/
|
||||
static inline int kstat_irqs(int irq)
|
||||
{
|
||||
int i, sum=0;
|
||||
int cpu, sum = 0;
|
||||
|
||||
for (i = 0; i < NR_CPUS; i++)
|
||||
if (cpu_possible(i))
|
||||
sum += kstat_cpu(i).irqs[irq];
|
||||
for_each_cpu(cpu)
|
||||
sum += kstat_cpu(cpu).irqs[irq];
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,9 @@
|
|||
#include <linux/list.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
#include <asm/kprobes.h>
|
||||
|
||||
|
@ -106,6 +109,9 @@ struct jprobe {
|
|||
kprobe_opcode_t *entry; /* probe handling code to jump to */
|
||||
};
|
||||
|
||||
DECLARE_PER_CPU(struct kprobe *, current_kprobe);
|
||||
DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
|
||||
|
||||
#ifdef ARCH_SUPPORTS_KRETPROBES
|
||||
extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs);
|
||||
#else /* ARCH_SUPPORTS_KRETPROBES */
|
||||
|
@ -142,17 +148,7 @@ struct kretprobe_instance {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_KPROBES
|
||||
/* Locks kprobe: irq must be disabled */
|
||||
void lock_kprobes(void);
|
||||
void unlock_kprobes(void);
|
||||
|
||||
/* kprobe running now on this CPU? */
|
||||
static inline int kprobe_running(void)
|
||||
{
|
||||
extern unsigned int kprobe_cpu;
|
||||
return kprobe_cpu == smp_processor_id();
|
||||
}
|
||||
|
||||
extern spinlock_t kretprobe_lock;
|
||||
extern int arch_prepare_kprobe(struct kprobe *p);
|
||||
extern void arch_copy_kprobe(struct kprobe *p);
|
||||
extern void arch_arm_kprobe(struct kprobe *p);
|
||||
|
@ -163,10 +159,26 @@ extern void show_registers(struct pt_regs *regs);
|
|||
extern kprobe_opcode_t *get_insn_slot(void);
|
||||
extern void free_insn_slot(kprobe_opcode_t *slot);
|
||||
|
||||
/* Get the kprobe at this addr (if any). Must have called lock_kprobes */
|
||||
/* Get the kprobe at this addr (if any) - called with preemption disabled */
|
||||
struct kprobe *get_kprobe(void *addr);
|
||||
struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk);
|
||||
|
||||
/* kprobe_running() will just return the current_kprobe on this CPU */
|
||||
static inline struct kprobe *kprobe_running(void)
|
||||
{
|
||||
return (__get_cpu_var(current_kprobe));
|
||||
}
|
||||
|
||||
static inline void reset_current_kprobe(void)
|
||||
{
|
||||
__get_cpu_var(current_kprobe) = NULL;
|
||||
}
|
||||
|
||||
static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
|
||||
{
|
||||
return (&__get_cpu_var(kprobe_ctlblk));
|
||||
}
|
||||
|
||||
int register_kprobe(struct kprobe *p);
|
||||
void unregister_kprobe(struct kprobe *p);
|
||||
int setjmp_pre_handler(struct kprobe *, struct pt_regs *);
|
||||
|
@ -183,9 +195,9 @@ void add_rp_inst(struct kretprobe_instance *ri);
|
|||
void kprobe_flush_task(struct task_struct *tk);
|
||||
void recycle_rp_inst(struct kretprobe_instance *ri);
|
||||
#else /* CONFIG_KPROBES */
|
||||
static inline int kprobe_running(void)
|
||||
static inline struct kprobe *kprobe_running(void)
|
||||
{
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
static inline int register_kprobe(struct kprobe *p)
|
||||
{
|
||||
|
|
|
@ -214,7 +214,7 @@ struct ata_probe_ent {
|
|||
struct list_head node;
|
||||
struct device *dev;
|
||||
const struct ata_port_operations *port_ops;
|
||||
Scsi_Host_Template *sht;
|
||||
struct scsi_host_template *sht;
|
||||
struct ata_ioports port[ATA_MAX_PORTS];
|
||||
unsigned int n_ports;
|
||||
unsigned int hard_port_no;
|
||||
|
@ -398,7 +398,7 @@ struct ata_port_operations {
|
|||
};
|
||||
|
||||
struct ata_port_info {
|
||||
Scsi_Host_Template *sht;
|
||||
struct scsi_host_template *sht;
|
||||
unsigned long host_flags;
|
||||
unsigned long pio_mask;
|
||||
unsigned long mwdma_mask;
|
||||
|
@ -433,7 +433,7 @@ extern void ata_pci_remove_one (struct pci_dev *pdev);
|
|||
#endif /* CONFIG_PCI */
|
||||
extern int ata_device_add(const struct ata_probe_ent *ent);
|
||||
extern void ata_host_set_remove(struct ata_host_set *host_set);
|
||||
extern int ata_scsi_detect(Scsi_Host_Template *sht);
|
||||
extern int ata_scsi_detect(struct scsi_host_template *sht);
|
||||
extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
|
||||
extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
|
||||
extern int ata_scsi_error(struct Scsi_Host *host);
|
||||
|
|
|
@ -601,7 +601,7 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
|
|||
* or hlist_del_rcu(), running on this same list.
|
||||
* However, it is perfectly legal to run concurrently with
|
||||
* the _rcu list-traversal primitives, such as
|
||||
* hlist_for_each_rcu(), used to prevent memory-consistency
|
||||
* hlist_for_each_entry_rcu(), used to prevent memory-consistency
|
||||
* problems on Alpha CPUs. Regardless of the type of CPU, the
|
||||
* list-traversal primitive must be guarded by rcu_read_lock().
|
||||
*/
|
||||
|
@ -650,7 +650,7 @@ static inline void hlist_add_after(struct hlist_node *n,
|
|||
* or hlist_del_rcu(), running on this same list.
|
||||
* However, it is perfectly legal to run concurrently with
|
||||
* the _rcu list-traversal primitives, such as
|
||||
* hlist_for_each_rcu(), used to prevent memory-consistency
|
||||
* hlist_for_each_entry_rcu(), used to prevent memory-consistency
|
||||
* problems on Alpha CPUs.
|
||||
*/
|
||||
static inline void hlist_add_before_rcu(struct hlist_node *n,
|
||||
|
@ -675,7 +675,7 @@ static inline void hlist_add_before_rcu(struct hlist_node *n,
|
|||
* or hlist_del_rcu(), running on this same list.
|
||||
* However, it is perfectly legal to run concurrently with
|
||||
* the _rcu list-traversal primitives, such as
|
||||
* hlist_for_each_rcu(), used to prevent memory-consistency
|
||||
* hlist_for_each_entry_rcu(), used to prevent memory-consistency
|
||||
* problems on Alpha CPUs.
|
||||
*/
|
||||
static inline void hlist_add_after_rcu(struct hlist_node *prev,
|
||||
|
@ -699,11 +699,6 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
|
|||
for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
|
||||
pos = n)
|
||||
|
||||
#define hlist_for_each_rcu(pos, head) \
|
||||
for ((pos) = (head)->first; \
|
||||
rcu_dereference((pos)) && ({ prefetch((pos)->next); 1; }); \
|
||||
(pos) = (pos)->next)
|
||||
|
||||
/**
|
||||
* hlist_for_each_entry - iterate over list of given type
|
||||
* @tpos: the type * to use as a loop counter.
|
||||
|
@ -756,7 +751,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
|
|||
|
||||
/**
|
||||
* hlist_for_each_entry_rcu - iterate over rcu list of given type
|
||||
* @pos: the type * to use as a loop counter.
|
||||
* @tpos: the type * to use as a loop counter.
|
||||
* @pos: the &struct hlist_node to use as a loop counter.
|
||||
* @head: the head for your list.
|
||||
* @member: the name of the hlist_node within the struct.
|
||||
|
|
|
@ -54,6 +54,9 @@ struct memory_block {
|
|||
*/
|
||||
#define MEM_MAPPING_INVALID (1<<3)
|
||||
|
||||
struct notifier_block;
|
||||
struct mem_section;
|
||||
|
||||
#ifndef CONFIG_MEMORY_HOTPLUG
|
||||
static inline int memory_dev_init(void)
|
||||
{
|
||||
|
|
|
@ -932,13 +932,13 @@ int write_one_page(struct page *page, int wait);
|
|||
* turning readahead off */
|
||||
|
||||
int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
|
||||
unsigned long offset, unsigned long nr_to_read);
|
||||
pgoff_t offset, unsigned long nr_to_read);
|
||||
int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
|
||||
unsigned long offset, unsigned long nr_to_read);
|
||||
unsigned long page_cache_readahead(struct address_space *mapping,
|
||||
pgoff_t offset, unsigned long nr_to_read);
|
||||
unsigned long page_cache_readahead(struct address_space *mapping,
|
||||
struct file_ra_state *ra,
|
||||
struct file *filp,
|
||||
unsigned long offset,
|
||||
pgoff_t offset,
|
||||
unsigned long size);
|
||||
void handle_ra_miss(struct address_space *mapping,
|
||||
struct file_ra_state *ra, pgoff_t offset);
|
||||
|
|
|
@ -17,12 +17,14 @@
|
|||
#include <linux/spinlock.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
#define MNT_NOSUID 1
|
||||
#define MNT_NODEV 2
|
||||
#define MNT_NOEXEC 4
|
||||
#define MNT_NOSUID 0x01
|
||||
#define MNT_NODEV 0x02
|
||||
#define MNT_NOEXEC 0x04
|
||||
#define MNT_SHARED 0x10 /* if the vfsmount is a shared mount */
|
||||
#define MNT_UNBINDABLE 0x20 /* if the vfsmount is a unbindable mount */
|
||||
#define MNT_PNODE_MASK 0x30 /* propogation flag mask */
|
||||
|
||||
struct vfsmount
|
||||
{
|
||||
struct vfsmount {
|
||||
struct list_head mnt_hash;
|
||||
struct vfsmount *mnt_parent; /* fs we are mounted on */
|
||||
struct dentry *mnt_mountpoint; /* dentry of mountpoint */
|
||||
|
@ -36,7 +38,12 @@ struct vfsmount
|
|||
char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
|
||||
struct list_head mnt_list;
|
||||
struct list_head mnt_expire; /* link in fs-specific expiry list */
|
||||
struct list_head mnt_share; /* circular list of shared mounts */
|
||||
struct list_head mnt_slave_list;/* list of slave mounts */
|
||||
struct list_head mnt_slave; /* slave list entry */
|
||||
struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
|
||||
struct namespace *mnt_namespace; /* containing namespace */
|
||||
int mnt_pinned;
|
||||
};
|
||||
|
||||
static inline struct vfsmount *mntget(struct vfsmount *mnt)
|
||||
|
@ -46,15 +53,9 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
|
|||
return mnt;
|
||||
}
|
||||
|
||||
extern void __mntput(struct vfsmount *mnt);
|
||||
|
||||
static inline void mntput_no_expire(struct vfsmount *mnt)
|
||||
{
|
||||
if (mnt) {
|
||||
if (atomic_dec_and_test(&mnt->mnt_count))
|
||||
__mntput(mnt);
|
||||
}
|
||||
}
|
||||
extern void mntput_no_expire(struct vfsmount *mnt);
|
||||
extern void mnt_pin(struct vfsmount *mnt);
|
||||
extern void mnt_unpin(struct vfsmount *mnt);
|
||||
|
||||
static inline void mntput(struct vfsmount *mnt)
|
||||
{
|
||||
|
|
122
include/linux/mtd/bbm.h
Normal file
122
include/linux/mtd/bbm.h
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* linux/include/linux/mtd/bbm.h
|
||||
*
|
||||
* NAND family Bad Block Management (BBM) header file
|
||||
* - Bad Block Table (BBT) implementation
|
||||
*
|
||||
* Copyright (c) 2005 Samsung Electronics
|
||||
* Kyungmin Park <kyungmin.park@samsung.com>
|
||||
*
|
||||
* Copyright (c) 2000-2005
|
||||
* Thomas Gleixner <tglx@linuxtronix.de>
|
||||
*
|
||||
*/
|
||||
#ifndef __LINUX_MTD_BBM_H
|
||||
#define __LINUX_MTD_BBM_H
|
||||
|
||||
/* The maximum number of NAND chips in an array */
|
||||
#define NAND_MAX_CHIPS 8
|
||||
|
||||
/**
|
||||
* struct nand_bbt_descr - bad block table descriptor
|
||||
* @param options options for this descriptor
|
||||
* @param pages the page(s) where we find the bbt, used with
|
||||
* option BBT_ABSPAGE when bbt is searched,
|
||||
* then we store the found bbts pages here.
|
||||
* Its an array and supports up to 8 chips now
|
||||
* @param offs offset of the pattern in the oob area of the page
|
||||
* @param veroffs offset of the bbt version counter in the oob are of the page
|
||||
* @param version version read from the bbt page during scan
|
||||
* @param len length of the pattern, if 0 no pattern check is performed
|
||||
* @param maxblocks maximum number of blocks to search for a bbt. This number of
|
||||
* blocks is reserved at the end of the device
|
||||
* where the tables are written.
|
||||
* @param reserved_block_code if non-0, this pattern denotes a reserved
|
||||
* (rather than bad) block in the stored bbt
|
||||
* @param pattern pattern to identify bad block table or factory marked
|
||||
* good / bad blocks, can be NULL, if len = 0
|
||||
*
|
||||
* Descriptor for the bad block table marker and the descriptor for the
|
||||
* pattern which identifies good and bad blocks. The assumption is made
|
||||
* that the pattern and the version count are always located in the oob area
|
||||
* of the first block.
|
||||
*/
|
||||
struct nand_bbt_descr {
|
||||
int options;
|
||||
int pages[NAND_MAX_CHIPS];
|
||||
int offs;
|
||||
int veroffs;
|
||||
uint8_t version[NAND_MAX_CHIPS];
|
||||
int len;
|
||||
int maxblocks;
|
||||
int reserved_block_code;
|
||||
uint8_t *pattern;
|
||||
};
|
||||
|
||||
/* Options for the bad block table descriptors */
|
||||
|
||||
/* The number of bits used per block in the bbt on the device */
|
||||
#define NAND_BBT_NRBITS_MSK 0x0000000F
|
||||
#define NAND_BBT_1BIT 0x00000001
|
||||
#define NAND_BBT_2BIT 0x00000002
|
||||
#define NAND_BBT_4BIT 0x00000004
|
||||
#define NAND_BBT_8BIT 0x00000008
|
||||
/* The bad block table is in the last good block of the device */
|
||||
#define NAND_BBT_LASTBLOCK 0x00000010
|
||||
/* The bbt is at the given page, else we must scan for the bbt */
|
||||
#define NAND_BBT_ABSPAGE 0x00000020
|
||||
/* The bbt is at the given page, else we must scan for the bbt */
|
||||
#define NAND_BBT_SEARCH 0x00000040
|
||||
/* bbt is stored per chip on multichip devices */
|
||||
#define NAND_BBT_PERCHIP 0x00000080
|
||||
/* bbt has a version counter at offset veroffs */
|
||||
#define NAND_BBT_VERSION 0x00000100
|
||||
/* Create a bbt if none axists */
|
||||
#define NAND_BBT_CREATE 0x00000200
|
||||
/* Search good / bad pattern through all pages of a block */
|
||||
#define NAND_BBT_SCANALLPAGES 0x00000400
|
||||
/* Scan block empty during good / bad block scan */
|
||||
#define NAND_BBT_SCANEMPTY 0x00000800
|
||||
/* Write bbt if neccecary */
|
||||
#define NAND_BBT_WRITE 0x00001000
|
||||
/* Read and write back block contents when writing bbt */
|
||||
#define NAND_BBT_SAVECONTENT 0x00002000
|
||||
/* Search good / bad pattern on the first and the second page */
|
||||
#define NAND_BBT_SCAN2NDPAGE 0x00004000
|
||||
|
||||
/* The maximum number of blocks to scan for a bbt */
|
||||
#define NAND_BBT_SCAN_MAXBLOCKS 4
|
||||
|
||||
/*
|
||||
* Constants for oob configuration
|
||||
*/
|
||||
#define ONENAND_BADBLOCK_POS 0
|
||||
|
||||
/**
|
||||
* struct bbt_info - [GENERIC] Bad Block Table data structure
|
||||
* @param bbt_erase_shift [INTERN] number of address bits in a bbt entry
|
||||
* @param badblockpos [INTERN] position of the bad block marker in the oob area
|
||||
* @param bbt [INTERN] bad block table pointer
|
||||
* @param badblock_pattern [REPLACEABLE] bad block scan pattern used for initial bad block scan
|
||||
* @param priv [OPTIONAL] pointer to private bbm date
|
||||
*/
|
||||
struct bbm_info {
|
||||
int bbt_erase_shift;
|
||||
int badblockpos;
|
||||
int options;
|
||||
|
||||
uint8_t *bbt;
|
||||
|
||||
int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt);
|
||||
|
||||
/* TODO Add more NAND specific fileds */
|
||||
struct nand_bbt_descr *badblock_pattern;
|
||||
|
||||
void *priv;
|
||||
};
|
||||
|
||||
/* OneNAND BBT interface */
|
||||
extern int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
|
||||
extern int onenand_default_bbt(struct mtd_info *mtd);
|
||||
|
||||
#endif /* __LINUX_MTD_BBM_H */
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: blktrans.h,v 1.5 2003/06/23 12:00:08 dwmw2 Exp $
|
||||
* $Id: blktrans.h,v 1.6 2005/11/07 11:14:54 gleixner Exp $
|
||||
*
|
||||
* (C) 2003 David Woodhouse <dwmw2@infradead.org>
|
||||
*
|
||||
|
@ -67,6 +67,6 @@ extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr);
|
|||
extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr);
|
||||
extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev);
|
||||
extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev);
|
||||
|
||||
|
||||
|
||||
#endif /* __MTD_TRANS_H__ */
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
|
||||
/* Common Flash Interface structures
|
||||
/* Common Flash Interface structures
|
||||
* See http://support.intel.com/design/flash/technote/index.htm
|
||||
* $Id: cfi.h,v 1.54 2005/06/06 23:04:36 tpoynor Exp $
|
||||
* $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $
|
||||
*/
|
||||
|
||||
#ifndef __MTD_CFI_H__
|
||||
#define __MTD_CFI_H__
|
||||
|
||||
#include <linux/config.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
@ -82,8 +81,8 @@ static inline int cfi_interleave_supported(int i)
|
|||
}
|
||||
|
||||
|
||||
/* NB: these values must represents the number of bytes needed to meet the
|
||||
* device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes.
|
||||
/* NB: these values must represents the number of bytes needed to meet the
|
||||
* device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes.
|
||||
* These numbers are used in calculations.
|
||||
*/
|
||||
#define CFI_DEVICETYPE_X8 (8 / 8)
|
||||
|
@ -173,6 +172,15 @@ struct cfi_intelext_regioninfo {
|
|||
struct cfi_intelext_blockinfo BlockTypes[1];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct cfi_intelext_programming_regioninfo {
|
||||
uint8_t ProgRegShift;
|
||||
uint8_t Reserved1;
|
||||
uint8_t ControlValid;
|
||||
uint8_t Reserved2;
|
||||
uint8_t ControlInvalid;
|
||||
uint8_t Reserved3;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */
|
||||
|
||||
struct cfi_pri_amdstd {
|
||||
|
@ -250,7 +258,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, int interleave, int
|
|||
/*
|
||||
* Transforms the CFI command for the given geometry (bus width & interleave).
|
||||
* It looks too long to be inline, but in the common case it should almost all
|
||||
* get optimised away.
|
||||
* get optimised away.
|
||||
*/
|
||||
static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi)
|
||||
{
|
||||
|
@ -259,7 +267,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
|
|||
unsigned long onecmd;
|
||||
int i;
|
||||
|
||||
/* We do it this way to give the compiler a fighting chance
|
||||
/* We do it this way to give the compiler a fighting chance
|
||||
of optimising away all the crap for 'bankwidth' larger than
|
||||
an unsigned long, in the common case where that support is
|
||||
disabled */
|
||||
|
@ -270,7 +278,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
|
|||
wordwidth = map_bankwidth(map);
|
||||
words_per_bus = 1;
|
||||
}
|
||||
|
||||
|
||||
chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
|
||||
chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
|
||||
|
||||
|
@ -289,7 +297,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
|
|||
break;
|
||||
}
|
||||
|
||||
/* Now replicate it across the size of an unsigned long, or
|
||||
/* Now replicate it across the size of an unsigned long, or
|
||||
just to the bus width as appropriate */
|
||||
switch (chips_per_word) {
|
||||
default: BUG();
|
||||
|
@ -305,7 +313,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
|
|||
;
|
||||
}
|
||||
|
||||
/* And finally, for the multi-word case, replicate it
|
||||
/* And finally, for the multi-word case, replicate it
|
||||
in all words in the structure */
|
||||
for (i=0; i < words_per_bus; i++) {
|
||||
val.x[i] = onecmd;
|
||||
|
@ -316,14 +324,14 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
|
|||
#define CMD(x) cfi_build_cmd((x), map, cfi)
|
||||
|
||||
|
||||
static inline unsigned char cfi_merge_status(map_word val, struct map_info *map,
|
||||
static inline unsigned long cfi_merge_status(map_word val, struct map_info *map,
|
||||
struct cfi_private *cfi)
|
||||
{
|
||||
int wordwidth, words_per_bus, chip_mode, chips_per_word;
|
||||
unsigned long onestat, res = 0;
|
||||
int i;
|
||||
|
||||
/* We do it this way to give the compiler a fighting chance
|
||||
/* We do it this way to give the compiler a fighting chance
|
||||
of optimising away all the crap for 'bankwidth' larger than
|
||||
an unsigned long, in the common case where that support is
|
||||
disabled */
|
||||
|
@ -334,7 +342,7 @@ static inline unsigned char cfi_merge_status(map_word val, struct map_info *map,
|
|||
wordwidth = map_bankwidth(map);
|
||||
words_per_bus = 1;
|
||||
}
|
||||
|
||||
|
||||
chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
|
||||
chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
/*
|
||||
* Linux driver for Disk-On-Chip devices
|
||||
*
|
||||
* Copyright (C) 1999 Machine Vision Holdings, Inc.
|
||||
* Copyright (C) 1999 Machine Vision Holdings, Inc.
|
||||
* Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org>
|
||||
* Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com>
|
||||
* Copyright (C) 2002-2003 SnapGear Inc
|
||||
*
|
||||
* $Id: doc2000.h,v 1.24 2005/01/05 12:40:38 dwmw2 Exp $
|
||||
* $Id: doc2000.h,v 1.25 2005/11/07 11:14:54 gleixner Exp $
|
||||
*
|
||||
* Released under GPL
|
||||
*/
|
||||
|
@ -75,10 +75,10 @@
|
|||
#define DoC_Mplus_CtrlConfirm 0x1076
|
||||
#define DoC_Mplus_Power 0x1fff
|
||||
|
||||
/* How to access the device?
|
||||
* On ARM, it'll be mmap'd directly with 32-bit wide accesses.
|
||||
/* How to access the device?
|
||||
* On ARM, it'll be mmap'd directly with 32-bit wide accesses.
|
||||
* On PPC, it's mmap'd and 16-bit wide.
|
||||
* Others use readb/writeb
|
||||
* Others use readb/writeb
|
||||
*/
|
||||
#if defined(__arm__)
|
||||
#define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2))))
|
||||
|
@ -172,7 +172,7 @@ struct DiskOnChip {
|
|||
unsigned long totlen;
|
||||
unsigned char ChipID; /* Type of DiskOnChip */
|
||||
int ioreg;
|
||||
|
||||
|
||||
unsigned long mfr; /* Flash IDs - only one type of flash per device */
|
||||
unsigned long id;
|
||||
int chipshift;
|
||||
|
@ -180,10 +180,10 @@ struct DiskOnChip {
|
|||
char pageadrlen;
|
||||
char interleave; /* Internal interleaving - Millennium Plus style */
|
||||
unsigned long erasesize;
|
||||
|
||||
|
||||
int curfloor;
|
||||
int curchip;
|
||||
|
||||
|
||||
int numchips;
|
||||
struct Nand *chips;
|
||||
struct mtd_info *nextdoc;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
|
||||
/*
|
||||
/*
|
||||
* struct flchip definition
|
||||
*
|
||||
* Contains information about the location and state of a given flash device
|
||||
*
|
||||
* Contains information about the location and state of a given flash device
|
||||
*
|
||||
* (C) 2000 Red Hat. GPLd.
|
||||
*
|
||||
* $Id: flashchip.h,v 1.17 2005/03/14 18:27:15 bjd Exp $
|
||||
* $Id: flashchip.h,v 1.18 2005/11/07 11:14:54 gleixner Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,11 +15,11 @@
|
|||
|
||||
/* For spinlocks. sched.h includes spinlock.h from whichever directory it
|
||||
* happens to be in - so we don't have to care whether we're on 2.2, which
|
||||
* has asm/spinlock.h, or 2.4, which has linux/spinlock.h
|
||||
* has asm/spinlock.h, or 2.4, which has linux/spinlock.h
|
||||
*/
|
||||
#include <linux/sched.h>
|
||||
|
||||
typedef enum {
|
||||
typedef enum {
|
||||
FL_READY,
|
||||
FL_STATUS,
|
||||
FL_CFI_QUERY,
|
||||
|
@ -45,7 +45,7 @@ typedef enum {
|
|||
|
||||
|
||||
|
||||
/* NOTE: confusingly, this can be used to refer to more than one chip at a time,
|
||||
/* NOTE: confusingly, this can be used to refer to more than one chip at a time,
|
||||
if they're interleaved. This can even refer to individual partitions on
|
||||
the same physical chip when present. */
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* $Id: ftl.h,v 1.6 2003/01/24 13:20:04 dwmw2 Exp $
|
||||
*
|
||||
* $Id: ftl.h,v 1.7 2005/11/07 11:14:54 gleixner Exp $
|
||||
*
|
||||
* Derived from (and probably identical to):
|
||||
* ftl.h 1.7 1999/10/25 20:23:17
|
||||
*
|
||||
|
@ -12,7 +12,7 @@
|
|||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
* limitations under the License.
|
||||
*
|
||||
* The initial developer of the original code is David A. Hinds
|
||||
* <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/*
|
||||
* (C) 2001, 2001 Red Hat, Inc.
|
||||
* GPL'd
|
||||
* $Id: gen_probe.h,v 1.3 2004/10/20 22:10:33 dwmw2 Exp $
|
||||
* $Id: gen_probe.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MTD_GEN_PROBE_H__
|
||||
#define __LINUX_MTD_GEN_PROBE_H__
|
||||
|
||||
#include <linux/mtd/flashchip.h>
|
||||
#include <linux/mtd/map.h>
|
||||
#include <linux/mtd/map.h>
|
||||
#include <linux/mtd/cfi.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
/* JEDEC Flash Interface.
|
||||
* This is an older type of interface for self programming flash. It is
|
||||
* This is an older type of interface for self programming flash. It is
|
||||
* commonly use in older AMD chips and is obsolete compared with CFI.
|
||||
* It is called JEDEC because the JEDEC association distributes the ID codes
|
||||
* for the chips.
|
||||
*
|
||||
* See the AMD flash databook for information on how to operate the interface.
|
||||
*
|
||||
* $Id: jedec.h,v 1.3 2003/05/21 11:51:01 dwmw2 Exp $
|
||||
* $Id: jedec.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MTD_JEDEC_H__
|
||||
|
@ -33,16 +33,16 @@ struct jedec_flash_chip
|
|||
__u16 jedec;
|
||||
unsigned long size;
|
||||
unsigned long sectorsize;
|
||||
|
||||
|
||||
// *(__u8*)(base + (adder << addrshift)) = data << datashift
|
||||
// Address size = size << addrshift
|
||||
unsigned long base; // Byte 0 of the flash, will be unaligned
|
||||
unsigned int datashift; // Useful for 32bit/16bit accesses
|
||||
unsigned int addrshift;
|
||||
unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash
|
||||
|
||||
|
||||
__u32 capabilities;
|
||||
|
||||
|
||||
// These markers are filled in by the flash_chip_scan function
|
||||
unsigned long start;
|
||||
unsigned long length;
|
||||
|
@ -51,16 +51,16 @@ struct jedec_flash_chip
|
|||
struct jedec_private
|
||||
{
|
||||
unsigned long size; // Total size of all the devices
|
||||
|
||||
|
||||
/* Bank handling. If sum(bank_fill) == size then this is linear flash.
|
||||
Otherwise the mapping has holes in it. bank_fill may be used to
|
||||
find the holes, but in the common symetric case
|
||||
bank_fill[0] == bank_fill[*], thus addresses may be computed
|
||||
find the holes, but in the common symetric case
|
||||
bank_fill[0] == bank_fill[*], thus addresses may be computed
|
||||
mathmatically. bank_fill must be powers of two */
|
||||
unsigned is_banked;
|
||||
unsigned long bank_fill[MAX_JEDEC_CHIPS];
|
||||
|
||||
struct jedec_flash_chip chips[MAX_JEDEC_CHIPS];
|
||||
|
||||
struct jedec_flash_chip chips[MAX_JEDEC_CHIPS];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/* Overhauled routines for dealing with different mmap regions of flash */
|
||||
/* $Id: map.h,v 1.52 2005/05/25 10:29:41 gleixner Exp $ */
|
||||
/* $Id: map.h,v 1.54 2005/11/07 11:14:54 gleixner Exp $ */
|
||||
|
||||
#ifndef __LINUX_MTD_MAP_H__
|
||||
#define __LINUX_MTD_MAP_H__
|
||||
|
@ -170,14 +170,14 @@ typedef union {
|
|||
to a chip probe routine -- either JEDEC or CFI probe or both -- via
|
||||
do_map_probe(). If a chip is recognised, the probe code will invoke the
|
||||
appropriate chip driver (if present) and return a struct mtd_info.
|
||||
At which point, you fill in the mtd->module with your own module
|
||||
At which point, you fill in the mtd->module with your own module
|
||||
address, and register it with the MTD core code. Or you could partition
|
||||
it and register the partitions instead, or keep it for your own private
|
||||
use; whatever.
|
||||
|
||||
|
||||
The mtd->priv field will point to the struct map_info, and any further
|
||||
private data required by the chip driver is linked from the
|
||||
mtd->priv->fldrv_priv field. This allows the map driver to get at
|
||||
private data required by the chip driver is linked from the
|
||||
mtd->priv->fldrv_priv field. This allows the map driver to get at
|
||||
the destructor function map->fldrv_destroy() when it's tired
|
||||
of living.
|
||||
*/
|
||||
|
@ -214,7 +214,7 @@ struct map_info {
|
|||
If there is no cache to care about this can be set to NULL. */
|
||||
void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
|
||||
|
||||
/* set_vpp() must handle being reentered -- enable, enable, disable
|
||||
/* set_vpp() must handle being reentered -- enable, enable, disable
|
||||
must leave it enabled. */
|
||||
void (*set_vpp)(struct map_info *, int);
|
||||
|
||||
|
@ -353,7 +353,7 @@ static inline map_word map_word_ff(struct map_info *map)
|
|||
{
|
||||
map_word r;
|
||||
int i;
|
||||
|
||||
|
||||
if (map_bankwidth(map) < MAP_FF_LIMIT) {
|
||||
int bw = 8 * map_bankwidth(map);
|
||||
r.x[0] = (1 << bw) - 1;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: mtd.h,v 1.59 2005/04/11 10:19:02 gleixner Exp $
|
||||
/*
|
||||
* $Id: mtd.h,v 1.61 2005/11/07 11:14:54 gleixner Exp $
|
||||
*
|
||||
* Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al.
|
||||
*
|
||||
|
@ -14,7 +14,6 @@
|
|||
#endif
|
||||
|
||||
#include <linux/config.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/uio.h>
|
||||
|
@ -72,7 +71,17 @@ struct mtd_info {
|
|||
u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
|
||||
u_int32_t ecctype;
|
||||
u_int32_t eccsize;
|
||||
|
||||
|
||||
/*
|
||||
* Reuse some of the above unused fields in the case of NOR flash
|
||||
* with configurable programming regions to avoid modifying the
|
||||
* user visible structure layout/size. Only valid when the
|
||||
* MTD_PROGRAM_REGIONS flag is set.
|
||||
* (Maybe we should have an union for those?)
|
||||
*/
|
||||
#define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock
|
||||
#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
|
||||
#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
|
||||
|
||||
// Kernel-only stuff starts here.
|
||||
char *name;
|
||||
|
@ -80,13 +89,13 @@ struct mtd_info {
|
|||
|
||||
// oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
|
||||
struct nand_oobinfo oobinfo;
|
||||
u_int32_t oobavail; // Number of bytes in OOB area available for fs
|
||||
u_int32_t oobavail; // Number of bytes in OOB area available for fs
|
||||
|
||||
/* Data for variable erase regions. If numeraseregions is zero,
|
||||
* it means that the whole device has erasesize as given above.
|
||||
* it means that the whole device has erasesize as given above.
|
||||
*/
|
||||
int numeraseregions;
|
||||
struct mtd_erase_region_info *eraseregions;
|
||||
struct mtd_erase_region_info *eraseregions;
|
||||
|
||||
/* This really shouldn't be here. It can go away in 2.5 */
|
||||
u_int32_t bank_size;
|
||||
|
@ -109,10 +118,10 @@ struct mtd_info {
|
|||
int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
|
||||
int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
|
||||
|
||||
/*
|
||||
* Methods to access the protection register area, present in some
|
||||
/*
|
||||
* Methods to access the protection register area, present in some
|
||||
* flash devices. The user data is one time programmable but the
|
||||
* factory data is read only.
|
||||
* factory data is read only.
|
||||
*/
|
||||
int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
|
||||
int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
|
||||
|
@ -123,14 +132,14 @@ struct mtd_info {
|
|||
|
||||
/* kvec-based read/write methods. We need these especially for NAND flash,
|
||||
with its limited number of write cycles per erase.
|
||||
NB: The 'count' parameter is the number of _vectors_, each of
|
||||
NB: The 'count' parameter is the number of _vectors_, each of
|
||||
which contains an (ofs, len) tuple.
|
||||
*/
|
||||
int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
|
||||
int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
|
||||
int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
|
||||
size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
|
||||
int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
|
||||
int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
|
||||
int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
|
||||
size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
|
||||
|
||||
/* Sync */
|
||||
|
@ -194,7 +203,7 @@ int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
|
|||
#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
|
||||
#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
|
||||
#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
|
||||
#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
|
||||
#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
|
||||
|
||||
|
||||
#ifdef CONFIG_MTD_PARTITIONS
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Steven J. Hill <sjhill@realitydiluted.com>
|
||||
* Thomas Gleixner <tglx@linutronix.de>
|
||||
*
|
||||
* $Id: nand.h,v 1.73 2005/05/31 19:39:17 gleixner Exp $
|
||||
* $Id: nand.h,v 1.74 2005/09/15 13:58:50 vwool Exp $
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
|
@ -24,7 +24,7 @@
|
|||
* bat later if I did something naughty.
|
||||
* 10-11-2000 SJH Added private NAND flash structure for driver
|
||||
* 10-24-2000 SJH Added prototype for 'nand_scan' function
|
||||
* 10-29-2001 TG changed nand_chip structure to support
|
||||
* 10-29-2001 TG changed nand_chip structure to support
|
||||
* hardwarespecific function for accessing control lines
|
||||
* 02-21-2002 TG added support for different read/write adress and
|
||||
* ready/busy line access function
|
||||
|
@ -36,21 +36,21 @@
|
|||
* CONFIG_MTD_NAND_ECC_JFFS2 is not set
|
||||
* 08-10-2002 TG extensions to nand_chip structure to support HW-ECC
|
||||
*
|
||||
* 08-29-2002 tglx nand_chip structure: data_poi for selecting
|
||||
* 08-29-2002 tglx nand_chip structure: data_poi for selecting
|
||||
* internal / fs-driver buffer
|
||||
* support for 6byte/512byte hardware ECC
|
||||
* read_ecc, write_ecc extended for different oob-layout
|
||||
* oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB,
|
||||
* NAND_YAFFS_OOB
|
||||
* 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL
|
||||
* Split manufacturer and device ID structures
|
||||
* Split manufacturer and device ID structures
|
||||
*
|
||||
* 02-08-2004 tglx added option field to nand structure for chip anomalities
|
||||
* 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
|
||||
* update of nand_chip structure description
|
||||
* 01-17-2005 dmarlin added extended commands for AG-AND device and added option
|
||||
* 01-17-2005 dmarlin added extended commands for AG-AND device and added option
|
||||
* for BBT_AUTO_REFRESH.
|
||||
* 01-20-2005 dmarlin added optional pointer to hardware specific callback for
|
||||
* 01-20-2005 dmarlin added optional pointer to hardware specific callback for
|
||||
* extra error status checks.
|
||||
*/
|
||||
#ifndef __LINUX_MTD_NAND_H
|
||||
|
@ -120,8 +120,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
|
|||
#define NAND_CMD_CACHEDPROG 0x15
|
||||
|
||||
/* Extended commands for AG-AND device */
|
||||
/*
|
||||
* Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but
|
||||
/*
|
||||
* Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but
|
||||
* there is no way to distinguish that from NAND_CMD_READ0
|
||||
* until the remaining sequence of commands has been completed
|
||||
* so add a high order bit and mask it off in the command.
|
||||
|
@ -145,7 +145,7 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
|
|||
#define NAND_STATUS_READY 0x40
|
||||
#define NAND_STATUS_WP 0x80
|
||||
|
||||
/*
|
||||
/*
|
||||
* Constants for ECC_MODES
|
||||
*/
|
||||
|
||||
|
@ -191,12 +191,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
|
|||
#define NAND_CACHEPRG 0x00000008
|
||||
/* Chip has copy back function */
|
||||
#define NAND_COPYBACK 0x00000010
|
||||
/* AND Chip which has 4 banks and a confusing page / block
|
||||
/* AND Chip which has 4 banks and a confusing page / block
|
||||
* assignment. See Renesas datasheet for further information */
|
||||
#define NAND_IS_AND 0x00000020
|
||||
/* Chip has a array of 4 pages which can be read without
|
||||
* additional ready /busy waits */
|
||||
#define NAND_4PAGE_ARRAY 0x00000040
|
||||
#define NAND_4PAGE_ARRAY 0x00000040
|
||||
/* Chip requires that BBT is periodically rewritten to prevent
|
||||
* bits from adjacent blocks from 'leaking' in altering data.
|
||||
* This happens with the Renesas AG-AND chips, possibly others. */
|
||||
|
@ -219,8 +219,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
|
|||
/* Use a flash based bad block table. This option is passed to the
|
||||
* default bad block table function. */
|
||||
#define NAND_USE_FLASH_BBT 0x00010000
|
||||
/* The hw ecc generator provides a syndrome instead a ecc value on read
|
||||
* This can only work if we have the ecc bytes directly behind the
|
||||
/* The hw ecc generator provides a syndrome instead a ecc value on read
|
||||
* This can only work if we have the ecc bytes directly behind the
|
||||
* data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
|
||||
#define NAND_HWECC_SYNDROME 0x00020000
|
||||
/* This option skips the bbt scan during initialization. */
|
||||
|
@ -244,6 +244,7 @@ typedef enum {
|
|||
FL_ERASING,
|
||||
FL_SYNCING,
|
||||
FL_CACHEDPRG,
|
||||
FL_PM_SUSPENDED,
|
||||
} nand_state_t;
|
||||
|
||||
/* Keep gcc happy */
|
||||
|
@ -251,7 +252,7 @@ struct nand_chip;
|
|||
|
||||
/**
|
||||
* struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices
|
||||
* @lock: protection lock
|
||||
* @lock: protection lock
|
||||
* @active: the mtd device which holds the controller currently
|
||||
* @wq: wait queue to sleep on if a NAND operation is in progress
|
||||
* used instead of the per chip wait queue when a hw controller is available
|
||||
|
@ -264,8 +265,8 @@ struct nand_hw_control {
|
|||
|
||||
/**
|
||||
* struct nand_chip - NAND Private Flash Chip Data
|
||||
* @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
|
||||
* @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
|
||||
* @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
|
||||
* @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
|
||||
* @read_byte: [REPLACEABLE] read one byte from the chip
|
||||
* @write_byte: [REPLACEABLE] write one byte to the chip
|
||||
* @read_word: [REPLACEABLE] read one word from the chip
|
||||
|
@ -288,7 +289,7 @@ struct nand_hw_control {
|
|||
* be provided if a hardware ECC is available
|
||||
* @erase_cmd: [INTERN] erase command write function, selectable due to AND support
|
||||
* @scan_bbt: [REPLACEABLE] function to scan bad block table
|
||||
* @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
|
||||
* @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
|
||||
* @eccsize: [INTERN] databytes used per ecc-calculation
|
||||
* @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step
|
||||
* @eccsteps: [INTERN] number of ecc calculation steps per page
|
||||
|
@ -300,7 +301,7 @@ struct nand_hw_control {
|
|||
* @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
|
||||
* @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
|
||||
* @chip_shift: [INTERN] number of address bits in one chip
|
||||
* @data_buf: [INTERN] internal buffer for one page + oob
|
||||
* @data_buf: [INTERN] internal buffer for one page + oob
|
||||
* @oob_buf: [INTERN] oob buffer for one eraseblock
|
||||
* @oobdirty: [INTERN] indicates that oob_buf must be reinitialized
|
||||
* @data_poi: [INTERN] pointer to a data buffer
|
||||
|
@ -315,22 +316,22 @@ struct nand_hw_control {
|
|||
* @bbt: [INTERN] bad block table pointer
|
||||
* @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
|
||||
* @bbt_md: [REPLACEABLE] bad block table mirror descriptor
|
||||
* @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
|
||||
* @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
|
||||
* @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices
|
||||
* @priv: [OPTIONAL] pointer to private chip date
|
||||
* @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
|
||||
* @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
|
||||
* (determine if errors are correctable)
|
||||
*/
|
||||
|
||||
|
||||
struct nand_chip {
|
||||
void __iomem *IO_ADDR_R;
|
||||
void __iomem *IO_ADDR_W;
|
||||
|
||||
|
||||
u_char (*read_byte)(struct mtd_info *mtd);
|
||||
void (*write_byte)(struct mtd_info *mtd, u_char byte);
|
||||
u16 (*read_word)(struct mtd_info *mtd);
|
||||
void (*write_word)(struct mtd_info *mtd, u16 word);
|
||||
|
||||
|
||||
void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len);
|
||||
void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
|
||||
int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
|
||||
|
@ -395,7 +396,7 @@ struct nand_chip {
|
|||
* @name: Identify the device type
|
||||
* @id: device ID code
|
||||
* @pagesize: Pagesize in bytes. Either 256 or 512 or 0
|
||||
* If the pagesize is 0, then the real pagesize
|
||||
* If the pagesize is 0, then the real pagesize
|
||||
* and the eraseize are determined from the
|
||||
* extended id bytes in the chip
|
||||
* @erasesize: Size of an erase block in the flash device.
|
||||
|
@ -424,7 +425,7 @@ struct nand_manufacturers {
|
|||
extern struct nand_flash_dev nand_flash_ids[];
|
||||
extern struct nand_manufacturers nand_manuf_ids[];
|
||||
|
||||
/**
|
||||
/**
|
||||
* struct nand_bbt_descr - bad block table descriptor
|
||||
* @options: options for this descriptor
|
||||
* @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE
|
||||
|
@ -435,14 +436,14 @@ extern struct nand_manufacturers nand_manuf_ids[];
|
|||
* @version: version read from the bbt page during scan
|
||||
* @len: length of the pattern, if 0 no pattern check is performed
|
||||
* @maxblocks: maximum number of blocks to search for a bbt. This number of
|
||||
* blocks is reserved at the end of the device where the tables are
|
||||
* blocks is reserved at the end of the device where the tables are
|
||||
* written.
|
||||
* @reserved_block_code: if non-0, this pattern denotes a reserved (rather than
|
||||
* bad) block in the stored bbt
|
||||
* @pattern: pattern to identify bad block table or factory marked good /
|
||||
* @pattern: pattern to identify bad block table or factory marked good /
|
||||
* bad blocks, can be NULL, if len = 0
|
||||
*
|
||||
* Descriptor for the bad block table marker and the descriptor for the
|
||||
* Descriptor for the bad block table marker and the descriptor for the
|
||||
* pattern which identifies good and bad blocks. The assumption is made
|
||||
* that the pattern and the version count are always located in the oob area
|
||||
* of the first block.
|
||||
|
|
155
include/linux/mtd/onenand.h
Normal file
155
include/linux/mtd/onenand.h
Normal file
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* linux/include/linux/mtd/onenand.h
|
||||
*
|
||||
* Copyright (C) 2005 Samsung Electronics
|
||||
* Kyungmin Park <kyungmin.park@samsung.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MTD_ONENAND_H
|
||||
#define __LINUX_MTD_ONENAND_H
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/mtd/onenand_regs.h>
|
||||
#include <linux/mtd/bbm.h>
|
||||
|
||||
#define MAX_BUFFERRAM 2
|
||||
#define MAX_ONENAND_PAGESIZE (2048 + 64)
|
||||
|
||||
/* Scan and identify a OneNAND device */
|
||||
extern int onenand_scan(struct mtd_info *mtd, int max_chips);
|
||||
/* Free resources held by the OneNAND device */
|
||||
extern void onenand_release(struct mtd_info *mtd);
|
||||
|
||||
/**
|
||||
* onenand_state_t - chip states
|
||||
* Enumeration for OneNAND flash chip state
|
||||
*/
|
||||
typedef enum {
|
||||
FL_READY,
|
||||
FL_READING,
|
||||
FL_WRITING,
|
||||
FL_ERASING,
|
||||
FL_SYNCING,
|
||||
FL_UNLOCKING,
|
||||
FL_LOCKING,
|
||||
FL_PM_SUSPENDED,
|
||||
} onenand_state_t;
|
||||
|
||||
/**
|
||||
* struct onenand_bufferram - OneNAND BufferRAM Data
|
||||
* @param block block address in BufferRAM
|
||||
* @param page page address in BufferRAM
|
||||
* @param valid valid flag
|
||||
*/
|
||||
struct onenand_bufferram {
|
||||
int block;
|
||||
int page;
|
||||
int valid;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct onenand_chip - OneNAND Private Flash Chip Data
|
||||
* @param base [BOARDSPECIFIC] address to access OneNAND
|
||||
* @param chipsize [INTERN] the size of one chip for multichip arrays
|
||||
* @param device_id [INTERN] device ID
|
||||
* @param verstion_id [INTERN] version ID
|
||||
* @param options [BOARDSPECIFIC] various chip options. They can partly be set to inform onenand_scan about
|
||||
* @param erase_shift [INTERN] number of address bits in a block
|
||||
* @param page_shift [INTERN] number of address bits in a page
|
||||
* @param ppb_shift [INTERN] number of address bits in a pages per block
|
||||
* @param page_mask [INTERN] a page per block mask
|
||||
* @param bufferam_index [INTERN] BufferRAM index
|
||||
* @param bufferam [INTERN] BufferRAM info
|
||||
* @param readw [REPLACEABLE] hardware specific function for read short
|
||||
* @param writew [REPLACEABLE] hardware specific function for write short
|
||||
* @param command [REPLACEABLE] hardware specific function for writing commands to the chip
|
||||
* @param wait [REPLACEABLE] hardware specific function for wait on ready
|
||||
* @param read_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area
|
||||
* @param write_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area
|
||||
* @param read_word [REPLACEABLE] hardware specific function for read register of OneNAND
|
||||
* @param write_word [REPLACEABLE] hardware specific function for write register of OneNAND
|
||||
* @param scan_bbt [REPLACEALBE] hardware specific function for scaning Bad block Table
|
||||
* @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip
|
||||
* @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress
|
||||
* @param state [INTERN] the current state of the OneNAND device
|
||||
* @param autooob [REPLACEABLE] the default (auto)placement scheme
|
||||
* @param bbm [REPLACEABLE] pointer to Bad Block Management
|
||||
* @param priv [OPTIONAL] pointer to private chip date
|
||||
*/
|
||||
struct onenand_chip {
|
||||
void __iomem *base;
|
||||
unsigned int chipsize;
|
||||
unsigned int device_id;
|
||||
unsigned int density_mask;
|
||||
unsigned int options;
|
||||
|
||||
unsigned int erase_shift;
|
||||
unsigned int page_shift;
|
||||
unsigned int ppb_shift; /* Pages per block shift */
|
||||
unsigned int page_mask;
|
||||
|
||||
unsigned int bufferram_index;
|
||||
struct onenand_bufferram bufferram[MAX_BUFFERRAM];
|
||||
|
||||
int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len);
|
||||
int (*wait)(struct mtd_info *mtd, int state);
|
||||
int (*read_bufferram)(struct mtd_info *mtd, int area,
|
||||
unsigned char *buffer, int offset, size_t count);
|
||||
int (*write_bufferram)(struct mtd_info *mtd, int area,
|
||||
const unsigned char *buffer, int offset, size_t count);
|
||||
unsigned short (*read_word)(void __iomem *addr);
|
||||
void (*write_word)(unsigned short value, void __iomem *addr);
|
||||
void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
|
||||
int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
|
||||
int (*scan_bbt)(struct mtd_info *mtd);
|
||||
|
||||
spinlock_t chip_lock;
|
||||
wait_queue_head_t wq;
|
||||
onenand_state_t state;
|
||||
|
||||
struct nand_oobinfo *autooob;
|
||||
|
||||
void *bbm;
|
||||
|
||||
void *priv;
|
||||
};
|
||||
|
||||
/*
|
||||
* Helper macros
|
||||
*/
|
||||
#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index)
|
||||
#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
|
||||
#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
|
||||
|
||||
#define ONENAND_GET_SYS_CFG1(this) \
|
||||
(this->read_word(this->base + ONENAND_REG_SYS_CFG1))
|
||||
#define ONENAND_SET_SYS_CFG1(v, this) \
|
||||
(this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
|
||||
|
||||
/*
|
||||
* Options bits
|
||||
*/
|
||||
#define ONENAND_CONT_LOCK (0x0001)
|
||||
|
||||
|
||||
/*
|
||||
* OneNAND Flash Manufacturer ID Codes
|
||||
*/
|
||||
#define ONENAND_MFR_SAMSUNG 0xec
|
||||
#define ONENAND_MFR_UNKNOWN 0x00
|
||||
|
||||
/**
|
||||
* struct nand_manufacturers - NAND Flash Manufacturer ID Structure
|
||||
* @param name: Manufacturer name
|
||||
* @param id: manufacturer ID code of device.
|
||||
*/
|
||||
struct onenand_manufacturers {
|
||||
int id;
|
||||
char *name;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MTD_ONENAND_H */
|
180
include/linux/mtd/onenand_regs.h
Normal file
180
include/linux/mtd/onenand_regs.h
Normal file
|
@ -0,0 +1,180 @@
|
|||
/*
|
||||
* linux/include/linux/mtd/onenand_regs.h
|
||||
*
|
||||
* OneNAND Register header file
|
||||
*
|
||||
* Copyright (C) 2005 Samsung Electronics
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ONENAND_REG_H
|
||||
#define __ONENAND_REG_H
|
||||
|
||||
/* Memory Address Map Translation (Word order) */
|
||||
#define ONENAND_MEMORY_MAP(x) ((x) << 1)
|
||||
|
||||
/*
|
||||
* External BufferRAM area
|
||||
*/
|
||||
#define ONENAND_BOOTRAM ONENAND_MEMORY_MAP(0x0000)
|
||||
#define ONENAND_DATARAM ONENAND_MEMORY_MAP(0x0200)
|
||||
#define ONENAND_SPARERAM ONENAND_MEMORY_MAP(0x8010)
|
||||
|
||||
/*
|
||||
* OneNAND Registers
|
||||
*/
|
||||
#define ONENAND_REG_MANUFACTURER_ID ONENAND_MEMORY_MAP(0xF000)
|
||||
#define ONENAND_REG_DEVICE_ID ONENAND_MEMORY_MAP(0xF001)
|
||||
#define ONENAND_REG_VERSION_ID ONENAND_MEMORY_MAP(0xF002)
|
||||
#define ONENAND_REG_DATA_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF003)
|
||||
#define ONENAND_REG_BOOT_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF004)
|
||||
#define ONENAND_REG_NUM_BUFFERS ONENAND_MEMORY_MAP(0xF005)
|
||||
#define ONENAND_REG_TECHNOLOGY ONENAND_MEMORY_MAP(0xF006)
|
||||
|
||||
#define ONENAND_REG_START_ADDRESS1 ONENAND_MEMORY_MAP(0xF100)
|
||||
#define ONENAND_REG_START_ADDRESS2 ONENAND_MEMORY_MAP(0xF101)
|
||||
#define ONENAND_REG_START_ADDRESS3 ONENAND_MEMORY_MAP(0xF102)
|
||||
#define ONENAND_REG_START_ADDRESS4 ONENAND_MEMORY_MAP(0xF103)
|
||||
#define ONENAND_REG_START_ADDRESS5 ONENAND_MEMORY_MAP(0xF104)
|
||||
#define ONENAND_REG_START_ADDRESS6 ONENAND_MEMORY_MAP(0xF105)
|
||||
#define ONENAND_REG_START_ADDRESS7 ONENAND_MEMORY_MAP(0xF106)
|
||||
#define ONENAND_REG_START_ADDRESS8 ONENAND_MEMORY_MAP(0xF107)
|
||||
|
||||
#define ONENAND_REG_START_BUFFER ONENAND_MEMORY_MAP(0xF200)
|
||||
#define ONENAND_REG_COMMAND ONENAND_MEMORY_MAP(0xF220)
|
||||
#define ONENAND_REG_SYS_CFG1 ONENAND_MEMORY_MAP(0xF221)
|
||||
#define ONENAND_REG_SYS_CFG2 ONENAND_MEMORY_MAP(0xF222)
|
||||
#define ONENAND_REG_CTRL_STATUS ONENAND_MEMORY_MAP(0xF240)
|
||||
#define ONENAND_REG_INTERRUPT ONENAND_MEMORY_MAP(0xF241)
|
||||
#define ONENAND_REG_START_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24C)
|
||||
#define ONENAND_REG_END_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24D)
|
||||
#define ONENAND_REG_WP_STATUS ONENAND_MEMORY_MAP(0xF24E)
|
||||
|
||||
#define ONENAND_REG_ECC_STATUS ONENAND_MEMORY_MAP(0xFF00)
|
||||
#define ONENAND_REG_ECC_M0 ONENAND_MEMORY_MAP(0xFF01)
|
||||
#define ONENAND_REG_ECC_S0 ONENAND_MEMORY_MAP(0xFF02)
|
||||
#define ONENAND_REG_ECC_M1 ONENAND_MEMORY_MAP(0xFF03)
|
||||
#define ONENAND_REG_ECC_S1 ONENAND_MEMORY_MAP(0xFF04)
|
||||
#define ONENAND_REG_ECC_M2 ONENAND_MEMORY_MAP(0xFF05)
|
||||
#define ONENAND_REG_ECC_S2 ONENAND_MEMORY_MAP(0xFF06)
|
||||
#define ONENAND_REG_ECC_M3 ONENAND_MEMORY_MAP(0xFF07)
|
||||
#define ONENAND_REG_ECC_S3 ONENAND_MEMORY_MAP(0xFF08)
|
||||
|
||||
/*
|
||||
* Device ID Register F001h (R)
|
||||
*/
|
||||
#define ONENAND_DEVICE_DENSITY_SHIFT (4)
|
||||
#define ONENAND_DEVICE_IS_DDP (1 << 3)
|
||||
#define ONENAND_DEVICE_IS_DEMUX (1 << 2)
|
||||
#define ONENAND_DEVICE_VCC_MASK (0x3)
|
||||
|
||||
#define ONENAND_DEVICE_DENSITY_512Mb (0x002)
|
||||
|
||||
/*
|
||||
* Version ID Register F002h (R)
|
||||
*/
|
||||
#define ONENAND_VERSION_PROCESS_SHIFT (8)
|
||||
|
||||
/*
|
||||
* Start Address 1 F100h (R/W)
|
||||
*/
|
||||
#define ONENAND_DDP_SHIFT (15)
|
||||
|
||||
/*
|
||||
* Start Address 8 F107h (R/W)
|
||||
*/
|
||||
#define ONENAND_FPA_MASK (0x3f)
|
||||
#define ONENAND_FPA_SHIFT (2)
|
||||
#define ONENAND_FSA_MASK (0x03)
|
||||
|
||||
/*
|
||||
* Start Buffer Register F200h (R/W)
|
||||
*/
|
||||
#define ONENAND_BSA_MASK (0x03)
|
||||
#define ONENAND_BSA_SHIFT (8)
|
||||
#define ONENAND_BSA_BOOTRAM (0 << 2)
|
||||
#define ONENAND_BSA_DATARAM0 (2 << 2)
|
||||
#define ONENAND_BSA_DATARAM1 (3 << 2)
|
||||
#define ONENAND_BSC_MASK (0x03)
|
||||
|
||||
/*
|
||||
* Command Register F220h (R/W)
|
||||
*/
|
||||
#define ONENAND_CMD_READ (0x00)
|
||||
#define ONENAND_CMD_READOOB (0x13)
|
||||
#define ONENAND_CMD_PROG (0x80)
|
||||
#define ONENAND_CMD_PROGOOB (0x1A)
|
||||
#define ONENAND_CMD_UNLOCK (0x23)
|
||||
#define ONENAND_CMD_LOCK (0x2A)
|
||||
#define ONENAND_CMD_LOCK_TIGHT (0x2C)
|
||||
#define ONENAND_CMD_ERASE (0x94)
|
||||
#define ONENAND_CMD_RESET (0xF0)
|
||||
#define ONENAND_CMD_READID (0x90)
|
||||
|
||||
/* NOTE: Those are not *REAL* commands */
|
||||
#define ONENAND_CMD_BUFFERRAM (0x1978)
|
||||
|
||||
/*
|
||||
* System Configuration 1 Register F221h (R, R/W)
|
||||
*/
|
||||
#define ONENAND_SYS_CFG1_SYNC_READ (1 << 15)
|
||||
#define ONENAND_SYS_CFG1_BRL_7 (7 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_6 (6 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_5 (5 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_4 (4 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_3 (3 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_10 (2 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_9 (1 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_8 (0 << 12)
|
||||
#define ONENAND_SYS_CFG1_BRL_SHIFT (12)
|
||||
#define ONENAND_SYS_CFG1_BL_32 (4 << 9)
|
||||
#define ONENAND_SYS_CFG1_BL_16 (3 << 9)
|
||||
#define ONENAND_SYS_CFG1_BL_8 (2 << 9)
|
||||
#define ONENAND_SYS_CFG1_BL_4 (1 << 9)
|
||||
#define ONENAND_SYS_CFG1_BL_CONT (0 << 9)
|
||||
#define ONENAND_SYS_CFG1_BL_SHIFT (9)
|
||||
#define ONENAND_SYS_CFG1_NO_ECC (1 << 8)
|
||||
#define ONENAND_SYS_CFG1_RDY (1 << 7)
|
||||
#define ONENAND_SYS_CFG1_INT (1 << 6)
|
||||
#define ONENAND_SYS_CFG1_IOBE (1 << 5)
|
||||
#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4)
|
||||
|
||||
/*
|
||||
* Controller Status Register F240h (R)
|
||||
*/
|
||||
#define ONENAND_CTRL_ONGO (1 << 15)
|
||||
#define ONENAND_CTRL_LOCK (1 << 14)
|
||||
#define ONENAND_CTRL_LOAD (1 << 13)
|
||||
#define ONENAND_CTRL_PROGRAM (1 << 12)
|
||||
#define ONENAND_CTRL_ERASE (1 << 11)
|
||||
#define ONENAND_CTRL_ERROR (1 << 10)
|
||||
#define ONENAND_CTRL_RSTB (1 << 7)
|
||||
|
||||
/*
|
||||
* Interrupt Status Register F241h (R)
|
||||
*/
|
||||
#define ONENAND_INT_MASTER (1 << 15)
|
||||
#define ONENAND_INT_READ (1 << 7)
|
||||
#define ONENAND_INT_WRITE (1 << 6)
|
||||
#define ONENAND_INT_ERASE (1 << 5)
|
||||
#define ONENAND_INT_RESET (1 << 4)
|
||||
#define ONENAND_INT_CLEAR (0 << 0)
|
||||
|
||||
/*
|
||||
* NAND Flash Write Protection Status Register F24Eh (R)
|
||||
*/
|
||||
#define ONENAND_WP_US (1 << 2)
|
||||
#define ONENAND_WP_LS (1 << 1)
|
||||
#define ONENAND_WP_LTS (1 << 0)
|
||||
|
||||
/*
|
||||
* ECC Status Reigser FF00h (R)
|
||||
*/
|
||||
#define ONENAND_ECC_1BIT (1 << 0)
|
||||
#define ONENAND_ECC_2BIT (1 << 1)
|
||||
#define ONENAND_ECC_2BIT_ALL (0xAAAA)
|
||||
|
||||
#endif /* __ONENAND_REG_H */
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* This code is GPL
|
||||
*
|
||||
* $Id: partitions.h,v 1.16 2004/11/16 18:34:40 dwmw2 Exp $
|
||||
* $Id: partitions.h,v 1.17 2005/11/07 11:14:55 gleixner Exp $
|
||||
*/
|
||||
|
||||
#ifndef MTD_PARTITIONS_H
|
||||
|
@ -16,25 +16,25 @@
|
|||
|
||||
/*
|
||||
* Partition definition structure:
|
||||
*
|
||||
*
|
||||
* An array of struct partition is passed along with a MTD object to
|
||||
* add_mtd_partitions() to create them.
|
||||
*
|
||||
* For each partition, these fields are available:
|
||||
* name: string that will be used to label the partition's MTD device.
|
||||
* size: the partition size; if defined as MTDPART_SIZ_FULL, the partition
|
||||
* size: the partition size; if defined as MTDPART_SIZ_FULL, the partition
|
||||
* will extend to the end of the master MTD device.
|
||||
* offset: absolute starting position within the master MTD device; if
|
||||
* defined as MTDPART_OFS_APPEND, the partition will start where the
|
||||
* offset: absolute starting position within the master MTD device; if
|
||||
* defined as MTDPART_OFS_APPEND, the partition will start where the
|
||||
* previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block.
|
||||
* mask_flags: contains flags that have to be masked (removed) from the
|
||||
* mask_flags: contains flags that have to be masked (removed) from the
|
||||
* master MTD flag set for the corresponding MTD partition.
|
||||
* For example, to force a read-only partition, simply adding
|
||||
* For example, to force a read-only partition, simply adding
|
||||
* MTD_WRITEABLE to the mask_flags will do the trick.
|
||||
*
|
||||
* Note: writeable partitions require their size and offset be
|
||||
* Note: writeable partitions require their size and offset be
|
||||
* erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK).
|
||||
*/
|
||||
*/
|
||||
|
||||
struct mtd_partition {
|
||||
char *name; /* identifier string */
|
||||
|
@ -66,7 +66,7 @@ struct mtd_part_parser {
|
|||
|
||||
extern int register_mtd_parser(struct mtd_part_parser *parser);
|
||||
extern int deregister_mtd_parser(struct mtd_part_parser *parser);
|
||||
extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
|
||||
extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
|
||||
struct mtd_partition **pparts, unsigned long origin);
|
||||
|
||||
#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* For boards with physically mapped flash and using
|
||||
* For boards with physically mapped flash and using
|
||||
* drivers/mtd/maps/physmap.c mapping driver.
|
||||
*
|
||||
* $Id: physmap.h,v 1.3 2004/07/21 00:16:15 jwboyer Exp $
|
||||
* $Id: physmap.h,v 1.4 2005/11/07 11:14:55 gleixner Exp $
|
||||
*
|
||||
* Copyright (C) 2003 MontaVista Software Inc.
|
||||
* Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include <linux/config.h>
|
||||
|
||||
#if defined(CONFIG_MTD_PHYSMAP)
|
||||
#if defined(CONFIG_MTD_PHYSMAP)
|
||||
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/map.h>
|
||||
|
@ -44,12 +44,12 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int
|
|||
#if defined(CONFIG_MTD_PARTITIONS)
|
||||
|
||||
/*
|
||||
* Machines that wish to do flash partition may want to call this function in
|
||||
* their setup routine.
|
||||
* Machines that wish to do flash partition may want to call this function in
|
||||
* their setup routine.
|
||||
*
|
||||
* physmap_set_partitions(mypartitions, num_parts);
|
||||
*
|
||||
* Note that one can always override this hard-coded partition with
|
||||
* Note that one can always override this hard-coded partition with
|
||||
* command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS).
|
||||
*/
|
||||
void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $
|
||||
* $Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $
|
||||
*
|
||||
* PMC551 PCI Mezzanine Ram Device
|
||||
*
|
||||
|
@ -7,7 +7,7 @@
|
|||
* Mark Ferrell
|
||||
* Copyright 1999,2000 Nortel Networks
|
||||
*
|
||||
* License:
|
||||
* License:
|
||||
* As part of this driver was derrived from the slram.c driver it falls
|
||||
* under the same license, which is GNU General Public License v2
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include <linux/mtd/mtd.h>
|
||||
|
||||
#define PMC551_VERSION "$Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $\n"\
|
||||
#define PMC551_VERSION "$Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $\n"\
|
||||
"Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n"
|
||||
|
||||
/*
|
||||
|
@ -30,7 +30,7 @@ struct mypriv {
|
|||
u32 curr_map0;
|
||||
u32 asize;
|
||||
struct mtd_info *nextpmc551;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* Function Prototypes
|
||||
|
@ -39,7 +39,7 @@ static int pmc551_erase(struct mtd_info *, struct erase_info *);
|
|||
static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t);
|
||||
static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf);
|
||||
static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *);
|
||||
static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
|
||||
static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -50,7 +50,7 @@ static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_cha
|
|||
#endif
|
||||
|
||||
#ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC
|
||||
#define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200
|
||||
#define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
|
||||
* $Id: xip.h,v 1.5 2005/11/07 11:14:55 gleixner Exp $
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MTD_XIP_H__
|
||||
|
@ -22,19 +22,19 @@
|
|||
|
||||
#ifdef CONFIG_MTD_XIP
|
||||
|
||||
/*
|
||||
* Function that are modifying the flash state away from array mode must
|
||||
* obviously not be running from flash. The __xipram is therefore marking
|
||||
* those functions so they get relocated to ram.
|
||||
*/
|
||||
#define __xipram __attribute__ ((__section__ (".data")))
|
||||
|
||||
/*
|
||||
* We really don't want gcc to guess anything.
|
||||
* We absolutely _need_ proper inlining.
|
||||
*/
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/*
|
||||
* Function that are modifying the flash state away from array mode must
|
||||
* obviously not be running from flash. The __xipram is therefore marking
|
||||
* those functions so they get relocated to ram.
|
||||
*/
|
||||
#define __xipram noinline __attribute__ ((__section__ (".data")))
|
||||
|
||||
/*
|
||||
* Each architecture has to provide the following macros. They must access
|
||||
* the hardware directly and not rely on any other (XIP) functions since they
|
||||
|
@ -60,9 +60,9 @@
|
|||
* overflowing.
|
||||
*
|
||||
* xip_iprefetch()
|
||||
*
|
||||
*
|
||||
* Macro to fill instruction prefetch
|
||||
* e.g. a series of nops: asm volatile (".rep 8; nop; .endr");
|
||||
* e.g. a series of nops: asm volatile (".rep 8; nop; .endr");
|
||||
*/
|
||||
|
||||
#include <asm/mtd-xip.h>
|
||||
|
|
|
@ -74,7 +74,7 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
|
|||
extern void release_open_intent(struct nameidata *);
|
||||
|
||||
extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
|
||||
extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
|
||||
extern struct dentry * lookup_hash(struct nameidata *);
|
||||
|
||||
extern int follow_down(struct vfsmount **, struct dentry **);
|
||||
extern int follow_up(struct vfsmount **, struct dentry **);
|
||||
|
|
|
@ -9,7 +9,8 @@ struct namespace {
|
|||
atomic_t count;
|
||||
struct vfsmount * root;
|
||||
struct list_head list;
|
||||
struct rw_semaphore sem;
|
||||
wait_queue_head_t poll;
|
||||
int event;
|
||||
};
|
||||
|
||||
extern int copy_namespace(int, struct task_struct *);
|
||||
|
|
|
@ -71,6 +71,7 @@ typedef enum {
|
|||
* @SOCK_RAW: raw socket
|
||||
* @SOCK_RDM: reliably-delivered message
|
||||
* @SOCK_SEQPACKET: sequential packet socket
|
||||
* @SOCK_DCCP: Datagram Congestion Control Protocol socket
|
||||
* @SOCK_PACKET: linux specific way of getting packets at the dev level.
|
||||
* For writing rarp and other similar things on the user level.
|
||||
*
|
||||
|
|
|
@ -931,6 +931,13 @@ extern int netdev_max_backlog;
|
|||
extern int weight_p;
|
||||
extern int netdev_set_master(struct net_device *dev, struct net_device *master);
|
||||
extern int skb_checksum_help(struct sk_buff *skb, int inward);
|
||||
#ifdef CONFIG_BUG
|
||||
extern void netdev_rx_csum_fault(struct net_device *dev);
|
||||
#else
|
||||
static inline void netdev_rx_csum_fault(struct net_device *dev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
/* rx skb timestamps */
|
||||
extern void net_enable_timestamp(void);
|
||||
extern void net_disable_timestamp(void);
|
||||
|
|
159
include/linux/netfilter/nf_conntrack_common.h
Normal file
159
include/linux/netfilter/nf_conntrack_common.h
Normal file
|
@ -0,0 +1,159 @@
|
|||
#ifndef _NF_CONNTRACK_COMMON_H
|
||||
#define _NF_CONNTRACK_COMMON_H
|
||||
/* Connection state tracking for netfilter. This is separated from,
|
||||
but required by, the NAT layer; it can also be used by an iptables
|
||||
extension. */
|
||||
enum ip_conntrack_info
|
||||
{
|
||||
/* Part of an established connection (either direction). */
|
||||
IP_CT_ESTABLISHED,
|
||||
|
||||
/* Like NEW, but related to an existing connection, or ICMP error
|
||||
(in either direction). */
|
||||
IP_CT_RELATED,
|
||||
|
||||
/* Started a new connection to track (only
|
||||
IP_CT_DIR_ORIGINAL); may be a retransmission. */
|
||||
IP_CT_NEW,
|
||||
|
||||
/* >= this indicates reply direction */
|
||||
IP_CT_IS_REPLY,
|
||||
|
||||
/* Number of distinct IP_CT types (no NEW in reply dirn). */
|
||||
IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
|
||||
};
|
||||
|
||||
/* Bitset representing status of connection. */
|
||||
enum ip_conntrack_status {
|
||||
/* It's an expected connection: bit 0 set. This bit never changed */
|
||||
IPS_EXPECTED_BIT = 0,
|
||||
IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
|
||||
|
||||
/* We've seen packets both ways: bit 1 set. Can be set, not unset. */
|
||||
IPS_SEEN_REPLY_BIT = 1,
|
||||
IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
|
||||
|
||||
/* Conntrack should never be early-expired. */
|
||||
IPS_ASSURED_BIT = 2,
|
||||
IPS_ASSURED = (1 << IPS_ASSURED_BIT),
|
||||
|
||||
/* Connection is confirmed: originating packet has left box */
|
||||
IPS_CONFIRMED_BIT = 3,
|
||||
IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
|
||||
|
||||
/* Connection needs src nat in orig dir. This bit never changed. */
|
||||
IPS_SRC_NAT_BIT = 4,
|
||||
IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
|
||||
|
||||
/* Connection needs dst nat in orig dir. This bit never changed. */
|
||||
IPS_DST_NAT_BIT = 5,
|
||||
IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
|
||||
|
||||
/* Both together. */
|
||||
IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
|
||||
|
||||
/* Connection needs TCP sequence adjusted. */
|
||||
IPS_SEQ_ADJUST_BIT = 6,
|
||||
IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
|
||||
|
||||
/* NAT initialization bits. */
|
||||
IPS_SRC_NAT_DONE_BIT = 7,
|
||||
IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
|
||||
|
||||
IPS_DST_NAT_DONE_BIT = 8,
|
||||
IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
|
||||
|
||||
/* Both together */
|
||||
IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
|
||||
|
||||
/* Connection is dying (removed from lists), can not be unset. */
|
||||
IPS_DYING_BIT = 9,
|
||||
IPS_DYING = (1 << IPS_DYING_BIT),
|
||||
};
|
||||
|
||||
/* Connection tracking event bits */
|
||||
enum ip_conntrack_events
|
||||
{
|
||||
/* New conntrack */
|
||||
IPCT_NEW_BIT = 0,
|
||||
IPCT_NEW = (1 << IPCT_NEW_BIT),
|
||||
|
||||
/* Expected connection */
|
||||
IPCT_RELATED_BIT = 1,
|
||||
IPCT_RELATED = (1 << IPCT_RELATED_BIT),
|
||||
|
||||
/* Destroyed conntrack */
|
||||
IPCT_DESTROY_BIT = 2,
|
||||
IPCT_DESTROY = (1 << IPCT_DESTROY_BIT),
|
||||
|
||||
/* Timer has been refreshed */
|
||||
IPCT_REFRESH_BIT = 3,
|
||||
IPCT_REFRESH = (1 << IPCT_REFRESH_BIT),
|
||||
|
||||
/* Status has changed */
|
||||
IPCT_STATUS_BIT = 4,
|
||||
IPCT_STATUS = (1 << IPCT_STATUS_BIT),
|
||||
|
||||
/* Update of protocol info */
|
||||
IPCT_PROTOINFO_BIT = 5,
|
||||
IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT),
|
||||
|
||||
/* Volatile protocol info */
|
||||
IPCT_PROTOINFO_VOLATILE_BIT = 6,
|
||||
IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT),
|
||||
|
||||
/* New helper for conntrack */
|
||||
IPCT_HELPER_BIT = 7,
|
||||
IPCT_HELPER = (1 << IPCT_HELPER_BIT),
|
||||
|
||||
/* Update of helper info */
|
||||
IPCT_HELPINFO_BIT = 8,
|
||||
IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT),
|
||||
|
||||
/* Volatile helper info */
|
||||
IPCT_HELPINFO_VOLATILE_BIT = 9,
|
||||
IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT),
|
||||
|
||||
/* NAT info */
|
||||
IPCT_NATINFO_BIT = 10,
|
||||
IPCT_NATINFO = (1 << IPCT_NATINFO_BIT),
|
||||
|
||||
/* Counter highest bit has been set */
|
||||
IPCT_COUNTER_FILLING_BIT = 11,
|
||||
IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT),
|
||||
};
|
||||
|
||||
enum ip_conntrack_expect_events {
|
||||
IPEXP_NEW_BIT = 0,
|
||||
IPEXP_NEW = (1 << IPEXP_NEW_BIT),
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct ip_conntrack_counter
|
||||
{
|
||||
u_int32_t packets;
|
||||
u_int32_t bytes;
|
||||
};
|
||||
|
||||
struct ip_conntrack_stat
|
||||
{
|
||||
unsigned int searched;
|
||||
unsigned int found;
|
||||
unsigned int new;
|
||||
unsigned int invalid;
|
||||
unsigned int ignore;
|
||||
unsigned int delete;
|
||||
unsigned int delete_list;
|
||||
unsigned int insert;
|
||||
unsigned int insert_failed;
|
||||
unsigned int drop;
|
||||
unsigned int early_drop;
|
||||
unsigned int error;
|
||||
unsigned int expect_new;
|
||||
unsigned int expect_create;
|
||||
unsigned int expect_delete;
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _NF_CONNTRACK_COMMON_H */
|
44
include/linux/netfilter/nf_conntrack_ftp.h
Normal file
44
include/linux/netfilter/nf_conntrack_ftp.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
#ifndef _NF_CONNTRACK_FTP_H
|
||||
#define _NF_CONNTRACK_FTP_H
|
||||
/* FTP tracking. */
|
||||
|
||||
/* This enum is exposed to userspace */
|
||||
enum ip_ct_ftp_type
|
||||
{
|
||||
/* PORT command from client */
|
||||
IP_CT_FTP_PORT,
|
||||
/* PASV response from server */
|
||||
IP_CT_FTP_PASV,
|
||||
/* EPRT command from client */
|
||||
IP_CT_FTP_EPRT,
|
||||
/* EPSV response from server */
|
||||
IP_CT_FTP_EPSV,
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define FTP_PORT 21
|
||||
|
||||
#define NUM_SEQ_TO_REMEMBER 2
|
||||
/* This structure exists only once per master */
|
||||
struct ip_ct_ftp_master {
|
||||
/* Valid seq positions for cmd matching after newline */
|
||||
u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
|
||||
/* 0 means seq_match_aft_nl not set */
|
||||
int seq_aft_nl_num[IP_CT_DIR_MAX];
|
||||
};
|
||||
|
||||
struct ip_conntrack_expect;
|
||||
|
||||
/* For NAT to hook in when we find a packet which describes what other
|
||||
* connection we should expect. */
|
||||
extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
enum ip_ct_ftp_type type,
|
||||
unsigned int matchoff,
|
||||
unsigned int matchlen,
|
||||
struct ip_conntrack_expect *exp,
|
||||
u32 *seq);
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _NF_CONNTRACK_FTP_H */
|
27
include/linux/netfilter/nf_conntrack_sctp.h
Normal file
27
include/linux/netfilter/nf_conntrack_sctp.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef _NF_CONNTRACK_SCTP_H
|
||||
#define _NF_CONNTRACK_SCTP_H
|
||||
/* SCTP tracking. */
|
||||
|
||||
#include <linux/netfilter/nf_conntrack_tuple_common.h>
|
||||
|
||||
enum sctp_conntrack {
|
||||
SCTP_CONNTRACK_NONE,
|
||||
SCTP_CONNTRACK_CLOSED,
|
||||
SCTP_CONNTRACK_COOKIE_WAIT,
|
||||
SCTP_CONNTRACK_COOKIE_ECHOED,
|
||||
SCTP_CONNTRACK_ESTABLISHED,
|
||||
SCTP_CONNTRACK_SHUTDOWN_SENT,
|
||||
SCTP_CONNTRACK_SHUTDOWN_RECD,
|
||||
SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
|
||||
SCTP_CONNTRACK_MAX
|
||||
};
|
||||
|
||||
struct ip_ct_sctp
|
||||
{
|
||||
enum sctp_conntrack state;
|
||||
|
||||
u_int32_t vtag[IP_CT_DIR_MAX];
|
||||
u_int32_t ttag[IP_CT_DIR_MAX];
|
||||
};
|
||||
|
||||
#endif /* _NF_CONNTRACK_SCTP_H */
|
56
include/linux/netfilter/nf_conntrack_tcp.h
Normal file
56
include/linux/netfilter/nf_conntrack_tcp.h
Normal file
|
@ -0,0 +1,56 @@
|
|||
#ifndef _NF_CONNTRACK_TCP_H
|
||||
#define _NF_CONNTRACK_TCP_H
|
||||
/* TCP tracking. */
|
||||
|
||||
/* This is exposed to userspace (ctnetlink) */
|
||||
enum tcp_conntrack {
|
||||
TCP_CONNTRACK_NONE,
|
||||
TCP_CONNTRACK_SYN_SENT,
|
||||
TCP_CONNTRACK_SYN_RECV,
|
||||
TCP_CONNTRACK_ESTABLISHED,
|
||||
TCP_CONNTRACK_FIN_WAIT,
|
||||
TCP_CONNTRACK_CLOSE_WAIT,
|
||||
TCP_CONNTRACK_LAST_ACK,
|
||||
TCP_CONNTRACK_TIME_WAIT,
|
||||
TCP_CONNTRACK_CLOSE,
|
||||
TCP_CONNTRACK_LISTEN,
|
||||
TCP_CONNTRACK_MAX,
|
||||
TCP_CONNTRACK_IGNORE
|
||||
};
|
||||
|
||||
/* Window scaling is advertised by the sender */
|
||||
#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
|
||||
|
||||
/* SACK is permitted by the sender */
|
||||
#define IP_CT_TCP_FLAG_SACK_PERM 0x02
|
||||
|
||||
/* This sender sent FIN first */
|
||||
#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct ip_ct_tcp_state {
|
||||
u_int32_t td_end; /* max of seq + len */
|
||||
u_int32_t td_maxend; /* max of ack + max(win, 1) */
|
||||
u_int32_t td_maxwin; /* max(win) */
|
||||
u_int8_t td_scale; /* window scale factor */
|
||||
u_int8_t loose; /* used when connection picked up from the middle */
|
||||
u_int8_t flags; /* per direction options */
|
||||
};
|
||||
|
||||
struct ip_ct_tcp
|
||||
{
|
||||
struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
|
||||
u_int8_t state; /* state of the connection (enum tcp_conntrack) */
|
||||
/* For detecting stale connections */
|
||||
u_int8_t last_dir; /* Direction of the last packet (enum ip_conntrack_dir) */
|
||||
u_int8_t retrans; /* Number of retransmitted packets */
|
||||
u_int8_t last_index; /* Index of the last packet */
|
||||
u_int32_t last_seq; /* Last sequence number seen in dir */
|
||||
u_int32_t last_ack; /* Last sequence number seen in opposite dir */
|
||||
u_int32_t last_end; /* Last seq + len */
|
||||
};
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _NF_CONNTRACK_TCP_H */
|
13
include/linux/netfilter/nf_conntrack_tuple_common.h
Normal file
13
include/linux/netfilter/nf_conntrack_tuple_common.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
|
||||
#define _NF_CONNTRACK_TUPLE_COMMON_H
|
||||
|
||||
enum ip_conntrack_dir
|
||||
{
|
||||
IP_CT_DIR_ORIGINAL,
|
||||
IP_CT_DIR_REPLY,
|
||||
IP_CT_DIR_MAX
|
||||
};
|
||||
|
||||
#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
|
||||
|
||||
#endif /* _NF_CONNTRACK_TUPLE_COMMON_H */
|
|
@ -146,7 +146,7 @@ extern void nfnl_unlock(void);
|
|||
extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n);
|
||||
extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n);
|
||||
|
||||
extern int nfattr_parse(struct nfattr *tb[], int maxattr,
|
||||
extern void nfattr_parse(struct nfattr *tb[], int maxattr,
|
||||
struct nfattr *nfa, int len);
|
||||
|
||||
#define nfattr_parse_nested(tb, max, nfa) \
|
||||
|
|
|
@ -1,132 +1,7 @@
|
|||
#ifndef _IP_CONNTRACK_H
|
||||
#define _IP_CONNTRACK_H
|
||||
/* Connection state tracking for netfilter. This is separated from,
|
||||
but required by, the NAT layer; it can also be used by an iptables
|
||||
extension. */
|
||||
enum ip_conntrack_info
|
||||
{
|
||||
/* Part of an established connection (either direction). */
|
||||
IP_CT_ESTABLISHED,
|
||||
|
||||
/* Like NEW, but related to an existing connection, or ICMP error
|
||||
(in either direction). */
|
||||
IP_CT_RELATED,
|
||||
|
||||
/* Started a new connection to track (only
|
||||
IP_CT_DIR_ORIGINAL); may be a retransmission. */
|
||||
IP_CT_NEW,
|
||||
|
||||
/* >= this indicates reply direction */
|
||||
IP_CT_IS_REPLY,
|
||||
|
||||
/* Number of distinct IP_CT types (no NEW in reply dirn). */
|
||||
IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
|
||||
};
|
||||
|
||||
/* Bitset representing status of connection. */
|
||||
enum ip_conntrack_status {
|
||||
/* It's an expected connection: bit 0 set. This bit never changed */
|
||||
IPS_EXPECTED_BIT = 0,
|
||||
IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
|
||||
|
||||
/* We've seen packets both ways: bit 1 set. Can be set, not unset. */
|
||||
IPS_SEEN_REPLY_BIT = 1,
|
||||
IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
|
||||
|
||||
/* Conntrack should never be early-expired. */
|
||||
IPS_ASSURED_BIT = 2,
|
||||
IPS_ASSURED = (1 << IPS_ASSURED_BIT),
|
||||
|
||||
/* Connection is confirmed: originating packet has left box */
|
||||
IPS_CONFIRMED_BIT = 3,
|
||||
IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
|
||||
|
||||
/* Connection needs src nat in orig dir. This bit never changed. */
|
||||
IPS_SRC_NAT_BIT = 4,
|
||||
IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
|
||||
|
||||
/* Connection needs dst nat in orig dir. This bit never changed. */
|
||||
IPS_DST_NAT_BIT = 5,
|
||||
IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
|
||||
|
||||
/* Both together. */
|
||||
IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
|
||||
|
||||
/* Connection needs TCP sequence adjusted. */
|
||||
IPS_SEQ_ADJUST_BIT = 6,
|
||||
IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
|
||||
|
||||
/* NAT initialization bits. */
|
||||
IPS_SRC_NAT_DONE_BIT = 7,
|
||||
IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
|
||||
|
||||
IPS_DST_NAT_DONE_BIT = 8,
|
||||
IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
|
||||
|
||||
/* Both together */
|
||||
IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
|
||||
|
||||
/* Connection is dying (removed from lists), can not be unset. */
|
||||
IPS_DYING_BIT = 9,
|
||||
IPS_DYING = (1 << IPS_DYING_BIT),
|
||||
};
|
||||
|
||||
/* Connection tracking event bits */
|
||||
enum ip_conntrack_events
|
||||
{
|
||||
/* New conntrack */
|
||||
IPCT_NEW_BIT = 0,
|
||||
IPCT_NEW = (1 << IPCT_NEW_BIT),
|
||||
|
||||
/* Expected connection */
|
||||
IPCT_RELATED_BIT = 1,
|
||||
IPCT_RELATED = (1 << IPCT_RELATED_BIT),
|
||||
|
||||
/* Destroyed conntrack */
|
||||
IPCT_DESTROY_BIT = 2,
|
||||
IPCT_DESTROY = (1 << IPCT_DESTROY_BIT),
|
||||
|
||||
/* Timer has been refreshed */
|
||||
IPCT_REFRESH_BIT = 3,
|
||||
IPCT_REFRESH = (1 << IPCT_REFRESH_BIT),
|
||||
|
||||
/* Status has changed */
|
||||
IPCT_STATUS_BIT = 4,
|
||||
IPCT_STATUS = (1 << IPCT_STATUS_BIT),
|
||||
|
||||
/* Update of protocol info */
|
||||
IPCT_PROTOINFO_BIT = 5,
|
||||
IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT),
|
||||
|
||||
/* Volatile protocol info */
|
||||
IPCT_PROTOINFO_VOLATILE_BIT = 6,
|
||||
IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT),
|
||||
|
||||
/* New helper for conntrack */
|
||||
IPCT_HELPER_BIT = 7,
|
||||
IPCT_HELPER = (1 << IPCT_HELPER_BIT),
|
||||
|
||||
/* Update of helper info */
|
||||
IPCT_HELPINFO_BIT = 8,
|
||||
IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT),
|
||||
|
||||
/* Volatile helper info */
|
||||
IPCT_HELPINFO_VOLATILE_BIT = 9,
|
||||
IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT),
|
||||
|
||||
/* NAT info */
|
||||
IPCT_NATINFO_BIT = 10,
|
||||
IPCT_NATINFO = (1 << IPCT_NATINFO_BIT),
|
||||
|
||||
/* Counter highest bit has been set */
|
||||
IPCT_COUNTER_FILLING_BIT = 11,
|
||||
IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT),
|
||||
};
|
||||
|
||||
enum ip_conntrack_expect_events {
|
||||
IPEXP_NEW_BIT = 0,
|
||||
IPEXP_NEW = (1 << IPEXP_NEW_BIT),
|
||||
};
|
||||
#include <linux/netfilter/nf_conntrack_common.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/config.h>
|
||||
|
@ -194,12 +69,6 @@ do { \
|
|||
#define IP_NF_ASSERT(x)
|
||||
#endif
|
||||
|
||||
struct ip_conntrack_counter
|
||||
{
|
||||
u_int32_t packets;
|
||||
u_int32_t bytes;
|
||||
};
|
||||
|
||||
struct ip_conntrack_helper;
|
||||
|
||||
struct ip_conntrack
|
||||
|
@ -426,25 +295,6 @@ static inline int is_dying(struct ip_conntrack *ct)
|
|||
|
||||
extern unsigned int ip_conntrack_htable_size;
|
||||
|
||||
struct ip_conntrack_stat
|
||||
{
|
||||
unsigned int searched;
|
||||
unsigned int found;
|
||||
unsigned int new;
|
||||
unsigned int invalid;
|
||||
unsigned int ignore;
|
||||
unsigned int delete;
|
||||
unsigned int delete_list;
|
||||
unsigned int insert;
|
||||
unsigned int insert_failed;
|
||||
unsigned int drop;
|
||||
unsigned int early_drop;
|
||||
unsigned int error;
|
||||
unsigned int expect_new;
|
||||
unsigned int expect_create;
|
||||
unsigned int expect_delete;
|
||||
};
|
||||
|
||||
#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
|
||||
|
||||
#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
|
||||
|
|
|
@ -1,43 +1,6 @@
|
|||
#ifndef _IP_CONNTRACK_FTP_H
|
||||
#define _IP_CONNTRACK_FTP_H
|
||||
/* FTP tracking. */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/netfilter/nf_conntrack_ftp.h>
|
||||
|
||||
#define FTP_PORT 21
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
enum ip_ct_ftp_type
|
||||
{
|
||||
/* PORT command from client */
|
||||
IP_CT_FTP_PORT,
|
||||
/* PASV response from server */
|
||||
IP_CT_FTP_PASV,
|
||||
/* EPRT command from client */
|
||||
IP_CT_FTP_EPRT,
|
||||
/* EPSV response from server */
|
||||
IP_CT_FTP_EPSV,
|
||||
};
|
||||
|
||||
#define NUM_SEQ_TO_REMEMBER 2
|
||||
/* This structure exists only once per master */
|
||||
struct ip_ct_ftp_master {
|
||||
/* Valid seq positions for cmd matching after newline */
|
||||
u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
|
||||
/* 0 means seq_match_aft_nl not set */
|
||||
int seq_aft_nl_num[IP_CT_DIR_MAX];
|
||||
};
|
||||
|
||||
struct ip_conntrack_expect;
|
||||
|
||||
/* For NAT to hook in when we find a packet which describes what other
|
||||
* connection we should expect. */
|
||||
extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
enum ip_ct_ftp_type type,
|
||||
unsigned int matchoff,
|
||||
unsigned int matchlen,
|
||||
struct ip_conntrack_expect *exp,
|
||||
u32 *seq);
|
||||
#endif /* _IP_CONNTRACK_FTP_H */
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
#ifndef _IP_CONNTRACK_ICMP_H
|
||||
#define _IP_CONNTRACK_ICMP_H
|
||||
/* ICMP tracking. */
|
||||
#include <asm/atomic.h>
|
||||
|
||||
struct ip_ct_icmp
|
||||
{
|
||||
/* Optimization: when number in == number out, forget immediately. */
|
||||
atomic_t count;
|
||||
};
|
||||
#include <net/netfilter/ipv4/nf_conntrack_icmp.h>
|
||||
|
||||
#endif /* _IP_CONNTRACK_ICMP_H */
|
||||
|
|
|
@ -1,25 +1,6 @@
|
|||
#ifndef _IP_CONNTRACK_SCTP_H
|
||||
#define _IP_CONNTRACK_SCTP_H
|
||||
/* SCTP tracking. */
|
||||
|
||||
enum sctp_conntrack {
|
||||
SCTP_CONNTRACK_NONE,
|
||||
SCTP_CONNTRACK_CLOSED,
|
||||
SCTP_CONNTRACK_COOKIE_WAIT,
|
||||
SCTP_CONNTRACK_COOKIE_ECHOED,
|
||||
SCTP_CONNTRACK_ESTABLISHED,
|
||||
SCTP_CONNTRACK_SHUTDOWN_SENT,
|
||||
SCTP_CONNTRACK_SHUTDOWN_RECD,
|
||||
SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
|
||||
SCTP_CONNTRACK_MAX
|
||||
};
|
||||
|
||||
struct ip_ct_sctp
|
||||
{
|
||||
enum sctp_conntrack state;
|
||||
|
||||
u_int32_t vtag[IP_CT_DIR_MAX];
|
||||
u_int32_t ttag[IP_CT_DIR_MAX];
|
||||
};
|
||||
#include <linux/netfilter/nf_conntrack_sctp.h>
|
||||
|
||||
#endif /* _IP_CONNTRACK_SCTP_H */
|
||||
|
|
|
@ -1,51 +1,6 @@
|
|||
#ifndef _IP_CONNTRACK_TCP_H
|
||||
#define _IP_CONNTRACK_TCP_H
|
||||
/* TCP tracking. */
|
||||
|
||||
enum tcp_conntrack {
|
||||
TCP_CONNTRACK_NONE,
|
||||
TCP_CONNTRACK_SYN_SENT,
|
||||
TCP_CONNTRACK_SYN_RECV,
|
||||
TCP_CONNTRACK_ESTABLISHED,
|
||||
TCP_CONNTRACK_FIN_WAIT,
|
||||
TCP_CONNTRACK_CLOSE_WAIT,
|
||||
TCP_CONNTRACK_LAST_ACK,
|
||||
TCP_CONNTRACK_TIME_WAIT,
|
||||
TCP_CONNTRACK_CLOSE,
|
||||
TCP_CONNTRACK_LISTEN,
|
||||
TCP_CONNTRACK_MAX,
|
||||
TCP_CONNTRACK_IGNORE
|
||||
};
|
||||
|
||||
/* Window scaling is advertised by the sender */
|
||||
#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
|
||||
|
||||
/* SACK is permitted by the sender */
|
||||
#define IP_CT_TCP_FLAG_SACK_PERM 0x02
|
||||
|
||||
/* This sender sent FIN first */
|
||||
#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03
|
||||
|
||||
struct ip_ct_tcp_state {
|
||||
u_int32_t td_end; /* max of seq + len */
|
||||
u_int32_t td_maxend; /* max of ack + max(win, 1) */
|
||||
u_int32_t td_maxwin; /* max(win) */
|
||||
u_int8_t td_scale; /* window scale factor */
|
||||
u_int8_t loose; /* used when connection picked up from the middle */
|
||||
u_int8_t flags; /* per direction options */
|
||||
};
|
||||
|
||||
struct ip_ct_tcp
|
||||
{
|
||||
struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
|
||||
u_int8_t state; /* state of the connection (enum tcp_conntrack) */
|
||||
/* For detecting stale connections */
|
||||
u_int8_t last_dir; /* Direction of the last packet (enum ip_conntrack_dir) */
|
||||
u_int8_t retrans; /* Number of retransmitted packets */
|
||||
u_int8_t last_index; /* Index of the last packet */
|
||||
u_int32_t last_seq; /* Last sequence number seen in dir */
|
||||
u_int32_t last_ack; /* Last sequence number seen in opposite dir */
|
||||
u_int32_t last_end; /* Last seq + len */
|
||||
};
|
||||
#include <linux/netfilter/nf_conntrack_tcp.h>
|
||||
|
||||
#endif /* _IP_CONNTRACK_TCP_H */
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define _IP_CONNTRACK_TUPLE_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/netfilter/nf_conntrack_tuple_common.h>
|
||||
|
||||
/* A `tuple' is a structure containing the information to uniquely
|
||||
identify a connection. ie. if two packets have the same tuple, they
|
||||
|
@ -88,13 +89,6 @@ struct ip_conntrack_tuple
|
|||
(tuple)->dst.u.all = 0; \
|
||||
} while (0)
|
||||
|
||||
enum ip_conntrack_dir
|
||||
{
|
||||
IP_CT_DIR_ORIGINAL,
|
||||
IP_CT_DIR_REPLY,
|
||||
IP_CT_DIR_MAX
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define DUMP_TUPLE(tp) \
|
||||
|
@ -103,8 +97,6 @@ DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n", \
|
|||
NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all), \
|
||||
NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all))
|
||||
|
||||
#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
|
||||
|
||||
/* If we're the first tuple, it's the original dir. */
|
||||
#define DIRECTION(h) ((enum ip_conntrack_dir)(h)->tuple.dst.dir)
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
|
||||
enum nf_ip6_hook_priorities {
|
||||
NF_IP6_PRI_FIRST = INT_MIN,
|
||||
NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
|
||||
NF_IP6_PRI_SELINUX_FIRST = -225,
|
||||
NF_IP6_PRI_CONNTRACK = -200,
|
||||
NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
|
||||
|
|
|
@ -71,7 +71,8 @@ struct nlmsghdr
|
|||
|
||||
#define NLMSG_ALIGNTO 4
|
||||
#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
|
||||
#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr)))
|
||||
#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
|
||||
#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
|
||||
#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
|
||||
#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
|
||||
#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
|
||||
|
@ -86,6 +87,8 @@ struct nlmsghdr
|
|||
#define NLMSG_DONE 0x3 /* End of a dump */
|
||||
#define NLMSG_OVERRUN 0x4 /* Data lost */
|
||||
|
||||
#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
|
||||
|
||||
struct nlmsgerr
|
||||
{
|
||||
int error;
|
||||
|
@ -108,6 +111,25 @@ enum {
|
|||
NETLINK_CONNECTED,
|
||||
};
|
||||
|
||||
/*
|
||||
* <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
|
||||
* +---------------------+- - -+- - - - - - - - - -+- - -+
|
||||
* | Header | Pad | Payload | Pad |
|
||||
* | (struct nlattr) | ing | | ing |
|
||||
* +---------------------+- - -+- - - - - - - - - -+- - -+
|
||||
* <-------------- nlattr->nla_len -------------->
|
||||
*/
|
||||
|
||||
struct nlattr
|
||||
{
|
||||
__u16 nla_len;
|
||||
__u16 nla_type;
|
||||
};
|
||||
|
||||
#define NLA_ALIGNTO 4
|
||||
#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
|
||||
#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/capability.h>
|
||||
|
|
|
@ -60,7 +60,7 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
|
|||
extern struct svc_program nfsd_program;
|
||||
extern struct svc_version nfsd_version2, nfsd_version3,
|
||||
nfsd_version4;
|
||||
|
||||
extern struct svc_serv *nfsd_serv;
|
||||
/*
|
||||
* Function prototypes.
|
||||
*/
|
||||
|
|
|
@ -39,6 +39,21 @@
|
|||
#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
|
||||
#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
|
||||
|
||||
/*
|
||||
* Macros used to set version
|
||||
*/
|
||||
#define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v)))
|
||||
#define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
|
||||
#define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
|
||||
|
||||
#if defined(CONFIG_NFSD_V4)
|
||||
#define NFSCTL_VERALL (0x1c /* 0b011100 */)
|
||||
#elif defined(CONFIG_NFSD_V3)
|
||||
#define NFSCTL_VERALL (0x0c /* 0b001100 */)
|
||||
#else
|
||||
#define NFSCTL_VERALL (0x04 /* 0b000100 */)
|
||||
#endif
|
||||
|
||||
/* SVC */
|
||||
struct nfsctl_svc {
|
||||
unsigned short svc_port;
|
||||
|
@ -120,6 +135,8 @@ extern int exp_delclient(struct nfsctl_client *ncp);
|
|||
extern int exp_export(struct nfsctl_export *nxp);
|
||||
extern int exp_unexport(struct nfsctl_export *nxp);
|
||||
|
||||
extern unsigned int nfsd_versbits;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* NFSD_SYSCALL_H */
|
||||
|
|
|
@ -42,7 +42,7 @@ struct nfsd3_writeargs {
|
|||
__u64 offset;
|
||||
__u32 count;
|
||||
int stable;
|
||||
int len;
|
||||
__u32 len;
|
||||
struct kvec vec[RPCSVC_MAXPAGES];
|
||||
int vlen;
|
||||
};
|
||||
|
|
|
@ -47,14 +47,15 @@
|
|||
OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL)
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
extern acpi_status pci_osc_control_set(u32 flags);
|
||||
extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
|
||||
extern acpi_status pci_osc_support_set(u32 flags);
|
||||
#else
|
||||
#if !defined(acpi_status)
|
||||
typedef u32 acpi_status;
|
||||
#define AE_ERROR (acpi_status) (0x0001)
|
||||
#endif
|
||||
static inline acpi_status pci_osc_control_set(u32 flags) {return AE_ERROR;}
|
||||
static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
|
||||
{return AE_ERROR;}
|
||||
static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -236,7 +236,6 @@ struct module;
|
|||
struct pci_driver {
|
||||
struct list_head node;
|
||||
char *name;
|
||||
struct module *owner;
|
||||
const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
|
||||
int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
|
||||
void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
|
||||
|
@ -338,6 +337,7 @@ struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, const
|
|||
struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from);
|
||||
struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
|
||||
int pci_find_capability (struct pci_dev *dev, int cap);
|
||||
int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
|
||||
int pci_find_ext_capability (struct pci_dev *dev, int cap);
|
||||
struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
|
||||
|
||||
|
@ -432,8 +432,13 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
|
|||
void *alignf_data);
|
||||
void pci_enable_bridges(struct pci_bus *bus);
|
||||
|
||||
/* New-style probing supporting hot-pluggable devices */
|
||||
int pci_register_driver(struct pci_driver *);
|
||||
/* Proper probing supporting hot-pluggable devices */
|
||||
int __pci_register_driver(struct pci_driver *, struct module *);
|
||||
static inline int pci_register_driver(struct pci_driver *driver)
|
||||
{
|
||||
return __pci_register_driver(driver, THIS_MODULE);
|
||||
}
|
||||
|
||||
void pci_unregister_driver(struct pci_driver *);
|
||||
void pci_remove_behind_bridge(struct pci_dev *);
|
||||
struct pci_driver *pci_dev_driver(const struct pci_dev *);
|
||||
|
@ -547,9 +552,11 @@ static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
|
|||
static inline void pci_disable_device(struct pci_dev *dev) { }
|
||||
static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; }
|
||||
static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;}
|
||||
static inline int __pci_register_driver(struct pci_driver *drv, struct module *owner) { return 0;}
|
||||
static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
|
||||
static inline void pci_unregister_driver(struct pci_driver *drv) { }
|
||||
static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
|
||||
static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
|
||||
static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
|
||||
static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
|
||||
|
||||
|
|
|
@ -387,6 +387,7 @@
|
|||
#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511
|
||||
#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515
|
||||
#define PCI_DEVICE_ID_NS_87410 0xd001
|
||||
#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
|
||||
|
||||
#define PCI_VENDOR_ID_TSENG 0x100c
|
||||
#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
|
||||
|
@ -487,6 +488,8 @@
|
|||
#define PCI_DEVICE_ID_AMD_8151_0 0x7454
|
||||
#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450
|
||||
|
||||
#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
|
||||
|
||||
#define PCI_VENDOR_ID_TRIDENT 0x1023
|
||||
#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
|
||||
#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001
|
||||
|
@ -519,6 +522,7 @@
|
|||
#define PCI_DEVICE_ID_MATROX_MIL 0x0519
|
||||
#define PCI_DEVICE_ID_MATROX_MYS 0x051A
|
||||
#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b
|
||||
#define PCI_DEVICE_ID_MATROX_MYS_AGP 0x051e
|
||||
#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f
|
||||
#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10
|
||||
#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000
|
||||
|
@ -1785,6 +1789,7 @@
|
|||
#define PCI_DEVICE_ID_TIGON3_5704 0x1648
|
||||
#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649
|
||||
#define PCI_DEVICE_ID_NX2_5706 0x164a
|
||||
#define PCI_DEVICE_ID_NX2_5708 0x164c
|
||||
#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
|
||||
#define PCI_DEVICE_ID_TIGON3_5705 0x1653
|
||||
#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
|
||||
|
@ -1809,6 +1814,7 @@
|
|||
#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
|
||||
#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
|
||||
#define PCI_DEVICE_ID_NX2_5706S 0x16aa
|
||||
#define PCI_DEVICE_ID_NX2_5708S 0x16ac
|
||||
#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
|
||||
#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
|
||||
#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define __LINUX_PHONEDEV_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ struct tc_fifo_qopt
|
|||
/* PRIO section */
|
||||
|
||||
#define TCQ_PRIO_BANDS 16
|
||||
#define TCQ_MIN_PRIO_BANDS 2
|
||||
|
||||
struct tc_prio_qopt
|
||||
{
|
||||
|
@ -169,6 +170,7 @@ struct tc_red_qopt
|
|||
unsigned char Scell_log; /* cell size for idle damping */
|
||||
unsigned char flags;
|
||||
#define TC_RED_ECN 1
|
||||
#define TC_RED_HARDDROP 2
|
||||
};
|
||||
|
||||
struct tc_red_xstats
|
||||
|
@ -194,38 +196,34 @@ enum
|
|||
|
||||
#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
|
||||
|
||||
#define TCA_SET_OFF TCA_GRED_PARMS
|
||||
struct tc_gred_qopt
|
||||
{
|
||||
__u32 limit; /* HARD maximal queue length (bytes)
|
||||
*/
|
||||
__u32 qth_min; /* Min average length threshold (bytes)
|
||||
*/
|
||||
__u32 qth_max; /* Max average length threshold (bytes)
|
||||
*/
|
||||
__u32 DP; /* upto 2^32 DPs */
|
||||
__u32 backlog;
|
||||
__u32 qave;
|
||||
__u32 forced;
|
||||
__u32 early;
|
||||
__u32 other;
|
||||
__u32 pdrop;
|
||||
|
||||
unsigned char Wlog; /* log(W) */
|
||||
unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
|
||||
unsigned char Scell_log; /* cell size for idle damping */
|
||||
__u8 prio; /* prio of this VQ */
|
||||
__u32 packets;
|
||||
__u32 bytesin;
|
||||
__u32 limit; /* HARD maximal queue length (bytes) */
|
||||
__u32 qth_min; /* Min average length threshold (bytes) */
|
||||
__u32 qth_max; /* Max average length threshold (bytes) */
|
||||
__u32 DP; /* upto 2^32 DPs */
|
||||
__u32 backlog;
|
||||
__u32 qave;
|
||||
__u32 forced;
|
||||
__u32 early;
|
||||
__u32 other;
|
||||
__u32 pdrop;
|
||||
__u8 Wlog; /* log(W) */
|
||||
__u8 Plog; /* log(P_max/(qth_max-qth_min)) */
|
||||
__u8 Scell_log; /* cell size for idle damping */
|
||||
__u8 prio; /* prio of this VQ */
|
||||
__u32 packets;
|
||||
__u32 bytesin;
|
||||
};
|
||||
|
||||
/* gred setup */
|
||||
struct tc_gred_sopt
|
||||
{
|
||||
__u32 DPs;
|
||||
__u32 def_DP;
|
||||
__u8 grio;
|
||||
__u8 pad1;
|
||||
__u16 pad2;
|
||||
__u32 DPs;
|
||||
__u32 def_DP;
|
||||
__u8 grio;
|
||||
__u8 flags;
|
||||
__u16 pad1;
|
||||
};
|
||||
|
||||
/* HTB section */
|
||||
|
|
|
@ -37,4 +37,10 @@ extern int platform_add_devices(struct platform_device **, int);
|
|||
|
||||
extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int);
|
||||
|
||||
extern struct platform_device *platform_device_alloc(const char *name, unsigned int id);
|
||||
extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
|
||||
extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size);
|
||||
extern int platform_device_add(struct platform_device *pdev);
|
||||
extern void platform_device_put(struct platform_device *pdev);
|
||||
|
||||
#endif /* _PLATFORM_DEVICE_H_ */
|
||||
|
|
|
@ -353,7 +353,6 @@ struct pnp_protocol {
|
|||
int pnp_register_protocol(struct pnp_protocol *protocol);
|
||||
void pnp_unregister_protocol(struct pnp_protocol *protocol);
|
||||
int pnp_add_device(struct pnp_dev *dev);
|
||||
void pnp_remove_device(struct pnp_dev *dev);
|
||||
int pnp_device_attach(struct pnp_dev *pnp_dev);
|
||||
void pnp_device_detach(struct pnp_dev *pnp_dev);
|
||||
extern struct list_head pnp_global;
|
||||
|
@ -399,7 +398,6 @@ static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return
|
|||
static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
|
||||
static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
|
||||
static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
|
||||
static inline void pnp_remove_device(struct pnp_dev *dev) { }
|
||||
static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
|
||||
static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; }
|
||||
|
||||
|
|
|
@ -111,6 +111,8 @@ struct compressor {
|
|||
|
||||
/* Used in locking compressor modules */
|
||||
struct module *owner;
|
||||
/* Extra skb space needed by the compressor algorithm */
|
||||
unsigned int comp_extra;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -190,6 +192,13 @@ struct compressor {
|
|||
#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)
|
||||
#define DEFLATE_CHK_SEQUENCE 0
|
||||
|
||||
/*
|
||||
* Definitions for MPPE.
|
||||
*/
|
||||
|
||||
#define CI_MPPE 18 /* config option for MPPE */
|
||||
#define CILEN_MPPE 6 /* length of config option */
|
||||
|
||||
/*
|
||||
* Definitions for other, as yet unsupported, compression methods.
|
||||
*/
|
||||
|
|
|
@ -66,6 +66,7 @@ struct proc_dir_entry {
|
|||
write_proc_t *write_proc;
|
||||
atomic_t count; /* use count */
|
||||
int deleted; /* delete flag */
|
||||
void *set;
|
||||
};
|
||||
|
||||
struct kcore_list {
|
||||
|
@ -139,15 +140,12 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver);
|
|||
/*
|
||||
* proc_devtree.c
|
||||
*/
|
||||
struct device_node;
|
||||
extern void proc_device_tree_init(void);
|
||||
#ifdef CONFIG_PROC_DEVICETREE
|
||||
struct device_node;
|
||||
struct property;
|
||||
extern void proc_device_tree_init(void);
|
||||
extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
|
||||
#else /* !CONFIG_PROC_DEVICETREE */
|
||||
static inline void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde)
|
||||
{
|
||||
return;
|
||||
}
|
||||
extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
|
||||
#endif /* CONFIG_PROC_DEVICETREE */
|
||||
|
||||
extern struct proc_dir_entry *proc_symlink(const char *,
|
||||
|
|
|
@ -78,6 +78,8 @@
|
|||
#include <linux/compiler.h> /* For unlikely. */
|
||||
#include <linux/sched.h> /* For struct task_struct. */
|
||||
|
||||
|
||||
extern long arch_ptrace(struct task_struct *child, long request, long addr, long data);
|
||||
extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
|
||||
extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
|
||||
extern int ptrace_attach(struct task_struct *tsk);
|
||||
|
|
|
@ -289,7 +289,6 @@ struct quota_info {
|
|||
struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */
|
||||
struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */
|
||||
struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */
|
||||
struct vfsmount *mnt[MAXQUOTAS]; /* mountpoint entries of filesystems with quota files */
|
||||
struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
|
||||
struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
|
||||
};
|
||||
|
|
|
@ -198,38 +198,38 @@ static __inline__ int DQUOT_OFF(struct super_block *sb)
|
|||
#define DQUOT_SYNC(sb) do { } while(0)
|
||||
#define DQUOT_OFF(sb) do { } while(0)
|
||||
#define DQUOT_TRANSFER(inode, iattr) (0)
|
||||
extern __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
|
||||
static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
|
||||
{
|
||||
inode_add_bytes(inode, nr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
|
||||
static inline int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
|
||||
{
|
||||
DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr);
|
||||
mark_inode_dirty(inode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
|
||||
static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
|
||||
{
|
||||
inode_add_bytes(inode, nr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
|
||||
static inline int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
|
||||
{
|
||||
DQUOT_ALLOC_SPACE_NODIRTY(inode, nr);
|
||||
mark_inode_dirty(inode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
|
||||
static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
|
||||
{
|
||||
inode_sub_bytes(inode, nr);
|
||||
}
|
||||
|
||||
extern __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
|
||||
static inline void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
|
||||
{
|
||||
DQUOT_FREE_SPACE_NODIRTY(inode, nr);
|
||||
mark_inode_dirty(inode);
|
||||
|
|
|
@ -46,6 +46,7 @@ do { \
|
|||
|
||||
int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
|
||||
void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
|
||||
void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
|
||||
void *radix_tree_delete(struct radix_tree_root *, unsigned long);
|
||||
unsigned int
|
||||
radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
|
||||
|
|
|
@ -6,7 +6,13 @@
|
|||
#ifndef BITMAP_H
|
||||
#define BITMAP_H 1
|
||||
|
||||
#define BITMAP_MAJOR 3
|
||||
#define BITMAP_MAJOR_LO 3
|
||||
/* version 4 insists the bitmap is in little-endian order
|
||||
* with version 3, it is host-endian which is non-portable
|
||||
*/
|
||||
#define BITMAP_MAJOR_HI 4
|
||||
#define BITMAP_MAJOR_HOSTENDIAN 3
|
||||
|
||||
#define BITMAP_MINOR 39
|
||||
|
||||
/*
|
||||
|
@ -133,7 +139,8 @@ typedef __u16 bitmap_counter_t;
|
|||
/* use these for bitmap->flags and bitmap->sb->state bit-fields */
|
||||
enum bitmap_state {
|
||||
BITMAP_ACTIVE = 0x001, /* the bitmap is in use */
|
||||
BITMAP_STALE = 0x002 /* the bitmap file is out of date or had -EIO */
|
||||
BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */
|
||||
BITMAP_HOSTENDIAN = 0x8000,
|
||||
};
|
||||
|
||||
/* the superblock at the front of the bitmap file -- little endian */
|
||||
|
|
|
@ -66,8 +66,10 @@
|
|||
* and major_version/minor_version accordingly
|
||||
* >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
|
||||
* in the super status byte
|
||||
* >=3 means that bitmap superblock version 4 is supported, which uses
|
||||
* little-ending representation rather than host-endian
|
||||
*/
|
||||
#define MD_PATCHLEVEL_VERSION 2
|
||||
#define MD_PATCHLEVEL_VERSION 3
|
||||
|
||||
extern int register_md_personality (int p_num, mdk_personality_t *p);
|
||||
extern int unregister_md_personality (int p_num);
|
||||
|
@ -87,6 +89,7 @@ extern void md_print_devices (void);
|
|||
|
||||
extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
|
||||
sector_t sector, int size, struct page *page);
|
||||
extern void md_super_wait(mddev_t *mddev);
|
||||
extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
|
||||
struct page *page, int rw);
|
||||
|
||||
|
|
|
@ -105,6 +105,8 @@ struct mdk_rdev_s
|
|||
int sb_size; /* bytes in the superblock */
|
||||
int preferred_minor; /* autorun support */
|
||||
|
||||
struct kobject kobj;
|
||||
|
||||
/* A device can be in one of three states based on two flags:
|
||||
* Not working: faulty==1 in_sync==0
|
||||
* Fully working: faulty==0 in_sync==1
|
||||
|
@ -115,11 +117,12 @@ struct mdk_rdev_s
|
|||
* It can never have faulty==1, in_sync==1
|
||||
* This reduces the burden of testing multiple flags in many cases
|
||||
*/
|
||||
int faulty; /* if faulty do not issue IO requests */
|
||||
int in_sync; /* device is a full member of the array */
|
||||
|
||||
unsigned long flags; /* Should include faulty and in_sync here. */
|
||||
unsigned long flags;
|
||||
#define Faulty 1 /* device is known to have a fault */
|
||||
#define In_sync 2 /* device is in_sync with rest of array */
|
||||
#define WriteMostly 4 /* Avoid reading if at all possible */
|
||||
#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */
|
||||
|
||||
int desc_nr; /* descriptor index in the superblock */
|
||||
int raid_disk; /* role of device in array */
|
||||
|
@ -132,6 +135,9 @@ struct mdk_rdev_s
|
|||
* only maintained for arrays that
|
||||
* support hot removal
|
||||
*/
|
||||
atomic_t read_errors; /* number of consecutive read errors that
|
||||
* we have tried to ignore.
|
||||
*/
|
||||
};
|
||||
|
||||
typedef struct mdk_personality_s mdk_personality_t;
|
||||
|
@ -148,6 +154,8 @@ struct mddev_s
|
|||
|
||||
struct gendisk *gendisk;
|
||||
|
||||
struct kobject kobj;
|
||||
|
||||
/* Superblock information */
|
||||
int major_version,
|
||||
minor_version,
|
||||
|
@ -171,6 +179,10 @@ struct mddev_s
|
|||
sector_t resync_mark_cnt;/* blocks written at resync_mark */
|
||||
|
||||
sector_t resync_max_sectors; /* may be set by personality */
|
||||
|
||||
sector_t resync_mismatches; /* count of sectors where
|
||||
* parity/replica mismatch found
|
||||
*/
|
||||
/* recovery/resync flags
|
||||
* NEEDED: we might need to start a resync/recover
|
||||
* RUNNING: a thread is running, or about to be started
|
||||
|
@ -178,6 +190,8 @@ struct mddev_s
|
|||
* ERR: and IO error was detected - abort the resync/recovery
|
||||
* INTR: someone requested a (clean) early abort.
|
||||
* DONE: thread is done and is waiting to be reaped
|
||||
* REQUEST: user-space has requested a sync (used with SYNC)
|
||||
* CHECK: user-space request for for check-only, no repair
|
||||
*/
|
||||
#define MD_RECOVERY_RUNNING 0
|
||||
#define MD_RECOVERY_SYNC 1
|
||||
|
@ -185,6 +199,8 @@ struct mddev_s
|
|||
#define MD_RECOVERY_INTR 3
|
||||
#define MD_RECOVERY_DONE 4
|
||||
#define MD_RECOVERY_NEEDED 5
|
||||
#define MD_RECOVERY_REQUESTED 6
|
||||
#define MD_RECOVERY_CHECK 7
|
||||
unsigned long recovery;
|
||||
|
||||
int in_sync; /* know to not need resync */
|
||||
|
@ -195,6 +211,13 @@ struct mddev_s
|
|||
int degraded; /* whether md should consider
|
||||
* adding a spare
|
||||
*/
|
||||
int barriers_work; /* initialised to true, cleared as soon
|
||||
* as a barrier request to slave
|
||||
* fails. Only supported
|
||||
*/
|
||||
struct bio *biolist; /* bios that need to be retried
|
||||
* because BIO_RW_BARRIER is not supported
|
||||
*/
|
||||
|
||||
atomic_t recovery_active; /* blocks scheduled, but not written */
|
||||
wait_queue_head_t recovery_wait;
|
||||
|
@ -232,7 +255,7 @@ struct mddev_s
|
|||
|
||||
static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev)
|
||||
{
|
||||
int faulty = rdev->faulty;
|
||||
int faulty = test_bit(Faulty, &rdev->flags);
|
||||
if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
|
||||
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
}
|
||||
|
@ -270,6 +293,13 @@ struct mdk_personality_s
|
|||
};
|
||||
|
||||
|
||||
struct md_sysfs_entry {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(mddev_t *, char *);
|
||||
ssize_t (*store)(mddev_t *, const char *, size_t);
|
||||
};
|
||||
|
||||
|
||||
static inline char * mdname (mddev_t * mddev)
|
||||
{
|
||||
return mddev->gendisk ? mddev->gendisk->disk_name : "mdX";
|
||||
|
@ -304,10 +334,8 @@ typedef struct mdk_thread_s {
|
|||
mddev_t *mddev;
|
||||
wait_queue_head_t wqueue;
|
||||
unsigned long flags;
|
||||
struct completion *event;
|
||||
struct task_struct *tsk;
|
||||
unsigned long timeout;
|
||||
const char *name;
|
||||
} mdk_thread_t;
|
||||
|
||||
#define THREAD_WAKEUP 0
|
||||
|
|
|
@ -110,7 +110,9 @@ struct r1bio_s {
|
|||
#define R1BIO_Uptodate 0
|
||||
#define R1BIO_IsSync 1
|
||||
#define R1BIO_Degraded 2
|
||||
#define R1BIO_BehindIO 3
|
||||
#define R1BIO_BehindIO 3
|
||||
#define R1BIO_Barrier 4
|
||||
#define R1BIO_BarrierRetry 5
|
||||
/* For write-behind requests, we call bi_end_io when
|
||||
* the last non-write-behind device completes, providing
|
||||
* any write was successful. Otherwise we call when
|
||||
|
|
|
@ -154,6 +154,8 @@ struct stripe_head {
|
|||
#define R5_Wantwrite 5
|
||||
#define R5_Syncio 6 /* this io need to be accounted as resync io */
|
||||
#define R5_Overlap 7 /* There is a pending overlapping request on this block */
|
||||
#define R5_ReadError 8 /* seen a read error here recently */
|
||||
#define R5_ReWrite 9 /* have tried to over-write the readerror */
|
||||
|
||||
/*
|
||||
* Write method
|
||||
|
|
325
include/linux/rio.h
Normal file
325
include/linux/rio.h
Normal file
|
@ -0,0 +1,325 @@
|
|||
/*
|
||||
* RapidIO interconnect services
|
||||
* (RapidIO Interconnect Specification, http://www.rapidio.org)
|
||||
*
|
||||
* Copyright 2005 MontaVista Software, Inc.
|
||||
* Matt Porter <mporter@kernel.crashing.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef LINUX_RIO_H
|
||||
#define LINUX_RIO_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/config.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/rio_regs.h>
|
||||
|
||||
#define RIO_ANY_DESTID 0xff
|
||||
#define RIO_NO_HOPCOUNT -1
|
||||
|
||||
#define RIO_MAX_MPORT_RESOURCES 16
|
||||
#define RIO_MAX_DEV_RESOURCES 16
|
||||
|
||||
#define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's
|
||||
global routing table if it
|
||||
has multiple (or per port)
|
||||
tables */
|
||||
|
||||
#define RIO_INVALID_ROUTE 0xff /* Indicates that a route table
|
||||
entry is invalid (no route
|
||||
exists for the device ID) */
|
||||
|
||||
#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT
|
||||
#define RIO_MAX_ROUTE_ENTRIES (1 << 8)
|
||||
#else
|
||||
#define RIO_MAX_ROUTE_ENTRIES (1 << 16)
|
||||
#endif
|
||||
|
||||
#define RIO_MAX_MBOX 4
|
||||
#define RIO_MAX_MSG_SIZE 0x1000
|
||||
|
||||
/*
|
||||
* Error values that may be returned by RIO functions.
|
||||
*/
|
||||
#define RIO_SUCCESSFUL 0x00
|
||||
#define RIO_BAD_SIZE 0x81
|
||||
|
||||
/*
|
||||
* For RIO devices, the region numbers are assigned this way:
|
||||
*
|
||||
* 0 RapidIO outbound doorbells
|
||||
* 1-15 RapidIO memory regions
|
||||
*
|
||||
* For RIO master ports, the region number are assigned this way:
|
||||
*
|
||||
* 0 RapidIO inbound doorbells
|
||||
* 1 RapidIO inbound mailboxes
|
||||
* 1 RapidIO outbound mailboxes
|
||||
*/
|
||||
#define RIO_DOORBELL_RESOURCE 0
|
||||
#define RIO_INB_MBOX_RESOURCE 1
|
||||
#define RIO_OUTB_MBOX_RESOURCE 2
|
||||
|
||||
extern struct bus_type rio_bus_type;
|
||||
extern struct list_head rio_devices; /* list of all devices */
|
||||
|
||||
struct rio_mport;
|
||||
|
||||
/**
|
||||
* struct rio_dev - RIO device info
|
||||
* @global_list: Node in list of all RIO devices
|
||||
* @net_list: Node in list of RIO devices in a network
|
||||
* @net: Network this device is a part of
|
||||
* @did: Device ID
|
||||
* @vid: Vendor ID
|
||||
* @device_rev: Device revision
|
||||
* @asm_did: Assembly device ID
|
||||
* @asm_vid: Assembly vendor ID
|
||||
* @asm_rev: Assembly revision
|
||||
* @efptr: Extended feature pointer
|
||||
* @pef: Processing element features
|
||||
* @swpinfo: Switch port info
|
||||
* @src_ops: Source operation capabilities
|
||||
* @dst_ops: Destination operation capabilities
|
||||
* @dma_mask: Mask of bits of RIO address this device implements
|
||||
* @rswitch: Pointer to &struct rio_switch if valid for this device
|
||||
* @driver: Driver claiming this device
|
||||
* @dev: Device model device
|
||||
* @riores: RIO resources this device owns
|
||||
* @destid: Network destination ID
|
||||
*/
|
||||
struct rio_dev {
|
||||
struct list_head global_list; /* node in list of all RIO devices */
|
||||
struct list_head net_list; /* node in per net list */
|
||||
struct rio_net *net; /* RIO net this device resides in */
|
||||
u16 did;
|
||||
u16 vid;
|
||||
u32 device_rev;
|
||||
u16 asm_did;
|
||||
u16 asm_vid;
|
||||
u16 asm_rev;
|
||||
u16 efptr;
|
||||
u32 pef;
|
||||
u32 swpinfo; /* Only used for switches */
|
||||
u32 src_ops;
|
||||
u32 dst_ops;
|
||||
u64 dma_mask;
|
||||
struct rio_switch *rswitch; /* RIO switch info */
|
||||
struct rio_driver *driver; /* RIO driver claiming this device */
|
||||
struct device dev; /* LDM device structure */
|
||||
struct resource riores[RIO_MAX_DEV_RESOURCES];
|
||||
u16 destid;
|
||||
};
|
||||
|
||||
#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
|
||||
#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
|
||||
#define to_rio_dev(n) container_of(n, struct rio_dev, dev)
|
||||
|
||||
/**
|
||||
* struct rio_msg - RIO message event
|
||||
* @res: Mailbox resource
|
||||
* @mcback: Message event callback
|
||||
*/
|
||||
struct rio_msg {
|
||||
struct resource *res;
|
||||
void (*mcback) (struct rio_mport * mport, void *dev_id, int mbox, int slot);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct rio_dbell - RIO doorbell event
|
||||
* @node: Node in list of doorbell events
|
||||
* @res: Doorbell resource
|
||||
* @dinb: Doorbell event callback
|
||||
* @dev_id: Device specific pointer to pass on event
|
||||
*/
|
||||
struct rio_dbell {
|
||||
struct list_head node;
|
||||
struct resource *res;
|
||||
void (*dinb) (struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info);
|
||||
void *dev_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct rio_mport - RIO master port info
|
||||
* @dbells: List of doorbell events
|
||||
* @node: Node in global list of master ports
|
||||
* @nnode: Node in network list of master ports
|
||||
* @iores: I/O mem resource that this master port interface owns
|
||||
* @riores: RIO resources that this master port interfaces owns
|
||||
* @inb_msg: RIO inbound message event descriptors
|
||||
* @outb_msg: RIO outbound message event descriptors
|
||||
* @host_deviceid: Host device ID associated with this master port
|
||||
* @ops: configuration space functions
|
||||
* @id: Port ID, unique among all ports
|
||||
* @index: Port index, unique among all port interfaces of the same type
|
||||
* @name: Port name string
|
||||
*/
|
||||
struct rio_mport {
|
||||
struct list_head dbells; /* list of doorbell events */
|
||||
struct list_head node; /* node in global list of ports */
|
||||
struct list_head nnode; /* node in net list of ports */
|
||||
struct resource iores;
|
||||
struct resource riores[RIO_MAX_MPORT_RESOURCES];
|
||||
struct rio_msg inb_msg[RIO_MAX_MBOX];
|
||||
struct rio_msg outb_msg[RIO_MAX_MBOX];
|
||||
int host_deviceid; /* Host device ID */
|
||||
struct rio_ops *ops; /* maintenance transaction functions */
|
||||
unsigned char id; /* port ID, unique among all ports */
|
||||
unsigned char index; /* port index, unique among all port
|
||||
interfaces of the same type */
|
||||
unsigned char name[40];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct rio_net - RIO network info
|
||||
* @node: Node in global list of RIO networks
|
||||
* @devices: List of devices in this network
|
||||
* @mports: List of master ports accessing this network
|
||||
* @hport: Default port for accessing this network
|
||||
* @id: RIO network ID
|
||||
*/
|
||||
struct rio_net {
|
||||
struct list_head node; /* node in list of networks */
|
||||
struct list_head devices; /* list of devices in this net */
|
||||
struct list_head mports; /* list of ports accessing net */
|
||||
struct rio_mport *hport; /* primary port for accessing net */
|
||||
unsigned char id; /* RIO network ID */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct rio_switch - RIO switch info
|
||||
* @node: Node in global list of switches
|
||||
* @switchid: Switch ID that is unique across a network
|
||||
* @hopcount: Hopcount to this switch
|
||||
* @destid: Associated destid in the path
|
||||
* @route_table: Copy of switch routing table
|
||||
* @add_entry: Callback for switch-specific route add function
|
||||
* @get_entry: Callback for switch-specific route get function
|
||||
*/
|
||||
struct rio_switch {
|
||||
struct list_head node;
|
||||
u16 switchid;
|
||||
u16 hopcount;
|
||||
u16 destid;
|
||||
u8 route_table[RIO_MAX_ROUTE_ENTRIES];
|
||||
int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
|
||||
u16 table, u16 route_destid, u8 route_port);
|
||||
int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
|
||||
u16 table, u16 route_destid, u8 * route_port);
|
||||
};
|
||||
|
||||
/* Low-level architecture-dependent routines */
|
||||
|
||||
/**
|
||||
* struct rio_ops - Low-level RIO configuration space operations
|
||||
* @lcread: Callback to perform local (master port) read of config space.
|
||||
* @lcwrite: Callback to perform local (master port) write of config space.
|
||||
* @cread: Callback to perform network read of config space.
|
||||
* @cwrite: Callback to perform network write of config space.
|
||||
* @dsend: Callback to send a doorbell message.
|
||||
*/
|
||||
struct rio_ops {
|
||||
int (*lcread) (int index, u32 offset, int len, u32 * data);
|
||||
int (*lcwrite) (int index, u32 offset, int len, u32 data);
|
||||
int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len,
|
||||
u32 * data);
|
||||
int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len,
|
||||
u32 data);
|
||||
int (*dsend) (int index, u16 destid, u16 data);
|
||||
};
|
||||
|
||||
#define RIO_RESOURCE_MEM 0x00000100
|
||||
#define RIO_RESOURCE_DOORBELL 0x00000200
|
||||
#define RIO_RESOURCE_MAILBOX 0x00000400
|
||||
|
||||
#define RIO_RESOURCE_CACHEABLE 0x00010000
|
||||
#define RIO_RESOURCE_PCI 0x00020000
|
||||
|
||||
#define RIO_RESOURCE_BUSY 0x80000000
|
||||
|
||||
/**
|
||||
* struct rio_driver - RIO driver info
|
||||
* @node: Node in list of drivers
|
||||
* @name: RIO driver name
|
||||
* @id_table: RIO device ids to be associated with this driver
|
||||
* @probe: RIO device inserted
|
||||
* @remove: RIO device removed
|
||||
* @suspend: RIO device suspended
|
||||
* @resume: RIO device awakened
|
||||
* @enable_wake: RIO device enable wake event
|
||||
* @driver: LDM driver struct
|
||||
*
|
||||
* Provides info on a RIO device driver for insertion/removal and
|
||||
* power management purposes.
|
||||
*/
|
||||
struct rio_driver {
|
||||
struct list_head node;
|
||||
char *name;
|
||||
const struct rio_device_id *id_table;
|
||||
int (*probe) (struct rio_dev * dev, const struct rio_device_id * id);
|
||||
void (*remove) (struct rio_dev * dev);
|
||||
int (*suspend) (struct rio_dev * dev, u32 state);
|
||||
int (*resume) (struct rio_dev * dev);
|
||||
int (*enable_wake) (struct rio_dev * dev, u32 state, int enable);
|
||||
struct device_driver driver;
|
||||
};
|
||||
|
||||
#define to_rio_driver(drv) container_of(drv,struct rio_driver, driver)
|
||||
|
||||
/**
|
||||
* struct rio_device_id - RIO device identifier
|
||||
* @did: RIO device ID
|
||||
* @vid: RIO vendor ID
|
||||
* @asm_did: RIO assembly device ID
|
||||
* @asm_vid: RIO assembly vendor ID
|
||||
*
|
||||
* Identifies a RIO device based on both the device/vendor IDs and
|
||||
* the assembly device/vendor IDs.
|
||||
*/
|
||||
struct rio_device_id {
|
||||
u16 did, vid;
|
||||
u16 asm_did, asm_vid;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct rio_route_ops - Per-switch route operations
|
||||
* @vid: RIO vendor ID
|
||||
* @did: RIO device ID
|
||||
* @add_hook: Callback that adds a route entry
|
||||
* @get_hook: Callback that gets a route entry
|
||||
*
|
||||
* Defines the operations that are necessary to manipulate the route
|
||||
* tables for a particular RIO switch device.
|
||||
*/
|
||||
struct rio_route_ops {
|
||||
u16 vid, did;
|
||||
int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
|
||||
u16 table, u16 route_destid, u8 route_port);
|
||||
int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
|
||||
u16 table, u16 route_destid, u8 * route_port);
|
||||
};
|
||||
|
||||
/* Architecture and hardware-specific functions */
|
||||
extern int rio_init_mports(void);
|
||||
extern void rio_register_mport(struct rio_mport *);
|
||||
extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int,
|
||||
void *, size_t);
|
||||
extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *);
|
||||
extern void *rio_hw_get_inb_message(struct rio_mport *, int);
|
||||
extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int);
|
||||
extern void rio_close_inb_mbox(struct rio_mport *, int);
|
||||
extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int);
|
||||
extern void rio_close_outb_mbox(struct rio_mport *, int);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* LINUX_RIO_H */
|
469
include/linux/rio_drv.h
Normal file
469
include/linux/rio_drv.h
Normal file
|
@ -0,0 +1,469 @@
|
|||
/*
|
||||
* RapidIO driver services
|
||||
*
|
||||
* Copyright 2005 MontaVista Software, Inc.
|
||||
* Matt Porter <mporter@kernel.crashing.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef LINUX_RIO_DRV_H
|
||||
#define LINUX_RIO_DRV_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/config.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/rio.h>
|
||||
|
||||
extern int __rio_local_read_config_32(struct rio_mport *port, u32 offset,
|
||||
u32 * data);
|
||||
extern int __rio_local_write_config_32(struct rio_mport *port, u32 offset,
|
||||
u32 data);
|
||||
extern int __rio_local_read_config_16(struct rio_mport *port, u32 offset,
|
||||
u16 * data);
|
||||
extern int __rio_local_write_config_16(struct rio_mport *port, u32 offset,
|
||||
u16 data);
|
||||
extern int __rio_local_read_config_8(struct rio_mport *port, u32 offset,
|
||||
u8 * data);
|
||||
extern int __rio_local_write_config_8(struct rio_mport *port, u32 offset,
|
||||
u8 data);
|
||||
|
||||
extern int rio_mport_read_config_32(struct rio_mport *port, u16 destid,
|
||||
u8 hopcount, u32 offset, u32 * data);
|
||||
extern int rio_mport_write_config_32(struct rio_mport *port, u16 destid,
|
||||
u8 hopcount, u32 offset, u32 data);
|
||||
extern int rio_mport_read_config_16(struct rio_mport *port, u16 destid,
|
||||
u8 hopcount, u32 offset, u16 * data);
|
||||
extern int rio_mport_write_config_16(struct rio_mport *port, u16 destid,
|
||||
u8 hopcount, u32 offset, u16 data);
|
||||
extern int rio_mport_read_config_8(struct rio_mport *port, u16 destid,
|
||||
u8 hopcount, u32 offset, u8 * data);
|
||||
extern int rio_mport_write_config_8(struct rio_mport *port, u16 destid,
|
||||
u8 hopcount, u32 offset, u8 data);
|
||||
|
||||
/**
|
||||
* rio_local_read_config_32 - Read 32 bits from local configuration space
|
||||
* @port: Master port
|
||||
* @offset: Offset into local configuration space
|
||||
* @data: Pointer to read data into
|
||||
*
|
||||
* Reads 32 bits of data from the specified offset within the local
|
||||
* device's configuration space.
|
||||
*/
|
||||
static inline int rio_local_read_config_32(struct rio_mport *port, u32 offset,
|
||||
u32 * data)
|
||||
{
|
||||
return __rio_local_read_config_32(port, offset, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_local_write_config_32 - Write 32 bits to local configuration space
|
||||
* @port: Master port
|
||||
* @offset: Offset into local configuration space
|
||||
* @data: Data to be written
|
||||
*
|
||||
* Writes 32 bits of data to the specified offset within the local
|
||||
* device's configuration space.
|
||||
*/
|
||||
static inline int rio_local_write_config_32(struct rio_mport *port, u32 offset,
|
||||
u32 data)
|
||||
{
|
||||
return __rio_local_write_config_32(port, offset, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_local_read_config_16 - Read 16 bits from local configuration space
|
||||
* @port: Master port
|
||||
* @offset: Offset into local configuration space
|
||||
* @data: Pointer to read data into
|
||||
*
|
||||
* Reads 16 bits of data from the specified offset within the local
|
||||
* device's configuration space.
|
||||
*/
|
||||
static inline int rio_local_read_config_16(struct rio_mport *port, u32 offset,
|
||||
u16 * data)
|
||||
{
|
||||
return __rio_local_read_config_16(port, offset, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_local_write_config_16 - Write 16 bits to local configuration space
|
||||
* @port: Master port
|
||||
* @offset: Offset into local configuration space
|
||||
* @data: Data to be written
|
||||
*
|
||||
* Writes 16 bits of data to the specified offset within the local
|
||||
* device's configuration space.
|
||||
*/
|
||||
|
||||
static inline int rio_local_write_config_16(struct rio_mport *port, u32 offset,
|
||||
u16 data)
|
||||
{
|
||||
return __rio_local_write_config_16(port, offset, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_local_read_config_8 - Read 8 bits from local configuration space
|
||||
* @port: Master port
|
||||
* @offset: Offset into local configuration space
|
||||
* @data: Pointer to read data into
|
||||
*
|
||||
* Reads 8 bits of data from the specified offset within the local
|
||||
* device's configuration space.
|
||||
*/
|
||||
static inline int rio_local_read_config_8(struct rio_mport *port, u32 offset,
|
||||
u8 * data)
|
||||
{
|
||||
return __rio_local_read_config_8(port, offset, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_local_write_config_8 - Write 8 bits to local configuration space
|
||||
* @port: Master port
|
||||
* @offset: Offset into local configuration space
|
||||
* @data: Data to be written
|
||||
*
|
||||
* Writes 8 bits of data to the specified offset within the local
|
||||
* device's configuration space.
|
||||
*/
|
||||
static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset,
|
||||
u8 data)
|
||||
{
|
||||
return __rio_local_write_config_8(port, offset, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_read_config_32 - Read 32 bits from configuration space
|
||||
* @rdev: RIO device
|
||||
* @offset: Offset into device configuration space
|
||||
* @data: Pointer to read data into
|
||||
*
|
||||
* Reads 32 bits of data from the specified offset within the
|
||||
* RIO device's configuration space.
|
||||
*/
|
||||
static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset,
|
||||
u32 * data)
|
||||
{
|
||||
u8 hopcount = 0xff;
|
||||
u16 destid = rdev->destid;
|
||||
|
||||
if (rdev->rswitch) {
|
||||
destid = rdev->rswitch->destid;
|
||||
hopcount = rdev->rswitch->hopcount;
|
||||
}
|
||||
|
||||
return rio_mport_read_config_32(rdev->net->hport, destid, hopcount,
|
||||
offset, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* rio_write_config_32 - Write 32 bits to configuration space
|
||||
* @rdev: RIO device
|
||||
* @offset: Offset into device configuration space
|
||||
* @data: Data to be written
|
||||
*
|
||||
* Writes 32 bits of data to the specified offset within the
|
||||
* RIO device's configuration space.
|
||||
*/
|
||||
static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset,
|
||||
u32 data)
|
||||
{
|
||||
u8 hopcount = 0xff;
|
||||
u16 destid = rdev->destid;
|
||||
|
||||
if (rdev->rswitch) {
|
||||
destid = rdev->rswitch->destid;
|
||||
hopcount = rdev->rswitch->hopcount;
|
||||
}
|
||||
|
||||
return rio_mport_write_config_32(rdev->net->hport, destid, hopcount,
|
||||
offset, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* rio_read_config_16 - Read 16 bits from configuration space
|
||||
* @rdev: RIO device
|
||||
* @offset: Offset into device configuration space
|
||||
* @data: Pointer to read data into
|
||||
*
|
||||
* Reads 16 bits of data from the specified offset within the
|
||||
* RIO device's configuration space.
|
||||
*/
|
||||
static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset,
|
||||
u16 * data)
|
||||
{
|
||||
u8 hopcount = 0xff;
|
||||
u16 destid = rdev->destid;
|
||||
|
||||
if (rdev->rswitch) {
|
||||
destid = rdev->rswitch->destid;
|
||||
hopcount = rdev->rswitch->hopcount;
|
||||
}
|
||||
|
||||
return rio_mport_read_config_16(rdev->net->hport, destid, hopcount,
|
||||
offset, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* rio_write_config_16 - Write 16 bits to configuration space
|
||||
* @rdev: RIO device
|
||||
* @offset: Offset into device configuration space
|
||||
* @data: Data to be written
|
||||
*
|
||||
* Writes 16 bits of data to the specified offset within the
|
||||
* RIO device's configuration space.
|
||||
*/
|
||||
static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset,
|
||||
u16 data)
|
||||
{
|
||||
u8 hopcount = 0xff;
|
||||
u16 destid = rdev->destid;
|
||||
|
||||
if (rdev->rswitch) {
|
||||
destid = rdev->rswitch->destid;
|
||||
hopcount = rdev->rswitch->hopcount;
|
||||
}
|
||||
|
||||
return rio_mport_write_config_16(rdev->net->hport, destid, hopcount,
|
||||
offset, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* rio_read_config_8 - Read 8 bits from configuration space
|
||||
* @rdev: RIO device
|
||||
* @offset: Offset into device configuration space
|
||||
* @data: Pointer to read data into
|
||||
*
|
||||
* Reads 8 bits of data from the specified offset within the
|
||||
* RIO device's configuration space.
|
||||
*/
|
||||
static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data)
|
||||
{
|
||||
u8 hopcount = 0xff;
|
||||
u16 destid = rdev->destid;
|
||||
|
||||
if (rdev->rswitch) {
|
||||
destid = rdev->rswitch->destid;
|
||||
hopcount = rdev->rswitch->hopcount;
|
||||
}
|
||||
|
||||
return rio_mport_read_config_8(rdev->net->hport, destid, hopcount,
|
||||
offset, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* rio_write_config_8 - Write 8 bits to configuration space
|
||||
* @rdev: RIO device
|
||||
* @offset: Offset into device configuration space
|
||||
* @data: Data to be written
|
||||
*
|
||||
* Writes 8 bits of data to the specified offset within the
|
||||
* RIO device's configuration space.
|
||||
*/
|
||||
static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data)
|
||||
{
|
||||
u8 hopcount = 0xff;
|
||||
u16 destid = rdev->destid;
|
||||
|
||||
if (rdev->rswitch) {
|
||||
destid = rdev->rswitch->destid;
|
||||
hopcount = rdev->rswitch->hopcount;
|
||||
}
|
||||
|
||||
return rio_mport_write_config_8(rdev->net->hport, destid, hopcount,
|
||||
offset, data);
|
||||
};
|
||||
|
||||
extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid,
|
||||
u16 data);
|
||||
|
||||
/**
|
||||
* rio_send_doorbell - Send a doorbell message to a device
|
||||
* @rdev: RIO device
|
||||
* @data: Doorbell message data
|
||||
*
|
||||
* Send a doorbell message to a RIO device. The doorbell message
|
||||
* has a 16-bit info field provided by the @data argument.
|
||||
*/
|
||||
static inline int rio_send_doorbell(struct rio_dev *rdev, u16 data)
|
||||
{
|
||||
return rio_mport_send_doorbell(rdev->net->hport, rdev->destid, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* rio_init_mbox_res - Initialize a RIO mailbox resource
|
||||
* @res: resource struct
|
||||
* @start: start of mailbox range
|
||||
* @end: end of mailbox range
|
||||
*
|
||||
* This function is used to initialize the fields of a resource
|
||||
* for use as a mailbox resource. It initializes a range of
|
||||
* mailboxes using the start and end arguments.
|
||||
*/
|
||||
static inline void rio_init_mbox_res(struct resource *res, int start, int end)
|
||||
{
|
||||
memset(res, 0, sizeof(struct resource));
|
||||
res->start = start;
|
||||
res->end = end;
|
||||
res->flags = RIO_RESOURCE_MAILBOX;
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_init_dbell_res - Initialize a RIO doorbell resource
|
||||
* @res: resource struct
|
||||
* @start: start of doorbell range
|
||||
* @end: end of doorbell range
|
||||
*
|
||||
* This function is used to initialize the fields of a resource
|
||||
* for use as a doorbell resource. It initializes a range of
|
||||
* doorbell messages using the start and end arguments.
|
||||
*/
|
||||
static inline void rio_init_dbell_res(struct resource *res, u16 start, u16 end)
|
||||
{
|
||||
memset(res, 0, sizeof(struct resource));
|
||||
res->start = start;
|
||||
res->end = end;
|
||||
res->flags = RIO_RESOURCE_DOORBELL;
|
||||
}
|
||||
|
||||
/**
|
||||
* RIO_DEVICE - macro used to describe a specific RIO device
|
||||
* @vid: the 16 bit RIO vendor ID
|
||||
* @did: the 16 bit RIO device ID
|
||||
*
|
||||
* This macro is used to create a struct rio_device_id that matches a
|
||||
* specific device. The assembly vendor and assembly device fields
|
||||
* will be set to %RIO_ANY_ID.
|
||||
*/
|
||||
#define RIO_DEVICE(dev,ven) \
|
||||
.did = (dev), .vid = (ven), \
|
||||
.asm_did = RIO_ANY_ID, .asm_vid = RIO_ANY_ID
|
||||
|
||||
/* Mailbox management */
|
||||
extern int rio_request_outb_mbox(struct rio_mport *, void *, int, int,
|
||||
void (*)(struct rio_mport *, void *,int, int));
|
||||
extern int rio_release_outb_mbox(struct rio_mport *, int);
|
||||
|
||||
/**
|
||||
* rio_add_outb_message - Add RIO message to an outbound mailbox queue
|
||||
* @mport: RIO master port containing the outbound queue
|
||||
* @rdev: RIO device the message is be sent to
|
||||
* @mbox: The outbound mailbox queue
|
||||
* @buffer: Pointer to the message buffer
|
||||
* @len: Length of the message buffer
|
||||
*
|
||||
* Adds a RIO message buffer to an outbound mailbox queue for
|
||||
* transmission. Returns 0 on success.
|
||||
*/
|
||||
static inline int rio_add_outb_message(struct rio_mport *mport,
|
||||
struct rio_dev *rdev, int mbox,
|
||||
void *buffer, size_t len)
|
||||
{
|
||||
return rio_hw_add_outb_message(mport, rdev, mbox, buffer, len);
|
||||
}
|
||||
|
||||
extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int,
|
||||
void (*)(struct rio_mport *, void *, int, int));
|
||||
extern int rio_release_inb_mbox(struct rio_mport *, int);
|
||||
|
||||
/**
|
||||
* rio_add_inb_buffer - Add buffer to an inbound mailbox queue
|
||||
* @mport: Master port containing the inbound mailbox
|
||||
* @mbox: The inbound mailbox number
|
||||
* @buffer: Pointer to the message buffer
|
||||
*
|
||||
* Adds a buffer to an inbound mailbox queue for reception. Returns
|
||||
* 0 on success.
|
||||
*/
|
||||
static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox,
|
||||
void *buffer)
|
||||
{
|
||||
return rio_hw_add_inb_buffer(mport, mbox, buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_get_inb_message - Get A RIO message from an inbound mailbox queue
|
||||
* @mport: Master port containing the inbound mailbox
|
||||
* @mbox: The inbound mailbox number
|
||||
* @buffer: Pointer to the message buffer
|
||||
*
|
||||
* Get a RIO message from an inbound mailbox queue. Returns 0 on success.
|
||||
*/
|
||||
static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox)
|
||||
{
|
||||
return rio_hw_get_inb_message(mport, mbox);
|
||||
}
|
||||
|
||||
/* Doorbell management */
|
||||
extern int rio_request_inb_dbell(struct rio_mport *, void *, u16, u16,
|
||||
void (*)(struct rio_mport *, void *, u16, u16, u16));
|
||||
extern int rio_release_inb_dbell(struct rio_mport *, u16, u16);
|
||||
extern struct resource *rio_request_outb_dbell(struct rio_dev *, u16, u16);
|
||||
extern int rio_release_outb_dbell(struct rio_dev *, struct resource *);
|
||||
|
||||
/* Memory region management */
|
||||
int rio_claim_resource(struct rio_dev *, int);
|
||||
int rio_request_regions(struct rio_dev *, char *);
|
||||
void rio_release_regions(struct rio_dev *);
|
||||
int rio_request_region(struct rio_dev *, int, char *);
|
||||
void rio_release_region(struct rio_dev *, int);
|
||||
|
||||
/* LDM support */
|
||||
int rio_register_driver(struct rio_driver *);
|
||||
void rio_unregister_driver(struct rio_driver *);
|
||||
struct rio_dev *rio_dev_get(struct rio_dev *);
|
||||
void rio_dev_put(struct rio_dev *);
|
||||
|
||||
/**
|
||||
* rio_name - Get the unique RIO device identifier
|
||||
* @rdev: RIO device
|
||||
*
|
||||
* Get the unique RIO device identifier. Returns the device
|
||||
* identifier string.
|
||||
*/
|
||||
static inline char *rio_name(struct rio_dev *rdev)
|
||||
{
|
||||
return rdev->dev.bus_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_get_drvdata - Get RIO driver specific data
|
||||
* @rdev: RIO device
|
||||
*
|
||||
* Get RIO driver specific data. Returns a pointer to the
|
||||
* driver specific data.
|
||||
*/
|
||||
static inline void *rio_get_drvdata(struct rio_dev *rdev)
|
||||
{
|
||||
return dev_get_drvdata(&rdev->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* rio_set_drvdata - Set RIO driver specific data
|
||||
* @rdev: RIO device
|
||||
* @data: Pointer to driver specific data
|
||||
*
|
||||
* Set RIO driver specific data. device struct driver data pointer
|
||||
* is set to the @data argument.
|
||||
*/
|
||||
static inline void rio_set_drvdata(struct rio_dev *rdev, void *data)
|
||||
{
|
||||
dev_set_drvdata(&rdev->dev, data);
|
||||
}
|
||||
|
||||
/* Misc driver helpers */
|
||||
extern u16 rio_local_get_device_id(struct rio_mport *port);
|
||||
extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from);
|
||||
extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did,
|
||||
struct rio_dev *from);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* LINUX_RIO_DRV_H */
|
24
include/linux/rio_ids.h
Normal file
24
include/linux/rio_ids.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* RapidIO devices
|
||||
*
|
||||
* Copyright 2005 MontaVista Software, Inc.
|
||||
* Matt Porter <mporter@kernel.crashing.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef LINUX_RIO_IDS_H
|
||||
#define LINUX_RIO_IDS_H
|
||||
|
||||
#define RIO_ANY_ID 0xffff
|
||||
|
||||
#define RIO_VID_FREESCALE 0x0002
|
||||
#define RIO_DID_MPC8560 0x0003
|
||||
|
||||
#define RIO_VID_TUNDRA 0x000d
|
||||
#define RIO_DID_TSI500 0x0500
|
||||
|
||||
#endif /* LINUX_RIO_IDS_H */
|
215
include/linux/rio_regs.h
Normal file
215
include/linux/rio_regs.h
Normal file
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
* RapidIO register definitions
|
||||
*
|
||||
* Copyright 2005 MontaVista Software, Inc.
|
||||
* Matt Porter <mporter@kernel.crashing.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef LINUX_RIO_REGS_H
|
||||
#define LINUX_RIO_REGS_H
|
||||
|
||||
/*
|
||||
* In RapidIO, each device has a 2MB configuration space that is
|
||||
* accessed via maintenance transactions. Portions of configuration
|
||||
* space are standardized and/or reserved.
|
||||
*/
|
||||
#define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */
|
||||
#define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */
|
||||
#define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */
|
||||
#define RIO_ASM_ID_MASK 0xffff0000 /* [I] Asm ID Mask */
|
||||
#define RIO_ASM_VEN_ID_MASK 0x0000ffff /* [I] Asm Vend Mask */
|
||||
|
||||
#define RIO_ASM_INFO_CAR 0x0c /* [I] Assembly Information CAR */
|
||||
#define RIO_ASM_REV_MASK 0xffff0000 /* [I] Asm Rev Mask */
|
||||
#define RIO_EXT_FTR_PTR_MASK 0x0000ffff /* [I] EF_PTR Mask */
|
||||
|
||||
#define RIO_PEF_CAR 0x10 /* [I] Processing Element Features CAR */
|
||||
#define RIO_PEF_BRIDGE 0x80000000 /* [I] Bridge */
|
||||
#define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */
|
||||
#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
|
||||
#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
|
||||
#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */
|
||||
#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */
|
||||
#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */
|
||||
#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */
|
||||
#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */
|
||||
#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */
|
||||
#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
|
||||
#define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */
|
||||
#define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */
|
||||
#define RIO_PEF_ADDR_50 0x00000002 /* [I] 50 bits */
|
||||
#define RIO_PEF_ADDR_34 0x00000001 /* [I] 34 bits */
|
||||
|
||||
#define RIO_SWP_INFO_CAR 0x14 /* [I] Switch Port Information CAR */
|
||||
#define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */
|
||||
#define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */
|
||||
#define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8)
|
||||
|
||||
#define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */
|
||||
#define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */
|
||||
#define RIO_SRC_OPS_WRITE 0x00004000 /* [I] Write op */
|
||||
#define RIO_SRC_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
|
||||
#define RIO_SRC_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
|
||||
#define RIO_SRC_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
|
||||
#define RIO_SRC_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
|
||||
#define RIO_SRC_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
|
||||
#define RIO_SRC_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
|
||||
#define RIO_SRC_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
|
||||
#define RIO_SRC_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
|
||||
#define RIO_SRC_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
|
||||
#define RIO_SRC_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
|
||||
|
||||
#define RIO_DST_OPS_CAR 0x1c /* Destination Operations CAR */
|
||||
#define RIO_DST_OPS_READ 0x00008000 /* [I] Read op */
|
||||
#define RIO_DST_OPS_WRITE 0x00004000 /* [I] Write op */
|
||||
#define RIO_DST_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
|
||||
#define RIO_DST_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
|
||||
#define RIO_DST_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
|
||||
#define RIO_DST_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
|
||||
#define RIO_DST_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
|
||||
#define RIO_DST_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
|
||||
#define RIO_DST_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
|
||||
#define RIO_DST_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
|
||||
#define RIO_DST_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
|
||||
#define RIO_DST_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
|
||||
|
||||
#define RIO_OPS_READ 0x00008000 /* [I] Read op */
|
||||
#define RIO_OPS_WRITE 0x00004000 /* [I] Write op */
|
||||
#define RIO_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
|
||||
#define RIO_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
|
||||
#define RIO_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
|
||||
#define RIO_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
|
||||
#define RIO_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
|
||||
#define RIO_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
|
||||
#define RIO_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
|
||||
#define RIO_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
|
||||
#define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
|
||||
#define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
|
||||
|
||||
/* 0x20-0x3c *//* Reserved */
|
||||
|
||||
#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */
|
||||
#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
|
||||
#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */
|
||||
#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */
|
||||
#define RIO_MBOX0_BUSY 0x10000000 /* [II] Mbox 0 busy */
|
||||
#define RIO_MBOX0_FAIL 0x08000000 /* [II] Mbox 0 fail */
|
||||
#define RIO_MBOX0_ERROR 0x04000000 /* [II] Mbox 0 error */
|
||||
#define RIO_MBOX1_AVAIL 0x00800000 /* [II] Mbox 1 avail */
|
||||
#define RIO_MBOX1_FULL 0x00200000 /* [II] Mbox 1 full */
|
||||
#define RIO_MBOX1_EMPTY 0x00200000 /* [II] Mbox 1 empty */
|
||||
#define RIO_MBOX1_BUSY 0x00100000 /* [II] Mbox 1 busy */
|
||||
#define RIO_MBOX1_FAIL 0x00080000 /* [II] Mbox 1 fail */
|
||||
#define RIO_MBOX1_ERROR 0x00040000 /* [II] Mbox 1 error */
|
||||
#define RIO_MBOX2_AVAIL 0x00008000 /* [II] Mbox 2 avail */
|
||||
#define RIO_MBOX2_FULL 0x00004000 /* [II] Mbox 2 full */
|
||||
#define RIO_MBOX2_EMPTY 0x00002000 /* [II] Mbox 2 empty */
|
||||
#define RIO_MBOX2_BUSY 0x00001000 /* [II] Mbox 2 busy */
|
||||
#define RIO_MBOX2_FAIL 0x00000800 /* [II] Mbox 2 fail */
|
||||
#define RIO_MBOX2_ERROR 0x00000400 /* [II] Mbox 2 error */
|
||||
#define RIO_MBOX3_AVAIL 0x00000080 /* [II] Mbox 3 avail */
|
||||
#define RIO_MBOX3_FULL 0x00000040 /* [II] Mbox 3 full */
|
||||
#define RIO_MBOX3_EMPTY 0x00000020 /* [II] Mbox 3 empty */
|
||||
#define RIO_MBOX3_BUSY 0x00000010 /* [II] Mbox 3 busy */
|
||||
#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */
|
||||
#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */
|
||||
|
||||
#define RIO_WRITE_PORT_CSR 0x44 /* [I] Write Port CSR */
|
||||
#define RIO_DOORBELL_CSR 0x44 /* [II] Doorbell CSR */
|
||||
#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */
|
||||
#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */
|
||||
#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */
|
||||
#define RIO_DOORBELL_BUSY 0x10000000 /* [II] Doorbell busy */
|
||||
#define RIO_DOORBELL_FAILED 0x08000000 /* [II] Doorbell failed */
|
||||
#define RIO_DOORBELL_ERROR 0x04000000 /* [II] Doorbell error */
|
||||
#define RIO_WRITE_PORT_AVAILABLE 0x00000080 /* [I] Write Port Available */
|
||||
#define RIO_WRITE_PORT_FULL 0x00000040 /* [I] Write Port Full */
|
||||
#define RIO_WRITE_PORT_EMPTY 0x00000020 /* [I] Write Port Empty */
|
||||
#define RIO_WRITE_PORT_BUSY 0x00000010 /* [I] Write Port Busy */
|
||||
#define RIO_WRITE_PORT_FAILED 0x00000008 /* [I] Write Port Failed */
|
||||
#define RIO_WRITE_PORT_ERROR 0x00000004 /* [I] Write Port Error */
|
||||
|
||||
/* 0x48 *//* Reserved */
|
||||
|
||||
#define RIO_PELL_CTRL_CSR 0x4c /* [I] PE Logical Layer Control CSR */
|
||||
#define RIO_PELL_ADDR_66 0x00000004 /* [I] 66-bit addr */
|
||||
#define RIO_PELL_ADDR_50 0x00000002 /* [I] 50-bit addr */
|
||||
#define RIO_PELL_ADDR_34 0x00000001 /* [I] 34-bit addr */
|
||||
|
||||
/* 0x50-0x54 *//* Reserved */
|
||||
|
||||
#define RIO_LCSH_BA 0x58 /* [I] LCS High Base Address */
|
||||
#define RIO_LCSL_BA 0x5c /* [I] LCS Base Address */
|
||||
|
||||
#define RIO_DID_CSR 0x60 /* [III] Base Device ID CSR */
|
||||
|
||||
/* 0x64 *//* Reserved */
|
||||
|
||||
#define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */
|
||||
#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */
|
||||
|
||||
/* 0x70-0xf8 *//* Reserved */
|
||||
/* 0x100-0xfff8 *//* [I] Extended Features Space */
|
||||
/* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */
|
||||
|
||||
/*
|
||||
* Extended Features Space is a configuration space area where
|
||||
* functionality is mapped into extended feature blocks via a
|
||||
* singly linked list of extended feature pointers (EFT_PTR).
|
||||
*
|
||||
* Each extended feature block can be identified/located in
|
||||
* Extended Features Space by walking the extended feature
|
||||
* list starting with the Extended Feature Pointer located
|
||||
* in the Assembly Information CAR.
|
||||
*
|
||||
* Extended Feature Blocks (EFBs) are identified with an assigned
|
||||
* EFB ID. Extended feature block offsets in the definitions are
|
||||
* relative to the offset of the EFB within the Extended Features
|
||||
* Space.
|
||||
*/
|
||||
|
||||
/* Helper macros to parse the Extended Feature Block header */
|
||||
#define RIO_EFB_PTR_MASK 0xffff0000
|
||||
#define RIO_EFB_ID_MASK 0x0000ffff
|
||||
#define RIO_GET_BLOCK_PTR(x) ((x & RIO_EFB_PTR_MASK) >> 16)
|
||||
#define RIO_GET_BLOCK_ID(x) (x & RIO_EFB_ID_MASK)
|
||||
|
||||
/* Extended Feature Block IDs */
|
||||
#define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */
|
||||
#define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */
|
||||
#define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */
|
||||
#define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */
|
||||
#define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */
|
||||
#define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */
|
||||
|
||||
/*
|
||||
* Physical 8/16 LP-LVDS
|
||||
* ID=0x0001, Generic End Point Devices
|
||||
* ID=0x0002, Generic End Point Devices, software assisted recovery option
|
||||
* ID=0x0003, Generic End Point Free Devices
|
||||
*
|
||||
* Physical LP-Serial
|
||||
* ID=0x0004, Generic End Point Devices
|
||||
* ID=0x0005, Generic End Point Devices, software assisted recovery option
|
||||
* ID=0x0006, Generic End Point Free Devices
|
||||
*/
|
||||
#define RIO_PORT_MNT_HEADER 0x0000
|
||||
#define RIO_PORT_REQ_CTL_CSR 0x0020
|
||||
#define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */
|
||||
#define RIO_PORT_GEN_CTL_CSR 0x003c
|
||||
#define RIO_PORT_GEN_HOST 0x80000000
|
||||
#define RIO_PORT_GEN_MASTER 0x40000000
|
||||
#define RIO_PORT_GEN_DISCOVERED 0x20000000
|
||||
#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */
|
||||
#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */
|
||||
#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */
|
||||
#define RIO_PORT_N_ERR_STS_CSR(x) (0x58 + x*0x20)
|
||||
#define PORT_N_ERR_STS_PORT_OK 0x00000002
|
||||
#define RIO_PORT_N_CTL_CSR(x) (0x5c + x*0x20)
|
||||
|
||||
#endif /* LINUX_RIO_REGS_H */
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue