Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
214fd232
Commit
214fd232
authored
Dec 30, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linuxusb.bkbits.net/linus-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
0907edc2
92bde82b
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
201 additions
and
307 deletions
+201
-307
drivers/i2c/i2c-adap-ite.c
drivers/i2c/i2c-adap-ite.c
+0
-6
drivers/i2c/i2c-philips-par.c
drivers/i2c/i2c-philips-par.c
+0
-16
drivers/i2c/i2c-proc.c
drivers/i2c/i2c-proc.c
+1
-9
drivers/scsi/Makefile
drivers/scsi/Makefile
+1
-0
drivers/scsi/aic7xxx/Kconfig.aic79xx
drivers/scsi/aic7xxx/Kconfig.aic79xx
+8
-8
drivers/scsi/aic7xxx/Kconfig.aic7xxx
drivers/scsi/aic7xxx/Kconfig.aic7xxx
+2
-2
drivers/scsi/aic7xxx/aic7770_osm.c
drivers/scsi/aic7xxx/aic7770_osm.c
+8
-1
drivers/scsi/aic7xxx/aic79xx_core.c
drivers/scsi/aic7xxx/aic79xx_core.c
+5
-4
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic79xx_osm.c
+58
-17
drivers/scsi/aic7xxx/aic79xx_osm.h
drivers/scsi/aic7xxx/aic79xx_osm.h
+8
-4
drivers/scsi/aic7xxx/aic79xx_osm_pci.c
drivers/scsi/aic7xxx/aic79xx_osm_pci.c
+3
-5
drivers/scsi/aic7xxx/aic7xxx_core.c
drivers/scsi/aic7xxx/aic7xxx_core.c
+5
-2
drivers/scsi/aic7xxx/aic7xxx_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.c
+68
-16
drivers/scsi/aic7xxx/aic7xxx_osm.h
drivers/scsi/aic7xxx/aic7xxx_osm.h
+8
-4
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+2
-3
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
+2
-2
drivers/scsi/aic7xxx/aiclib.c
drivers/scsi/aic7xxx/aiclib.c
+9
-3
drivers/scsi/aic7xxx/aiclib.h
drivers/scsi/aic7xxx/aiclib.h
+4
-0
include/linux/i2c-dev.h
include/linux/i2c-dev.h
+3
-174
include/linux/i2c.h
include/linux/i2c.h
+6
-31
No files found.
drivers/i2c/i2c-adap-ite.c
View file @
214fd232
...
...
@@ -61,11 +61,7 @@ static int own = 0;
static
int
i2c_debug
=
0
;
static
struct
iic_ite
gpi
;
#if (LINUX_VERSION_CODE < 0x020301)
static
struct
wait_queue
*
iic_wait
=
NULL
;
#else
static
wait_queue_head_t
iic_wait
;
#endif
static
int
iic_pending
;
/* ----- global defines ----------------------------------------------- */
...
...
@@ -236,9 +232,7 @@ static int __init iic_ite_init(void)
piic
->
iic_own
=
own
;
iic_ite_data
.
data
=
(
void
*
)
piic
;
#if (LINUX_VERSION_CODE >= 0x020301)
init_waitqueue_head
(
&
iic_wait
);
#endif
if
(
iic_hw_resrc_init
()
==
0
)
{
if
(
i2c_iic_add_bus
(
&
iic_ite_ops
)
<
0
)
return
-
ENODEV
;
...
...
drivers/i2c/i2c-philips-par.c
View file @
214fd232
...
...
@@ -228,41 +228,25 @@ static void i2c_parport_detach (struct parport *port)
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
static
struct
parport_driver
i2c_driver
=
{
"i2c-philips-par"
,
i2c_parport_attach
,
i2c_parport_detach
,
NULL
};
#endif
int
__init
i2c_bitlp_init
(
void
)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,4)
struct
parport
*
port
;
#endif
printk
(
KERN_INFO
"i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)
\n
"
,
I2C_VERSION
,
I2C_DATE
);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_register_driver
(
&
i2c_driver
);
#else
for
(
port
=
parport_enumerate
();
port
;
port
=
port
->
next
)
i2c_parport_attach
(
port
);
#endif
return
0
;
}
void
__exit
i2c_bitlp_exit
(
void
)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
parport_unregister_driver
(
&
i2c_driver
);
#else
struct
parport
*
port
;
for
(
port
=
parport_enumerate
();
port
;
port
=
port
->
next
)
i2c_parport_detach
(
port
);
#endif
}
MODULE_AUTHOR
(
"Simon G. Vogl <simon@tk.uni-linz.ac.at>"
);
...
...
drivers/i2c/i2c-proc.c
View file @
214fd232
...
...
@@ -23,7 +23,6 @@
This driver puts entries in /proc/sys/dev/sensors for each I2C device
*/
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
...
...
@@ -31,14 +30,10 @@
#include <linux/sysctl.h>
#include <linux/proc_fs.h>
#include <linux/ioport.h>
#include <asm/uaccess.h>
#include <linux/i2c.h>
#include <linux/i2c-proc.h>
#include <linux/init.h>
#ifndef THIS_MODULE
#define THIS_MODULE NULL
#endif
#include <asm/uaccess.h>
static
int
i2c_create_name
(
char
**
name
,
const
char
*
prefix
,
struct
i2c_adapter
*
adapter
,
int
addr
);
...
...
@@ -56,7 +51,6 @@ static int i2c_sysctl_chips(ctl_table * table, int *name, int nlen,
#define SENSORS_ENTRY_MAX 20
static
struct
ctl_table_header
*
i2c_entries
[
SENSORS_ENTRY_MAX
];
static
unsigned
short
i2c_inodes
[
SENSORS_ENTRY_MAX
];
static
struct
i2c_client
*
i2c_clients
[
SENSORS_ENTRY_MAX
];
...
...
@@ -197,8 +191,6 @@ int i2c_register_entry(struct i2c_client *client, const char *prefix,
return
id
;
}
#endif
/* DEBUG */
i2c_inodes
[
id
-
256
]
=
new_header
->
ctl_table
->
child
->
child
->
de
->
low_ino
;
new_header
->
ctl_table
->
child
->
child
->
de
->
owner
=
controlling_mod
;
return
id
;
...
...
drivers/scsi/Makefile
View file @
214fd232
...
...
@@ -58,6 +58,7 @@ obj-$(CONFIG_SCSI_AHA152X) += aha152x.o
obj-$(CONFIG_SCSI_AHA1542)
+=
aha1542.o
obj-$(CONFIG_SCSI_AHA1740)
+=
aha1740.o
obj-$(CONFIG_SCSI_AIC7XXX)
+=
aic7xxx/
obj-$(CONFIG_SCSI_AIC79XX)
+=
aic7xxx/
obj-$(CONFIG_SCSI_AACRAID)
+=
aacraid/
obj-$(CONFIG_SCSI_AIC7XXX_OLD)
+=
aic7xxx_old.o
obj-$(CONFIG_SCSI_IPS)
+=
ips.o
...
...
drivers/scsi/aic7xxx/Kconfig.aic79xx
View file @
214fd232
#
# AIC79XX 2.5.X Kernel configuration File.
# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#
2
$
# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic79xx#
3
$
#
config SCSI_AIC79XX
tristate "Adaptec AIC79xx U320 support"
...
...
@@ -87,7 +87,7 @@ config AIC79XX_DEBUG_MASK
config AIC79XX_REG_PRETTY_PRINT
bool "Decode registers during diagnostics"
depends on SCSI_AIC79XX && SCSI_AIC7XXX_BUILD_FIRMWARE
depends on SCSI_AIC79XX
default y
help
Compile in register value tables for the output of expanded register
...
...
drivers/scsi/aic7xxx/Kconfig.aic7xxx
View file @
214fd232
#
# AIC7XXX and AIC79XX 2.5.X Kernel configuration File.
# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic7xxx#
4
$
# $Id: //depot/linux-aic79xx-2.5.0/drivers/scsi/aic7xxx/Kconfig.aic7xxx#
5
$
#
config SCSI_AIC7XXX
tristate "Adaptec AIC7xxx Fast -> U160 support (New Driver)"
...
...
@@ -92,7 +92,7 @@ config AIC7XXX_DEBUG_MASK
config AIC7XXX_REG_PRETTY_PRINT
bool "Decode registers during diagnostics"
depends on SCSI_AIC7XXX
&& SCSI_AIC7XXX_BUILD_FIRMWARE
depends on SCSI_AIC7XXX
default y
help
Compile in register value tables for the output of expanded register
...
...
drivers/scsi/aic7xxx/aic7770_osm.c
View file @
214fd232
...
...
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_osm.c#1
1
$
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7770_osm.c#1
2
$
*/
#include "aic7xxx_osm.h"
...
...
@@ -61,8 +61,14 @@ aic7770_linux_probe(Scsi_Host_Template *template)
uint32_t
eisa_id
;
size_t
id_size
;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
if
(
check_region
(
eisaBase
,
AHC_EISA_IOSIZE
)
!=
0
)
continue
;
request_region
(
eisaBase
,
AHC_EISA_IOSIZE
,
"aic7xxx"
);
#else
if
(
request_region
(
eisaBase
,
AHC_EISA_IOSIZE
,
"aic7xxx"
)
!=
0
)
continue
;
#endif
eisa_id
=
0
;
id_size
=
sizeof
(
eisa_id
);
...
...
@@ -72,6 +78,7 @@ aic7770_linux_probe(Scsi_Host_Template *template)
eisa_id
|=
inb
(
eisaBase
+
IDOFFSET
+
i
)
<<
((
id_size
-
i
-
1
)
*
8
);
}
release_region
(
eisaBase
,
AHC_EISA_IOSIZE
);
if
(
eisa_id
&
0x80000000
)
continue
;
/* no EISA card in slot */
...
...
drivers/scsi/aic7xxx/aic79xx_core.c
View file @
214fd232
...
...
@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#14
7
$
* $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#14
8
$
*
* $FreeBSD$
*/
...
...
@@ -3416,8 +3416,10 @@ ahd_handle_message_phase(struct ahd_softc *ahd)
*/
if
(
ahd
->
msgout_len
!=
0
)
{
#ifdef AHD_DEBUG
if
((
ahd_debug
&
AHD_SHOW_MESSAGES
)
!=
0
)
if
((
ahd_debug
&
AHD_SHOW_MESSAGES
)
!=
0
)
{
ahd_print_devinfo
(
ahd
,
&
devinfo
);
printf
(
"Asserting ATN for response
\n
"
);
}
#endif
ahd_assert_atn
(
ahd
);
}
...
...
@@ -7521,8 +7523,7 @@ ahd_stat_timer(void *arg)
"now %sabled. Cmds %d
\n
"
,
ahd_name
(
ahd
),
(
enint_coal
&
ENINT_COALESS
)
?
"en"
:
"dis"
,
ahd
->
cmdcmplt_total
,
ahd
->
cmdcmplt_counts
[
ahd
->
cmdcmplt_bucket
]);
ahd
->
cmdcmplt_total
);
#endif
}
...
...
drivers/scsi/aic7xxx/aic79xx_osm.c
View file @
214fd232
/*
* Adaptec AIC79xx device driver for Linux.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#10
0
$
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#10
3
$
*
* --------------------------------------------------------------------------
* Copyright (c) 1994-2000 Justin T. Gibbs.
...
...
@@ -1339,7 +1339,7 @@ Scsi_Host_Template aic79xx_driver_template = {
*/
.
max_sectors
=
8192
,
#endif
#if defined CONFIG_HIGHIO
#if defined CONFIG_HIGHIO
|| LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
/* Assume RedHat Distribution with its different HIGHIO conventions. */
.
can_dma_32
=
1
,
...
...
@@ -2486,8 +2486,25 @@ ahd_linux_dv_thread(void *data)
printf
(
"In DV Thread
\n
"
);
#endif
/*
* Don't care about any signals.
*/
siginitsetinv
(
&
current
->
blocked
,
0
);
/*
* Complete thread creation.
*/
lock_kernel
();
daemonize
();
sprintf
(
current
->
comm
,
"ahd_dv_%d"
,
ahd
->
unit
);
unlock_kernel
();
while
(
1
)
{
down
(
&
ahd
->
platform_data
->
dv_sem
);
/*
* Use down_interruptible() rather than down() to
* avoid inclusion in the load average.
*/
down_interruptible
(
&
ahd
->
platform_data
->
dv_sem
);
/* Check to see if we've been signaled to exit */
ahd_lock
(
ahd
,
&
s
);
...
...
@@ -2510,7 +2527,7 @@ ahd_linux_dv_thread(void *data)
while
(
LIST_FIRST
(
&
ahd
->
pending_scbs
)
!=
NULL
)
{
ahd
->
platform_data
->
flags
|=
AHD_DV_WAIT_SIMQ_EMPTY
;
ahd_unlock
(
ahd
,
&
s
);
down
(
&
ahd
->
platform_data
->
dv_sem
);
down
_interruptible
(
&
ahd
->
platform_data
->
dv_sem
);
ahd_lock
(
ahd
,
&
s
);
}
...
...
@@ -2521,7 +2538,7 @@ ahd_linux_dv_thread(void *data)
while
(
AHD_DV_SIMQ_FROZEN
(
ahd
)
==
0
)
{
ahd
->
platform_data
->
flags
|=
AHD_DV_WAIT_SIMQ_RELEASE
;
ahd_unlock
(
ahd
,
&
s
);
down
(
&
ahd
->
platform_data
->
dv_sem
);
down
_interruptible
(
&
ahd
->
platform_data
->
dv_sem
);
ahd_lock
(
ahd
,
&
s
);
}
ahd_unlock
(
ahd
,
&
s
);
...
...
@@ -2623,6 +2640,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
AHD_TRANS_GOAL
,
/*paused*/
FALSE
);
ahd_unlock
(
ahd
,
&
s
);
timeout
=
10
*
HZ
;
targ
->
flags
&=
~
AHD_INQ_VALID
;
/* FALLTHROUGH */
case
AHD_DV_STATE_INQ_VERIFY
:
{
...
...
@@ -2686,7 +2704,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
ahd_unlock
(
ahd
,
&
s
);
#endif
down
(
&
ahd
->
platform_data
->
dv_cmd_sem
);
down
_interruptible
(
&
ahd
->
platform_data
->
dv_cmd_sem
);
/*
* Wait for the SIMQ to be released so that DV is the
* only reason the queue is frozen.
...
...
@@ -2695,7 +2713,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
while
(
AHD_DV_SIMQ_FROZEN
(
ahd
)
==
0
)
{
ahd
->
platform_data
->
flags
|=
AHD_DV_WAIT_SIMQ_RELEASE
;
ahd_unlock
(
ahd
,
&
s
);
down
(
&
ahd
->
platform_data
->
dv_sem
);
down
_interruptible
(
&
ahd
->
platform_data
->
dv_sem
);
ahd_lock
(
ahd
,
&
s
);
}
ahd_unlock
(
ahd
,
&
s
);
...
...
@@ -2704,6 +2722,25 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
}
out:
if
((
targ
->
flags
&
AHD_INQ_VALID
)
!=
0
&&
ahd_linux_get_device
(
ahd
,
devinfo
.
channel
-
'A'
,
devinfo
.
target
,
devinfo
.
lun
,
/*alloc*/
FALSE
)
==
NULL
)
{
/*
* The DV state machine failed to configure this device.
* This is normal if DV is disabled. Since we have inquiry
* data, filter it and use the "optimistic" negotiation
* parameters found in the inquiry string.
*/
ahd_linux_filter_inquiry
(
ahd
,
&
devinfo
);
if
((
targ
->
flags
&
(
AHD_BASIC_DV
|
AHD_ENHANCED_DV
))
!=
0
)
{
ahd_print_devinfo
(
ahd
,
&
devinfo
);
printf
(
"DV failed to configure device. "
"Please file a bug report against "
"this driver.
\n
"
);
}
}
if
(
cmd
!=
NULL
)
free
(
cmd
,
M_DEVBUF
);
...
...
@@ -2789,24 +2826,21 @@ ahd_linux_dv_transition(struct ahd_softc *ahd, struct scsi_cmnd *cmd,
break
;
}
if
(
ahd_linux_user_dv_setting
(
ahd
)
==
0
)
{
ahd_linux_filter_inquiry
(
ahd
,
devinfo
)
;
AHD_SET_DV_STATE
(
ahd
,
targ
,
AHD_DV_STATE_EXIT
);
AHD_SET_DV_STATE
(
ahd
,
targ
,
targ
->
dv_state
+
1
);
targ
->
flags
|=
AHD_INQ_VALID
;
if
(
ahd_linux_user_dv_setting
(
ahd
)
==
0
)
break
;
}
spi3data
=
targ
->
inq_data
->
spi3data
;
switch
(
spi3data
&
SID_SPI_CLOCK_DT_ST
)
{
default:
case
SID_SPI_CLOCK_ST
:
/* Assume only basic DV is supported. */
ahd_linux_filter_inquiry
(
ahd
,
devinfo
);
AHD_SET_DV_STATE
(
ahd
,
targ
,
AHD_DV_STATE_INQ_VERIFY
);
targ
->
flags
|=
AHD_BASIC_DV
;
break
;
case
SID_SPI_CLOCK_DT
:
case
SID_SPI_CLOCK_DT_ST
:
AHD_SET_DV_STATE
(
ahd
,
targ
,
AHD_DV_STATE_REBD
)
;
targ
->
flags
|=
AHD_ENHANCED_DV
;
break
;
}
break
;
...
...
@@ -2902,8 +2936,15 @@ ahd_linux_dv_transition(struct ahd_softc *ahd, struct scsi_cmnd *cmd,
case
AHD_DV_STATE_TUR
:
switch
(
status
&
SS_MASK
)
{
case
SS_NOP
:
if
((
targ
->
flags
&
AHD_BASIC_DV
)
!=
0
)
{
ahd_linux_filter_inquiry
(
ahd
,
devinfo
);
AHD_SET_DV_STATE
(
ahd
,
targ
,
AHD_DV_STATE_INQ_ASYNC
);
AHD_DV_STATE_INQ_VERIFY
);
}
else
if
((
targ
->
flags
&
AHD_ENHANCED_DV
)
!=
0
)
{
AHD_SET_DV_STATE
(
ahd
,
targ
,
AHD_DV_STATE_REBD
);
}
else
{
AHD_SET_DV_STATE
(
ahd
,
targ
,
AHD_DV_STATE_EXIT
);
}
break
;
case
SS_RETRY
:
case
SS_TUR
:
...
...
drivers/scsi/aic7xxx/aic79xx_osm.h
View file @
214fd232
...
...
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#9
6
$
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#9
9
$
*
*/
#ifndef _AIC79XX_LINUX_H_
...
...
@@ -48,6 +48,7 @@
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/smp_lock.h>
#include <linux/version.h>
#ifndef AHD_MODVERSION_FILE
#define __NO_VERSION__
...
...
@@ -287,7 +288,7 @@ ahd_scb_timer_reset(struct scb *scb, u_int usec)
#include <linux/smp.h>
#endif
#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA
5
"
#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA
6
"
/**************************** Front End Queues ********************************/
/*
...
...
@@ -424,16 +425,19 @@ struct ahd_linux_device {
};
typedef
enum
{
AHD_DV_REQUIRED
=
0x01
AHD_DV_REQUIRED
=
0x01
,
AHD_INQ_VALID
=
0x02
,
AHD_BASIC_DV
=
0x04
,
AHD_ENHANCED_DV
=
0x08
}
ahd_linux_targ_flags
;
/* DV States */
typedef
enum
{
AHD_DV_STATE_EXIT
=
0
,
AHD_DV_STATE_INQ_SHORT_ASYNC
,
AHD_DV_STATE_TUR
,
AHD_DV_STATE_INQ_ASYNC
,
AHD_DV_STATE_INQ_ASYNC_VERIFY
,
AHD_DV_STATE_TUR
,
AHD_DV_STATE_REBD
,
AHD_DV_STATE_INQ_VERIFY
,
AHD_DV_STATE_WEB
,
...
...
drivers/scsi/aic7xxx/aic79xx_osm_pci.c
View file @
214fd232
...
...
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#1
8
$
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#1
9
$
*/
#include "aic79xx_osm.h"
...
...
@@ -240,10 +240,8 @@ ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd, u_long *base,
if
(
check_region
(
*
base
,
256
)
!=
0
||
check_region
(
*
base2
,
256
)
!=
0
)
return
(
ENOMEM
);
else
{
request_region
(
*
base
,
256
,
"aic79xx"
);
request_region
(
*
base2
,
256
,
"aic79xx"
);
}
#else
if
(
request_region
(
*
base
,
256
,
"aic79xx"
)
==
0
)
return
(
ENOMEM
);
...
...
drivers/scsi/aic7xxx/aic7xxx_core.c
View file @
214fd232
...
...
@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#10
4
$
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#10
5
$
*
* $FreeBSD$
*/
...
...
@@ -2772,9 +2772,12 @@ ahc_handle_message_phase(struct ahc_softc *ahc)
*/
if
(
ahc
->
msgout_len
!=
0
)
{
#ifdef AHC_DEBUG
if
((
ahc_debug
&
AHC_SHOW_MESSAGES
)
!=
0
)
if
((
ahc_debug
&
AHC_SHOW_MESSAGES
)
!=
0
)
{
ahc_print_devinfo
(
ahc
,
&
devinfo
);
printf
(
"Asserting ATN for response
\n
"
);
}
#endif
ahc_assert_atn
(
ahc
);
}
}
else
ahc
->
msgin_index
++
;
...
...
drivers/scsi/aic7xxx/aic7xxx_osm.c
View file @
214fd232
/*
* Adaptec AIC7xxx device driver for Linux.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#16
3
$
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#16
6
$
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
...
...
@@ -2336,8 +2336,25 @@ ahc_linux_dv_thread(void *data)
printf
(
"Launching DV Thread
\n
"
);
#endif
/*
* Don't care about any signals.
*/
siginitsetinv
(
&
current
->
blocked
,
0
);
/*
* Complete thread creation.
*/
lock_kernel
();
daemonize
();
sprintf
(
current
->
comm
,
"ahc_dv_%d"
,
ahc
->
unit
);
unlock_kernel
();
while
(
1
)
{
down
(
&
ahc
->
platform_data
->
dv_sem
);
/*
* Use down_interruptible() rather than down() to
* avoid inclusion in the load average.
*/
down_interruptible
(
&
ahc
->
platform_data
->
dv_sem
);
/* Check to see if we've been signaled to exit */
ahc_lock
(
ahc
,
&
s
);
...
...
@@ -2360,7 +2377,7 @@ ahc_linux_dv_thread(void *data)
while
(
LIST_FIRST
(
&
ahc
->
pending_scbs
)
!=
NULL
)
{
ahc
->
platform_data
->
flags
|=
AHC_DV_WAIT_SIMQ_EMPTY
;
ahc_unlock
(
ahc
,
&
s
);
down
(
&
ahc
->
platform_data
->
dv_sem
);
down
_interruptible
(
&
ahc
->
platform_data
->
dv_sem
);
ahc_lock
(
ahc
,
&
s
);
}
...
...
@@ -2371,7 +2388,7 @@ ahc_linux_dv_thread(void *data)
while
(
AHC_DV_SIMQ_FROZEN
(
ahc
)
==
0
)
{
ahc
->
platform_data
->
flags
|=
AHC_DV_WAIT_SIMQ_RELEASE
;
ahc_unlock
(
ahc
,
&
s
);
down
(
&
ahc
->
platform_data
->
dv_sem
);
down
_interruptible
(
&
ahc
->
platform_data
->
dv_sem
);
ahc_lock
(
ahc
,
&
s
);
}
ahc_unlock
(
ahc
,
&
s
);
...
...
@@ -2473,6 +2490,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
AHC_TRANS_GOAL
,
/*paused*/
FALSE
);
ahc_unlock
(
ahc
,
&
s
);
timeout
=
10
*
HZ
;
targ
->
flags
&=
~
AHC_INQ_VALID
;
/* FALLTHROUGH */
case
AHC_DV_STATE_INQ_VERIFY
:
{
...
...
@@ -2536,7 +2554,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
ahc_unlock
(
ahc
,
&
s
);
#endif
down
(
&
ahc
->
platform_data
->
dv_cmd_sem
);
down
_interruptible
(
&
ahc
->
platform_data
->
dv_cmd_sem
);
/*
* Wait for the SIMQ to be released so that DV is the
* only reason the queue is frozen.
...
...
@@ -2545,7 +2563,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
while
(
AHC_DV_SIMQ_FROZEN
(
ahc
)
==
0
)
{
ahc
->
platform_data
->
flags
|=
AHC_DV_WAIT_SIMQ_RELEASE
;
ahc_unlock
(
ahc
,
&
s
);
down
(
&
ahc
->
platform_data
->
dv_sem
);
down
_interruptible
(
&
ahc
->
platform_data
->
dv_sem
);
ahc_lock
(
ahc
,
&
s
);
}
ahc_unlock
(
ahc
,
&
s
);
...
...
@@ -2554,6 +2572,25 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
}
out:
if
((
targ
->
flags
&
AHC_INQ_VALID
)
!=
0
&&
ahc_linux_get_device
(
ahc
,
devinfo
.
channel
-
'A'
,
devinfo
.
target
,
devinfo
.
lun
,
/*alloc*/
FALSE
)
==
NULL
)
{
/*
* The DV state machine failed to configure this device.
* This is normal if DV is disabled. Since we have inquiry
* data, filter it and use the "optimistic" negotiation
* parameters found in the inquiry string.
*/
ahc_linux_filter_inquiry
(
ahc
,
&
devinfo
);
if
((
targ
->
flags
&
(
AHC_BASIC_DV
|
AHC_ENHANCED_DV
))
!=
0
)
{
ahc_print_devinfo
(
ahc
,
&
devinfo
);
printf
(
"DV failed to configure device. "
"Please file a bug report against "
"this driver.
\n
"
);
}
}
if
(
cmd
!=
NULL
)
free
(
cmd
,
M_DEVBUF
);
...
...
@@ -2639,24 +2676,21 @@ ahc_linux_dv_transition(struct ahc_softc *ahc, struct scsi_cmnd *cmd,
break
;
}
if
(
ahc_linux_user_dv_setting
(
ahc
)
==
0
)
{
ahc_linux_filter_inquiry
(
ahc
,
devinfo
)
;
AHC_SET_DV_STATE
(
ahc
,
targ
,
AHC_DV_STATE_EXIT
);
AHC_SET_DV_STATE
(
ahc
,
targ
,
targ
->
dv_state
+
1
);
targ
->
flags
|=
AHC_INQ_VALID
;
if
(
ahc_linux_user_dv_setting
(
ahc
)
==
0
)
break
;
}
spi3data
=
targ
->
inq_data
->
spi3data
;
switch
(
spi3data
&
SID_SPI_CLOCK_DT_ST
)
{
default:
case
SID_SPI_CLOCK_ST
:
/* Assume only basic DV is supported. */
ahc_linux_filter_inquiry
(
ahc
,
devinfo
);
AHC_SET_DV_STATE
(
ahc
,
targ
,
AHC_DV_STATE_INQ_VERIFY
);
targ
->
flags
|=
AHC_BASIC_DV
;
break
;
case
SID_SPI_CLOCK_DT
:
case
SID_SPI_CLOCK_DT_ST
:
AHC_SET_DV_STATE
(
ahc
,
targ
,
AHC_DV_STATE_REBD
)
;
targ
->
flags
|=
AHC_ENHANCED_DV
;
break
;
}
break
;
...
...
@@ -2752,8 +2786,15 @@ ahc_linux_dv_transition(struct ahc_softc *ahc, struct scsi_cmnd *cmd,
case
AHC_DV_STATE_TUR
:
switch
(
status
&
SS_MASK
)
{
case
SS_NOP
:
if
((
targ
->
flags
&
AHC_BASIC_DV
)
!=
0
)
{
ahc_linux_filter_inquiry
(
ahc
,
devinfo
);
AHC_SET_DV_STATE
(
ahc
,
targ
,
AHC_DV_STATE_INQ_ASYNC
);
AHC_DV_STATE_INQ_VERIFY
);
}
else
if
((
targ
->
flags
&
AHC_ENHANCED_DV
)
!=
0
)
{
AHC_SET_DV_STATE
(
ahc
,
targ
,
AHC_DV_STATE_REBD
);
}
else
{
AHC_SET_DV_STATE
(
ahc
,
targ
,
AHC_DV_STATE_EXIT
);
}
break
;
case
SS_RETRY
:
case
SS_TUR
:
...
...
@@ -4373,6 +4414,17 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
memset
(
&
cmd
->
sense_buffer
[
sense_size
],
0
,
sizeof
(
cmd
->
sense_buffer
)
-
sense_size
);
cmd
->
result
|=
(
DRIVER_SENSE
<<
24
);
#ifdef AHC_DEBUG
if
(
ahc_debug
&
AHC_SHOW_SENSE
)
{
int
i
;
printf
(
"Copied %d bytes of sense data:"
,
sense_size
);
for
(
i
=
0
;
i
<
sense_size
;
i
++
)
printf
(
" 0x%x"
,
cmd
->
sense_buffer
[
i
]);
printf
(
"
\n
"
);
}
#endif
}
break
;
}
...
...
drivers/scsi/aic7xxx/aic7xxx_osm.h
View file @
214fd232
...
...
@@ -53,7 +53,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#11
1
$
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#11
4
$
*
*/
#ifndef _AIC7XXX_LINUX_H_
...
...
@@ -65,6 +65,7 @@
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/smp_lock.h>
#include <linux/version.h>
#ifndef AHC_MODVERSION_FILE
#define __NO_VERSION__
...
...
@@ -300,7 +301,7 @@ ahc_scb_timer_reset(struct scb *scb, u_int usec)
#include <linux/smp.h>
#endif
#define AIC7XXX_DRIVER_VERSION "6.2.2
4
"
#define AIC7XXX_DRIVER_VERSION "6.2.2
5
"
/**************************** Front End Queues ********************************/
/*
...
...
@@ -437,16 +438,19 @@ struct ahc_linux_device {
};
typedef
enum
{
AHC_DV_REQUIRED
=
0x01
AHC_DV_REQUIRED
=
0x01
,
AHC_INQ_VALID
=
0x02
,
AHC_BASIC_DV
=
0x04
,
AHC_ENHANCED_DV
=
0x08
}
ahc_linux_targ_flags
;
/* DV States */
typedef
enum
{
AHC_DV_STATE_EXIT
=
0
,
AHC_DV_STATE_INQ_SHORT_ASYNC
,
AHC_DV_STATE_TUR
,
AHC_DV_STATE_INQ_ASYNC
,
AHC_DV_STATE_INQ_ASYNC_VERIFY
,
AHC_DV_STATE_TUR
,
AHC_DV_STATE_REBD
,
AHC_DV_STATE_INQ_VERIFY
,
AHC_DV_STATE_WEB
,
...
...
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
View file @
214fd232
...
...
@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#4
1
$
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#4
2
$
*/
#include "aic7xxx_osm.h"
...
...
@@ -232,7 +232,6 @@ ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
if
(
check_region
(
*
base
,
256
)
!=
0
)
return
(
ENOMEM
);
else
request_region
(
*
base
,
256
,
"aic7xxx"
);
#else
if
(
request_region
(
*
base
,
256
,
"aic7xxx"
)
==
0
)
...
...
drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
View file @
214fd232
...
...
@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#2
3
$
* $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#2
4
$
*
* $FreeBSD$
*/
...
...
@@ -546,7 +546,7 @@ symtable_dump(FILE *ofile, FILE *dfile)
if
(
num_entries
==
0
)
aic_print_reg_dump_start
(
dfile
,
curnode
);
else
else
if
(
dfile
!=
NULL
)
fputs
(
",
\n
"
,
dfile
);
num_entries
++
;
aic_print_reg_dump_entry
(
dfile
,
fieldnode
);
...
...
drivers/scsi/aic7xxx/aiclib.c
View file @
214fd232
...
...
@@ -541,12 +541,18 @@ static struct asc_table_entry asc_table[] = {
"Rounded parameter"
)
},
/* DTL WRSOMCAE */
{
SST
(
0x39
,
0x00
,
SS_RDEF
,
"Saving parameters not supported"
)
},
/* DTL WRSOM */
{
SST
(
0x3A
,
0x00
,
SS_
FATAL
|
ENXIO
,
/* DTL WRSOM */
{
SST
(
0x3A
,
0x00
,
SS_
NOP
,
"Medium not present"
)
},
/* DT WR OM */
{
SST
(
0x3A
,
0x01
,
SS_
FATAL
|
ENXIO
,
/* DT WR OM */
{
SST
(
0x3A
,
0x01
,
SS_
NOP
,
"Medium not present - tray closed"
)
},
/* DT WR OM */
{
SST
(
0x3A
,
0x0
2
,
SS_FATAL
|
ENXIO
,
/* DT WR OM */
{
SST
(
0x3A
,
0x0
1
,
SS_NOP
,
"Medium not present - tray open"
)
},
/* DT WR OM */
{
SST
(
0x3A
,
0x03
,
SS_NOP
,
"Medium not present - Loadable"
)
},
/* DT WR OM */
{
SST
(
0x3A
,
0x04
,
SS_NOP
,
"Medium not present - medium auxiliary "
"memory accessible"
)
},
/* DT WR OM */
{
SST
(
0x3A
,
0xFF
,
SS_NOP
,
NULL
)
},
/* Range 0x05->0xFF */
/* TL */
{
SST
(
0x3B
,
0x00
,
SS_RDEF
,
"Sequential positioning error"
)
},
/* T */
{
SST
(
0x3B
,
0x01
,
SS_RDEF
,
...
...
drivers/scsi/aic7xxx/aiclib.h
View file @
214fd232
...
...
@@ -827,12 +827,16 @@ extern const char *scsi_sense_key_text[];
/************************* Large Disk Handling ********************************/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static
__inline
int
aic_sector_div
(
u_long
capacity
,
int
heads
,
int
sectors
);
static
__inline
int
aic_sector_div
(
u_long
capacity
,
int
heads
,
int
sectors
)
{
return
(
capacity
/
(
heads
*
sectors
));
}
#else
static
__inline
int
aic_sector_div
(
sector_t
capacity
,
int
heads
,
int
sectors
);
static
__inline
int
aic_sector_div
(
sector_t
capacity
,
int
heads
,
int
sectors
)
{
...
...
include/linux/i2c-dev.h
View file @
214fd232
...
...
@@ -21,9 +21,8 @@
/* $Id: i2c-dev.h,v 1.11 2002/07/07 15:42:47 mds Exp $ */
#ifndef I2C_DEV_H
#define I2C_DEV_H
#ifndef _LINUX_I2C_DEV_H
#define _LINUX_I2C_DEV_H
#include <linux/types.h>
#include <linux/i2c.h>
...
...
@@ -45,174 +44,4 @@ struct i2c_rdwr_ioctl_data {
int
nmsgs
;
/* number of i2c_msgs */
};
#ifndef __KERNEL__
#include <sys/ioctl.h>
static
inline
__s32
i2c_smbus_access
(
int
file
,
char
read_write
,
__u8
command
,
int
size
,
union
i2c_smbus_data
*
data
)
{
struct
i2c_smbus_ioctl_data
args
;
args
.
read_write
=
read_write
;
args
.
command
=
command
;
args
.
size
=
size
;
args
.
data
=
data
;
return
ioctl
(
file
,
I2C_SMBUS
,
&
args
);
}
static
inline
__s32
i2c_smbus_write_quick
(
int
file
,
__u8
value
)
{
return
i2c_smbus_access
(
file
,
value
,
0
,
I2C_SMBUS_QUICK
,
NULL
);
}
static
inline
__s32
i2c_smbus_read_byte
(
int
file
)
{
union
i2c_smbus_data
data
;
if
(
i2c_smbus_access
(
file
,
I2C_SMBUS_READ
,
0
,
I2C_SMBUS_BYTE
,
&
data
))
return
-
1
;
else
return
0x0FF
&
data
.
byte
;
}
static
inline
__s32
i2c_smbus_write_byte
(
int
file
,
__u8
value
)
{
return
i2c_smbus_access
(
file
,
I2C_SMBUS_WRITE
,
value
,
I2C_SMBUS_BYTE
,
NULL
);
}
static
inline
__s32
i2c_smbus_read_byte_data
(
int
file
,
__u8
command
)
{
union
i2c_smbus_data
data
;
if
(
i2c_smbus_access
(
file
,
I2C_SMBUS_READ
,
command
,
I2C_SMBUS_BYTE_DATA
,
&
data
))
return
-
1
;
else
return
0x0FF
&
data
.
byte
;
}
static
inline
__s32
i2c_smbus_write_byte_data
(
int
file
,
__u8
command
,
__u8
value
)
{
union
i2c_smbus_data
data
;
data
.
byte
=
value
;
return
i2c_smbus_access
(
file
,
I2C_SMBUS_WRITE
,
command
,
I2C_SMBUS_BYTE_DATA
,
&
data
);
}
static
inline
__s32
i2c_smbus_read_word_data
(
int
file
,
__u8
command
)
{
union
i2c_smbus_data
data
;
if
(
i2c_smbus_access
(
file
,
I2C_SMBUS_READ
,
command
,
I2C_SMBUS_WORD_DATA
,
&
data
))
return
-
1
;
else
return
0x0FFFF
&
data
.
word
;
}
static
inline
__s32
i2c_smbus_write_word_data
(
int
file
,
__u8
command
,
__u16
value
)
{
union
i2c_smbus_data
data
;
data
.
word
=
value
;
return
i2c_smbus_access
(
file
,
I2C_SMBUS_WRITE
,
command
,
I2C_SMBUS_WORD_DATA
,
&
data
);
}
static
inline
__s32
i2c_smbus_process_call
(
int
file
,
__u8
command
,
__u16
value
)
{
union
i2c_smbus_data
data
;
data
.
word
=
value
;
if
(
i2c_smbus_access
(
file
,
I2C_SMBUS_WRITE
,
command
,
I2C_SMBUS_PROC_CALL
,
&
data
))
return
-
1
;
else
return
0x0FFFF
&
data
.
word
;
}
/* Returns the number of read bytes */
static
inline
__s32
i2c_smbus_read_block_data
(
int
file
,
__u8
command
,
__u8
*
values
)
{
union
i2c_smbus_data
data
;
int
i
;
if
(
i2c_smbus_access
(
file
,
I2C_SMBUS_READ
,
command
,
I2C_SMBUS_BLOCK_DATA
,
&
data
))
return
-
1
;
else
{
for
(
i
=
1
;
i
<=
data
.
block
[
0
];
i
++
)
values
[
i
-
1
]
=
data
.
block
[
i
];
return
data
.
block
[
0
];
}
}
static
inline
__s32
i2c_smbus_write_block_data
(
int
file
,
__u8
command
,
__u8
length
,
__u8
*
values
)
{
union
i2c_smbus_data
data
;
int
i
;
if
(
length
>
32
)
length
=
32
;
for
(
i
=
1
;
i
<=
length
;
i
++
)
data
.
block
[
i
]
=
values
[
i
-
1
];
data
.
block
[
0
]
=
length
;
return
i2c_smbus_access
(
file
,
I2C_SMBUS_WRITE
,
command
,
I2C_SMBUS_BLOCK_DATA
,
&
data
);
}
/* Returns the number of read bytes */
static
inline
__s32
i2c_smbus_read_i2c_block_data
(
int
file
,
__u8
command
,
__u8
*
values
)
{
union
i2c_smbus_data
data
;
int
i
;
if
(
i2c_smbus_access
(
file
,
I2C_SMBUS_READ
,
command
,
I2C_SMBUS_I2C_BLOCK_DATA
,
&
data
))
return
-
1
;
else
{
for
(
i
=
1
;
i
<=
data
.
block
[
0
];
i
++
)
values
[
i
-
1
]
=
data
.
block
[
i
];
return
data
.
block
[
0
];
}
}
static
inline
__s32
i2c_smbus_write_i2c_block_data
(
int
file
,
__u8
command
,
__u8
length
,
__u8
*
values
)
{
union
i2c_smbus_data
data
;
int
i
;
if
(
length
>
32
)
length
=
32
;
for
(
i
=
1
;
i
<=
length
;
i
++
)
data
.
block
[
i
]
=
values
[
i
-
1
];
data
.
block
[
0
]
=
length
;
return
i2c_smbus_access
(
file
,
I2C_SMBUS_WRITE
,
command
,
I2C_SMBUS_I2C_BLOCK_DATA
,
&
data
);
}
/* Returns the number of read bytes */
static
inline
__s32
i2c_smbus_block_process_call
(
int
file
,
__u8
command
,
__u8
length
,
__u8
*
values
)
{
union
i2c_smbus_data
data
;
int
i
;
if
(
length
>
32
)
length
=
32
;
for
(
i
=
1
;
i
<=
length
;
i
++
)
data
.
block
[
i
]
=
values
[
i
-
1
];
data
.
block
[
0
]
=
length
;
if
(
i2c_smbus_access
(
file
,
I2C_SMBUS_WRITE
,
command
,
I2C_SMBUS_BLOCK_PROC_CALL
,
&
data
))
return
-
1
;
else
{
for
(
i
=
1
;
i
<=
data
.
block
[
0
];
i
++
)
values
[
i
-
1
]
=
data
.
block
[
i
];
return
data
.
block
[
0
];
}
}
#endif
/* ndef __KERNEL__ */
#endif
#endif
/* _LINUX_I2C_DEV_H */
include/linux/i2c.h
View file @
214fd232
...
...
@@ -25,31 +25,17 @@
/* $Id: i2c.h,v 1.59 2002/07/19 20:53:45 phil Exp $ */
#ifndef I2C_H
#define I2C_H
#ifndef
_LINUX_
I2C_H
#define
_LINUX_
I2C_H
#define I2C_DATE "20020719"
#define I2C_VERSION "2.6.4"
#include <linux/i2c-id.h>
/* id values of adapters et. al. */
#include <linux/types.h>
struct
i2c_msg
;
#ifdef __KERNEL__
/* --- Includes and compatibility declarations ------------------------ */
#include <linux/version.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
#endif
#include <asm/page.h>
/* for 2.2.xx */
#include <asm/semaphore.h>
#include <linux/config.h>
#include <asm/semaphore.h>
/* --- General options ------------------------------------------------ */
...
...
@@ -59,6 +45,7 @@ struct i2c_msg;
#define I2C_CLIENT_MAX 32
#define I2C_DUMMY_MAX 4
struct
i2c_msg
;
struct
i2c_algorithm
;
struct
i2c_adapter
;
struct
i2c_client
;
...
...
@@ -212,10 +199,6 @@ struct i2c_algorithm {
u32
(
*
functionality
)
(
struct
i2c_adapter
*
);
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)
struct
proc_dir_entry
;
#endif
/*
* i2c_adapter is the structure used to identify a physical i2c bus along
* with the access algorithms necessary to access it.
...
...
@@ -250,9 +233,6 @@ struct i2c_adapter {
#ifdef CONFIG_PROC_FS
/* No need to set this when you initialize the adapter */
int
inode
;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,29)
struct
proc_dir_entry
*
proc_entry
;
#endif
#endif
/* def CONFIG_PROC_FS */
};
...
...
@@ -355,8 +335,6 @@ extern u32 i2c_get_functionality (struct i2c_adapter *adap);
/* Return 1 if adapter supports everything we need, 0 if not. */
extern
int
i2c_check_functionality
(
struct
i2c_adapter
*
adap
,
u32
func
);
#endif
/* __KERNEL__ */
/*
* I2C Message - used for pure i2c transaction, also from /dev interface
*/
...
...
@@ -506,8 +484,6 @@ union i2c_smbus_data {
#define I2C_MAJOR 89
/* Device major number */
#ifdef __KERNEL__
# ifndef NULL
# define NULL ( (void *) 0 )
# endif
...
...
@@ -577,5 +553,4 @@ union i2c_smbus_data {
#define i2c_is_isa_adapter(adapptr) \
((adapptr)->algo->id == I2C_ALGO_ISA)
#endif
/* def __KERNEL__ */
#endif
/* I2C_H */
#endif
/* _LINUX_I2C_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment