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
Kirill Smelkov
linux
Commits
324b683a
Commit
324b683a
authored
Oct 03, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/lord/xfs-2.6
into home.osdl.org:/home/torvalds/v2.5/linux
parents
1ac6fcb7
5fc0a431
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
943 additions
and
433 deletions
+943
-433
arch/x86_64/ia32/ia32_binfmt.c
arch/x86_64/ia32/ia32_binfmt.c
+6
-3
drivers/ide/ide.c
drivers/ide/ide.c
+3
-7
drivers/ide/legacy/pdc4030.c
drivers/ide/legacy/pdc4030.c
+17
-70
drivers/ide/pci/amd74xx.c
drivers/ide/pci/amd74xx.c
+4
-21
drivers/ide/pci/amd74xx.h
drivers/ide/pci/amd74xx.h
+0
-15
drivers/ide/pci/via82cxxx.c
drivers/ide/pci/via82cxxx.c
+7
-26
drivers/ide/pci/via82cxxx.h
drivers/ide/pci/via82cxxx.h
+0
-5
drivers/usb/core/inode.c
drivers/usb/core/inode.c
+76
-67
drivers/usb/host/uhci-debug.c
drivers/usb/host/uhci-debug.c
+83
-83
drivers/usb/host/uhci-hcd.c
drivers/usb/host/uhci-hcd.c
+1
-1
drivers/usb/input/Kconfig
drivers/usb/input/Kconfig
+2
-5
drivers/usb/misc/brlvger.c
drivers/usb/misc/brlvger.c
+3
-3
drivers/usb/misc/speedtch.c
drivers/usb/misc/speedtch.c
+63
-57
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan.c
+397
-23
drivers/usb/serial/keyspan.h
drivers/usb/serial/keyspan.h
+30
-3
drivers/usb/serial/keyspan_usa26msg.h
drivers/usb/serial/keyspan_usa26msg.h
+2
-6
drivers/usb/serial/keyspan_usa28msg.h
drivers/usb/serial/keyspan_usa28msg.h
+2
-6
drivers/usb/serial/keyspan_usa49msg.h
drivers/usb/serial/keyspan_usa49msg.h
+2
-6
drivers/usb/serial/keyspan_usa90msg.h
drivers/usb/serial/keyspan_usa90msg.h
+198
-0
drivers/usb/storage/freecom.c
drivers/usb/storage/freecom.c
+12
-4
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/unusual_devs.h
+7
-1
include/asm-i386/elf.h
include/asm-i386/elf.h
+4
-1
include/asm-ia64/elf.h
include/asm-ia64/elf.h
+21
-17
include/linux/usb.h
include/linux/usb.h
+3
-3
No files found.
arch/x86_64/ia32/ia32_binfmt.c
View file @
324b683a
...
...
@@ -82,9 +82,12 @@ do { \
int i; \
Elf32_Off ofs = 0; \
for (i = 0; i < VSYSCALL32_EHDR->e_phnum; ++i) { \
struct elf_phdr phdr = vsyscall_phdrs[i]; \
struct elf
32
_phdr phdr = vsyscall_phdrs[i]; \
if (phdr.p_type == PT_LOAD) { \
BUG_ON(ofs != 0); \
ofs = phdr.p_offset = offset; \
phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \
phdr.p_filesz = phdr.p_memsz; \
offset += phdr.p_filesz; \
} \
else \
...
...
@@ -99,10 +102,10 @@ do { \
(const struct elf32_phdr *) (VSYSCALL32_BASE \
+ VSYSCALL32_EHDR->e_phoff); \
int i; \
for (i = 0; i < VSYSCALL
32_EHDR->e_phnum; ++i) {
\
for (i = 0; i < VSYSCALL
_EHDR->e_phnum; ++i) {
\
if (vsyscall_phdrs[i].p_type == PT_LOAD) \
DUMP_WRITE((void *) (u64) vsyscall_phdrs[i].p_vaddr, \
vsyscall_phdrs[i].p_filesz);
\
PAGE_ALIGN(vsyscall_phdrs[i].p_memsz));
\
} \
} while (0)
...
...
drivers/ide/ide.c
View file @
324b683a
...
...
@@ -1800,7 +1800,6 @@ static int __init match_parm (char *s, const char *keywords[], int vals[], int m
#ifdef CONFIG_BLK_DEV_PDC4030
static
int
__initdata
probe_pdc4030
;
extern
void
init_pdc4030
(
void
);
#endif
#ifdef CONFIG_BLK_DEV_ALI14XX
static
int
__initdata
probe_ali14xx
;
...
...
@@ -2238,8 +2237,9 @@ static void __init probe_for_hwifs (void)
#endif
/* CONFIG_BLK_DEV_CMD640 */
#ifdef CONFIG_BLK_DEV_PDC4030
{
extern
int
ide_probe_for_pdc4030
(
void
);
(
void
)
ide_probe_for_pdc4030
();
extern
int
pdc4030_init
(
void
);
if
(
probe_pdc4030
)
(
void
)
pdc4030_init
();
}
#endif
/* CONFIG_BLK_DEV_PDC4030 */
#ifdef CONFIG_BLK_DEV_IDE_PMAC
...
...
@@ -2595,10 +2595,6 @@ int __init ide_init (void)
init_ide_data
();
#ifdef CONFIG_BLK_DEV_PDC4030
if
(
probe_pdc4030
)
init_pdc4030
();
#endif
#ifdef CONFIG_BLK_DEV_ALI14XX
if
(
probe_ali14xx
)
(
void
)
ali14xx_init
();
...
...
drivers/ide/legacy/pdc4030.c
View file @
324b683a
...
...
@@ -147,8 +147,6 @@ int pdc4030_identify(ide_drive_t *drive)
return
pdc4030_cmd
(
drive
,
PROMISE_IDENTIFY
);
}
int
enable_promise_support
;
/*
* setup_pdc4030()
* Completes the setup of a Promise DC4030 controller card, once found.
...
...
@@ -296,27 +294,24 @@ int __init detect_pdc4030(ide_hwif_t *hwif)
}
}
int
__init
ide_probe_for_pdc4030
(
void
)
int
__init
pdc4030_init
(
void
)
{
unsigned
int
index
;
ide_hwif_t
*
hwif
;
#ifndef MODULE
if
(
enable_promise_support
==
0
)
return
0
;
#endif
for
(
index
=
0
;
index
<
MAX_HWIFS
;
index
++
)
{
hwif
=
&
ide_hwifs
[
index
];
if
(
hwif
->
chipset
==
ide_unknown
&&
detect_pdc4030
(
hwif
))
return
setup_pdc4030
(
hwif
);
if
(
hwif
->
chipset
==
ide_unknown
&&
detect_pdc4030
(
hwif
))
{
if
(
!
setup_pdc4030
(
hwif
))
return
-
ENODEV
;
return
0
;
}
}
return
0
;
return
-
ENODEV
;
}
static
void
__exit
release_pdc4030
(
ide_hwif_t
*
hwif
,
ide_hwif_t
*
mate
)
#ifdef MODULE
static
void
__exit
pdc4030_release_hwif
(
ide_hwif_t
*
hwif
)
{
hwif
->
chipset
=
ide_unknown
;
hwif
->
selectproc
=
NULL
;
...
...
@@ -327,72 +322,24 @@ static void __exit release_pdc4030(ide_hwif_t *hwif, ide_hwif_t *mate)
hwif
->
drives
[
1
].
keep_settings
=
0
;
hwif
->
drives
[
0
].
noprobe
=
0
;
hwif
->
drives
[
1
].
noprobe
=
0
;
if
(
mate
!=
NULL
)
{
mate
->
chipset
=
ide_unknown
;
mate
->
selectproc
=
NULL
;
mate
->
serialized
=
0
;
mate
->
drives
[
0
].
io_32bit
=
0
;
mate
->
drives
[
1
].
io_32bit
=
0
;
mate
->
drives
[
0
].
keep_settings
=
0
;
mate
->
drives
[
1
].
keep_settings
=
0
;
mate
->
drives
[
0
].
noprobe
=
0
;
mate
->
drives
[
1
].
noprobe
=
0
;
}
}
#ifndef MODULE
/*
* init_pdc4030:
*
* called by ide.c when parsing command line
*/
void
__init
init_pdc4030
(
void
)
static
void
__exit
pdc4030_exit
(
void
)
{
enable_promise_support
=
1
;
unsigned
int
index
;
for
(
index
=
0
;
index
<
MAX_HWIFS
;
index
++
)
pdc4030_release_hwif
(
&
ide_hwifs
[
index
]);
}
#else
module_init
(
pdc4030_init
);
module_exit
(
pdc4030_exit
);
#endif
MODULE_AUTHOR
(
"Peter Denison"
);
MODULE_DESCRIPTION
(
"Support of Promise 4030 VLB series IDE chipsets"
);
MODULE_LICENSE
(
"GPL"
);
static
int
__init
pdc4030_mod_init
(
void
)
{
if
(
enable_promise_support
==
0
)
enable_promise_support
=
1
;
if
(
!
ide_probe_for_pdc4030
())
return
-
ENODEV
;
return
0
;
}
module_init
(
pdc4030_mod_init
);
static
void
__exit
pdc4030_mod_exit
(
void
)
{
unsigned
int
index
;
ide_hwif_t
*
hwif
;
if
(
enable_promise_support
==
0
)
return
;
for
(
index
=
0
;
index
<
MAX_HWIFS
;
index
++
)
{
hwif
=
&
ide_hwifs
[
index
];
if
(
hwif
->
chipset
==
ide_pdc4030
)
{
ide_hwif_t
*
mate
=
&
ide_hwifs
[
hwif
->
index
+
1
];
if
(
mate
->
chipset
==
ide_pdc4030
)
release_pdc4030
(
hwif
,
mate
);
else
release_pdc4030
(
hwif
,
NULL
);
}
}
enable_promise_support
=
0
;
}
module_exit
(
pdc4030_mod_exit
);
#endif
/*
* promise_read_intr() is the handler for disk read/multread interrupts
*/
...
...
drivers/ide/pci/amd74xx.c
View file @
324b683a
/*
* Version 2.
9
* Version 2.
11
*
* AMD 755/756/766/8111 and nVidia nForce IDE driver for Linux.
*
...
...
@@ -65,7 +65,6 @@ static struct amd_ide_chip {
};
static
struct
amd_ide_chip
*
amd_config
;
static
unsigned
char
amd_enabled
;
static
unsigned
int
amd_80w
;
static
unsigned
int
amd_clock
;
...
...
@@ -103,7 +102,7 @@ static int amd74xx_get_info(char *buffer, char **addr, off_t offset, int count)
amd_print
(
"----------AMD BusMastering IDE Configuration----------------"
);
amd_print
(
"Driver Version: 2.
9
"
);
amd_print
(
"Driver Version: 2.
11
"
);
amd_print
(
"South Bridge: %s"
,
pci_name
(
bmide_dev
));
pci_read_config_byte
(
dev
,
PCI_REVISION_ID
,
&
t
);
...
...
@@ -250,9 +249,6 @@ static int amd_set_drive(ide_drive_t *drive, u8 speed)
static
void
amd74xx_tune_drive
(
ide_drive_t
*
drive
,
u8
pio
)
{
if
(
!
((
amd_enabled
>>
HWIF
(
drive
)
->
channel
)
&
1
))
return
;
if
(
pio
==
255
)
{
amd_set_drive
(
drive
,
ide_find_best_mode
(
drive
,
XFER_PIO
|
XFER_EPIO
));
return
;
...
...
@@ -330,9 +326,6 @@ static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char
break
;
}
pci_read_config_dword
(
dev
,
AMD_IDE_ENABLE
,
&
u
);
amd_enabled
=
((
u
&
1
)
?
2
:
0
)
|
((
u
&
2
)
?
1
:
0
);
/*
* Take care of prefetch & postwrite.
*/
...
...
@@ -408,8 +401,8 @@ static void __init init_hwif_amd74xx(ide_hwif_t *hwif)
hwif
->
mwdma_mask
=
0x07
;
hwif
->
swdma_mask
=
0x07
;
if
(
!
(
hwif
->
udma_four
)
)
hwif
->
udma_four
=
((
amd_enabled
&
amd_80w
)
>>
hwif
->
channel
)
&
1
;
if
(
!
hwif
->
udma_four
)
hwif
->
udma_four
=
(
amd_80w
>>
hwif
->
channel
)
&
1
;
hwif
->
ide_dma_check
=
&
amd74xx_ide_dma_check
;
if
(
!
noautodma
)
hwif
->
autodma
=
1
;
...
...
@@ -417,16 +410,6 @@ static void __init init_hwif_amd74xx(ide_hwif_t *hwif)
hwif
->
drives
[
1
].
autodma
=
hwif
->
autodma
;
}
/*
* We allow the BM-DMA driver only work on enabled interfaces.
*/
static
void
__init
init_dma_amd74xx
(
ide_hwif_t
*
hwif
,
unsigned
long
dmabase
)
{
if
((
amd_enabled
>>
hwif
->
channel
)
&
1
)
ide_setup_dma
(
hwif
,
dmabase
,
8
);
}
extern
void
ide_setup_pci_device
(
struct
pci_dev
*
,
ide_pci_device_t
*
);
static
int
__devinit
amd74xx_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
...
...
drivers/ide/pci/amd74xx.h
View file @
324b683a
...
...
@@ -27,7 +27,6 @@ static ide_pci_host_proc_t amd74xx_procs[] __initdata = {
static
unsigned
int
init_chipset_amd74xx
(
struct
pci_dev
*
,
const
char
*
);
static
void
init_hwif_amd74xx
(
ide_hwif_t
*
);
static
void
init_dma_amd74xx
(
ide_hwif_t
*
,
unsigned
long
);
static
ide_pci_device_t
amd74xx_chipsets
[]
__devinitdata
=
{
{
/* 0 */
...
...
@@ -35,9 +34,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_AMD_COBRA_7401
,
.
name
=
"AMD7401"
,
.
init_chipset
=
init_chipset_amd74xx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_amd74xx
,
.
init_dma
=
init_dma_amd74xx
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
.
enablebits
=
{{
0x40
,
0x02
,
0x02
},
{
0x40
,
0x01
,
0x01
}},
...
...
@@ -48,9 +45,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_AMD_VIPER_7409
,
.
name
=
"AMD7409"
,
.
init_chipset
=
init_chipset_amd74xx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_amd74xx
,
.
init_dma
=
init_dma_amd74xx
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
.
enablebits
=
{{
0x40
,
0x02
,
0x02
},
{
0x40
,
0x01
,
0x01
}},
...
...
@@ -61,9 +56,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_AMD_VIPER_7411
,
.
name
=
"AMD7411"
,
.
init_chipset
=
init_chipset_amd74xx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_amd74xx
,
.
init_dma
=
init_dma_amd74xx
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
.
enablebits
=
{{
0x40
,
0x02
,
0x02
},
{
0x40
,
0x01
,
0x01
}},
...
...
@@ -74,9 +67,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_AMD_OPUS_7441
,
.
name
=
"AMD7441"
,
.
init_chipset
=
init_chipset_amd74xx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_amd74xx
,
.
init_dma
=
init_dma_amd74xx
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
.
enablebits
=
{{
0x40
,
0x02
,
0x02
},
{
0x40
,
0x01
,
0x01
}},
...
...
@@ -87,9 +78,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_AMD_8111_IDE
,
.
name
=
"AMD8111"
,
.
init_chipset
=
init_chipset_amd74xx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_amd74xx
,
.
init_dma
=
init_dma_amd74xx
,
.
autodma
=
AUTODMA
,
.
channels
=
2
,
.
enablebits
=
{{
0x40
,
0x02
,
0x02
},
{
0x40
,
0x01
,
0x01
}},
...
...
@@ -101,9 +90,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_NVIDIA_NFORCE_IDE
,
.
name
=
"NFORCE"
,
.
init_chipset
=
init_chipset_amd74xx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_amd74xx
,
.
init_dma
=
init_dma_amd74xx
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
.
enablebits
=
{{
0x50
,
0x02
,
0x02
},
{
0x50
,
0x01
,
0x01
}},
...
...
@@ -115,9 +102,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE
,
.
name
=
"NFORCE2"
,
.
init_chipset
=
init_chipset_amd74xx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_amd74xx
,
.
init_dma
=
init_dma_amd74xx
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
.
enablebits
=
{{
0x50
,
0x02
,
0x02
},
{
0x50
,
0x01
,
0x01
}},
...
...
drivers/ide/pci/via82cxxx.c
View file @
324b683a
/*
*
* Version 3.3
7
* Version 3.3
8
*
* VIA IDE driver for Linux. Supported southbridges:
*
...
...
@@ -96,7 +96,6 @@ static struct via_isa_bridge {
};
static
struct
via_isa_bridge
*
via_config
;
static
unsigned
char
via_enabled
;
static
unsigned
int
via_80w
;
static
unsigned
int
via_clock
;
static
char
*
via_dma
[]
=
{
"MWDMA16"
,
"UDMA33"
,
"UDMA66"
,
"UDMA100"
,
"UDMA133"
};
...
...
@@ -146,7 +145,7 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count)
via_print
(
"----------VIA BusMastering IDE Configuration"
"----------------"
);
via_print
(
"Driver Version: 3.3
7
"
);
via_print
(
"Driver Version: 3.3
8
"
);
via_print
(
"South Bridge: VIA %s"
,
via_config
->
name
);
...
...
@@ -370,9 +369,6 @@ static int via_set_drive(ide_drive_t *drive, u8 speed)
static
void
via82cxxx_tune_drive
(
ide_drive_t
*
drive
,
u8
pio
)
{
if
(
!
((
via_enabled
>>
HWIF
(
drive
)
->
channel
)
&
1
))
return
;
if
(
pio
==
255
)
{
via_set_drive
(
drive
,
ide_find_best_mode
(
drive
,
XFER_PIO
|
XFER_EPIO
));
...
...
@@ -506,7 +502,6 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha
*/
pci_read_config_byte
(
dev
,
VIA_IDE_ENABLE
,
&
v
);
via_enabled
=
((
v
&
1
)
?
2
:
0
)
|
((
v
&
2
)
?
1
:
0
);
/*
* Set up FIFO sizes and thresholds.
...
...
@@ -523,9 +518,9 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha
/* Fix FIFO split between channels */
if
(
via_config
->
flags
&
VIA_SET_FIFO
)
{
t
&=
(
t
&
0x9f
);
switch
(
v
ia_enabled
)
{
case
1
:
t
|=
0x00
;
break
;
/* 16 on primary */
case
2
:
t
|=
0x60
;
break
;
/* 16 on secondary */
switch
(
v
&
3
)
{
case
2
:
t
|=
0x00
;
break
;
/* 16 on primary */
case
1
:
t
|=
0x60
;
break
;
/* 16 on secondary */
case
3
:
t
|=
0x20
;
break
;
/* 8 pri 8 sec */
}
}
...
...
@@ -603,8 +598,8 @@ static void __init init_hwif_via82cxxx(ide_hwif_t *hwif)
hwif
->
mwdma_mask
=
0x07
;
hwif
->
swdma_mask
=
0x07
;
if
(
!
(
hwif
->
udma_four
)
)
hwif
->
udma_four
=
(
(
via_enabled
&
via_80w
)
>>
hwif
->
channel
)
&
1
;
if
(
!
hwif
->
udma_four
)
hwif
->
udma_four
=
(
via_80w
>>
hwif
->
channel
)
&
1
;
hwif
->
ide_dma_check
=
&
via82cxxx_ide_dma_check
;
if
(
!
noautodma
)
hwif
->
autodma
=
1
;
...
...
@@ -612,20 +607,6 @@ static void __init init_hwif_via82cxxx(ide_hwif_t *hwif)
hwif
->
drives
[
1
].
autodma
=
hwif
->
autodma
;
}
/**
* init_dma_via82cxxx - set up for IDE DMA
* @hwif: IDE interface
* @dmabase: DMA base address
*
* We allow the BM-DMA driver to only work on enabled interfaces.
*/
static
void
__init
init_dma_via82cxxx
(
ide_hwif_t
*
hwif
,
unsigned
long
dmabase
)
{
if
((
via_enabled
>>
hwif
->
channel
)
&
1
)
ide_setup_dma
(
hwif
,
dmabase
,
8
);
}
extern
void
ide_setup_pci_device
(
struct
pci_dev
*
,
ide_pci_device_t
*
);
static
int
__devinit
via_init_one
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
...
...
drivers/ide/pci/via82cxxx.h
View file @
324b683a
...
...
@@ -27,7 +27,6 @@ static ide_pci_host_proc_t via_procs[] __initdata = {
static
unsigned
int
init_chipset_via82cxxx
(
struct
pci_dev
*
,
const
char
*
);
static
void
init_hwif_via82cxxx
(
ide_hwif_t
*
);
static
void
init_dma_via82cxxx
(
ide_hwif_t
*
,
unsigned
long
);
static
ide_pci_device_t
via82cxxx_chipsets
[]
__devinitdata
=
{
{
/* 0 */
...
...
@@ -35,9 +34,7 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_VIA_82C576_1
,
.
name
=
"VP_IDE"
,
.
init_chipset
=
init_chipset_via82cxxx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_via82cxxx
,
.
init_dma
=
init_dma_via82cxxx
,
.
channels
=
2
,
.
autodma
=
NOAUTODMA
,
.
enablebits
=
{{
0x40
,
0x02
,
0x02
},
{
0x40
,
0x01
,
0x01
}},
...
...
@@ -48,9 +45,7 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
.
device
=
PCI_DEVICE_ID_VIA_82C586_1
,
.
name
=
"VP_IDE"
,
.
init_chipset
=
init_chipset_via82cxxx
,
.
init_iops
=
NULL
,
.
init_hwif
=
init_hwif_via82cxxx
,
.
init_dma
=
init_dma_via82cxxx
,
.
channels
=
2
,
.
autodma
=
NOAUTODMA
,
.
enablebits
=
{{
0x40
,
0x02
,
0x02
},
{
0x40
,
0x01
,
0x01
}},
...
...
drivers/usb/core/inode.c
View file @
324b683a
...
...
@@ -38,6 +38,7 @@
#include <linux/namei.h>
#include <linux/usbdevice_fs.h>
#include <linux/smp_lock.h>
#include <linux/parser.h>
#include <asm/byteorder.h>
static
struct
super_operations
usbfs_ops
;
...
...
@@ -62,86 +63,94 @@ static umode_t devmode = S_IWUSR | S_IRUGO;
static
umode_t
busmode
=
S_IXUGO
|
S_IRUGO
;
static
umode_t
listmode
=
S_IRUGO
;
enum
{
Opt_devuid
,
Opt_devgid
,
Opt_devmode
,
Opt_busuid
,
Opt_busgid
,
Opt_busmode
,
Opt_listuid
,
Opt_listgid
,
Opt_listmode
,
Opt_err
,
};
static
match_table_t
tokens
=
{
{
Opt_devuid
,
"devuid=%u"
},
{
Opt_devgid
,
"devgid=%u"
},
{
Opt_devmode
,
"devmode=%o"
},
{
Opt_busuid
,
"busuid=%u"
},
{
Opt_busgid
,
"busgid=%u"
},
{
Opt_busmode
,
"busmode=%o"
},
{
Opt_listuid
,
"listuid=%u"
},
{
Opt_listgid
,
"listgid=%u"
},
{
Opt_listmode
,
"listmode=%o"
},
{
Opt_err
,
NULL
}
};
static
int
parse_options
(
struct
super_block
*
s
,
char
*
data
)
{
char
*
curopt
=
NULL
,
*
value
;
char
*
p
;
int
option
;
while
((
curopt
=
strsep
(
&
data
,
","
))
!=
NULL
)
{
if
(
!*
curopt
)
while
((
p
=
strsep
(
&
data
,
","
))
!=
NULL
)
{
substring_t
args
[
MAX_OPT_ARGS
];
int
token
;
if
(
!*
p
)
continue
;
if
((
value
=
strchr
(
curopt
,
'='
))
!=
NULL
)
*
value
++
=
0
;
if
(
!
strcmp
(
curopt
,
"devuid"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
devuid
=
simple_strtoul
(
value
,
&
value
,
0
);
if
(
*
value
)
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"devgid"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
devgid
=
simple_strtoul
(
value
,
&
value
,
0
);
if
(
*
value
)
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"devmode"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
devmode
=
simple_strtoul
(
value
,
&
value
,
0
)
&
S_IRWXUGO
;
if
(
*
value
)
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"busuid"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
busuid
=
simple_strtoul
(
value
,
&
value
,
0
);
if
(
*
value
)
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"busgid"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
busgid
=
simple_strtoul
(
value
,
&
value
,
0
);
if
(
*
value
)
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"busmode"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
busmode
=
simple_strtoul
(
value
,
&
value
,
0
)
&
S_IRWXUGO
;
if
(
*
value
)
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"listuid"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
listuid
=
simple_strtoul
(
value
,
&
value
,
0
);
if
(
*
value
)
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"listgid"
))
{
if
(
!
value
||
!
value
[
0
])
return
-
EINVAL
;
listgid
=
simple_strtoul
(
value
,
&
value
,
0
);
if
(
*
value
)
token
=
match_token
(
p
,
tokens
,
args
);
switch
(
token
)
{
case
Opt_devuid
:
if
(
match_int
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
devuid
=
option
;
break
;
case
Opt_devgid
:
if
(
match_int
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
devgid
=
option
;
break
;
case
Opt_devmode
:
if
(
match_octal
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
}
if
(
!
strcmp
(
curopt
,
"listmode"
))
{
if
(
!
value
||
!
value
[
0
])
devmode
=
option
&
S_IRWXUGO
;
break
;
case
Opt_busuid
:
if
(
match_int
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
busuid
=
option
;
break
;
case
Opt_busgid
:
if
(
match_int
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
busgid
=
option
;
break
;
case
Opt_busmode
:
if
(
match_octal
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
listmode
=
simple_strtoul
(
value
,
&
value
,
0
)
&
S_IRWXUGO
;
if
(
*
value
)
busmode
=
option
&
S_IRWXUGO
;
break
;
case
Opt_listuid
:
if
(
match_int
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
listuid
=
option
;
break
;
case
Opt_listgid
:
if
(
match_int
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
listgid
=
option
;
break
;
case
Opt_listmode
:
if
(
match_octal
(
&
args
[
0
],
&
option
))
return
-
EINVAL
;
listmode
=
option
&
S_IRWXUGO
;
break
;
default:
err
(
"usbfs: unrecognised mount option
\"
%s
\"
"
"or missing value
\n
"
,
p
);
return
-
EINVAL
;
}
}
return
0
;
}
/* --------------------------------------------------------------------- */
static
struct
inode
*
usbfs_get_inode
(
struct
super_block
*
sb
,
int
mode
,
dev_t
dev
)
{
struct
inode
*
inode
=
new_inode
(
sb
);
...
...
drivers/usb/host/uhci-debug.c
View file @
324b683a
...
...
@@ -99,82 +99,6 @@ static int uhci_show_td(struct uhci_td *td, char *buf, int len, int space)
return
out
-
buf
;
}
static
int
uhci_show_sc
(
int
port
,
unsigned
short
status
,
char
*
buf
,
int
len
)
{
char
*
out
=
buf
;
/* Try to make sure there's enough memory */
if
(
len
<
80
)
return
0
;
out
+=
sprintf
(
out
,
" stat%d = %04x %s%s%s%s%s%s%s%s
\n
"
,
port
,
status
,
(
status
&
USBPORTSC_SUSP
)
?
"PortSuspend "
:
""
,
(
status
&
USBPORTSC_PR
)
?
"PortReset "
:
""
,
(
status
&
USBPORTSC_LSDA
)
?
"LowSpeed "
:
""
,
(
status
&
USBPORTSC_RD
)
?
"ResumeDetect "
:
""
,
(
status
&
USBPORTSC_PEC
)
?
"EnableChange "
:
""
,
(
status
&
USBPORTSC_PE
)
?
"PortEnabled "
:
""
,
(
status
&
USBPORTSC_CSC
)
?
"ConnectChange "
:
""
,
(
status
&
USBPORTSC_CCS
)
?
"PortConnected "
:
""
);
return
out
-
buf
;
}
static
int
uhci_show_status
(
struct
uhci_hcd
*
uhci
,
char
*
buf
,
int
len
)
{
char
*
out
=
buf
;
unsigned
int
io_addr
=
uhci
->
io_addr
;
unsigned
short
usbcmd
,
usbstat
,
usbint
,
usbfrnum
;
unsigned
int
flbaseadd
;
unsigned
char
sof
;
unsigned
short
portsc1
,
portsc2
;
/* Try to make sure there's enough memory */
if
(
len
<
80
*
6
)
return
0
;
usbcmd
=
inw
(
io_addr
+
0
);
usbstat
=
inw
(
io_addr
+
2
);
usbint
=
inw
(
io_addr
+
4
);
usbfrnum
=
inw
(
io_addr
+
6
);
flbaseadd
=
inl
(
io_addr
+
8
);
sof
=
inb
(
io_addr
+
12
);
portsc1
=
inw
(
io_addr
+
16
);
portsc2
=
inw
(
io_addr
+
18
);
out
+=
sprintf
(
out
,
" usbcmd = %04x %s%s%s%s%s%s%s%s
\n
"
,
usbcmd
,
(
usbcmd
&
USBCMD_MAXP
)
?
"Maxp64 "
:
"Maxp32 "
,
(
usbcmd
&
USBCMD_CF
)
?
"CF "
:
""
,
(
usbcmd
&
USBCMD_SWDBG
)
?
"SWDBG "
:
""
,
(
usbcmd
&
USBCMD_FGR
)
?
"FGR "
:
""
,
(
usbcmd
&
USBCMD_EGSM
)
?
"EGSM "
:
""
,
(
usbcmd
&
USBCMD_GRESET
)
?
"GRESET "
:
""
,
(
usbcmd
&
USBCMD_HCRESET
)
?
"HCRESET "
:
""
,
(
usbcmd
&
USBCMD_RS
)
?
"RS "
:
""
);
out
+=
sprintf
(
out
,
" usbstat = %04x %s%s%s%s%s%s
\n
"
,
usbstat
,
(
usbstat
&
USBSTS_HCH
)
?
"HCHalted "
:
""
,
(
usbstat
&
USBSTS_HCPE
)
?
"HostControllerProcessError "
:
""
,
(
usbstat
&
USBSTS_HSE
)
?
"HostSystemError "
:
""
,
(
usbstat
&
USBSTS_RD
)
?
"ResumeDetect "
:
""
,
(
usbstat
&
USBSTS_ERROR
)
?
"USBError "
:
""
,
(
usbstat
&
USBSTS_USBINT
)
?
"USBINT "
:
""
);
out
+=
sprintf
(
out
,
" usbint = %04x
\n
"
,
usbint
);
out
+=
sprintf
(
out
,
" usbfrnum = (%d)%03x
\n
"
,
(
usbfrnum
>>
10
)
&
1
,
0xfff
&
(
4
*
(
unsigned
int
)
usbfrnum
));
out
+=
sprintf
(
out
,
" flbaseadd = %08x
\n
"
,
flbaseadd
);
out
+=
sprintf
(
out
,
" sof = %02x
\n
"
,
sof
);
out
+=
uhci_show_sc
(
1
,
portsc1
,
out
,
len
-
(
out
-
buf
));
out
+=
uhci_show_sc
(
2
,
portsc2
,
out
,
len
-
(
out
-
buf
));
return
out
-
buf
;
}
static
int
uhci_show_qh
(
struct
uhci_qh
*
qh
,
char
*
buf
,
int
len
,
int
space
)
{
char
*
out
=
buf
;
...
...
@@ -274,6 +198,13 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space)
return
out
-
buf
;
}
#define show_frame_num() \
if (!shown) { \
shown = 1; \
out += sprintf(out, "- Frame %d\n", i); \
}
#ifdef CONFIG_PROC_FS
static
const
char
*
qh_names
[]
=
{
"skel_int128_qh"
,
"skel_int64_qh"
,
"skel_int32_qh"
,
"skel_int16_qh"
,
...
...
@@ -283,18 +214,88 @@ static const char *qh_names[] = {
"skel_bulk_qh"
,
"skel_term_qh"
};
#define show_frame_num() \
if (!shown) { \
shown = 1; \
out += sprintf(out, "- Frame %d\n", i); \
}
#define show_qh_name() \
if (!shown) { \
shown = 1; \
out += sprintf(out, "- %s\n", qh_names[i]); \
}
static
int
uhci_show_sc
(
int
port
,
unsigned
short
status
,
char
*
buf
,
int
len
)
{
char
*
out
=
buf
;
/* Try to make sure there's enough memory */
if
(
len
<
80
)
return
0
;
out
+=
sprintf
(
out
,
" stat%d = %04x %s%s%s%s%s%s%s%s
\n
"
,
port
,
status
,
(
status
&
USBPORTSC_SUSP
)
?
"PortSuspend "
:
""
,
(
status
&
USBPORTSC_PR
)
?
"PortReset "
:
""
,
(
status
&
USBPORTSC_LSDA
)
?
"LowSpeed "
:
""
,
(
status
&
USBPORTSC_RD
)
?
"ResumeDetect "
:
""
,
(
status
&
USBPORTSC_PEC
)
?
"EnableChange "
:
""
,
(
status
&
USBPORTSC_PE
)
?
"PortEnabled "
:
""
,
(
status
&
USBPORTSC_CSC
)
?
"ConnectChange "
:
""
,
(
status
&
USBPORTSC_CCS
)
?
"PortConnected "
:
""
);
return
out
-
buf
;
}
static
int
uhci_show_status
(
struct
uhci_hcd
*
uhci
,
char
*
buf
,
int
len
)
{
char
*
out
=
buf
;
unsigned
int
io_addr
=
uhci
->
io_addr
;
unsigned
short
usbcmd
,
usbstat
,
usbint
,
usbfrnum
;
unsigned
int
flbaseadd
;
unsigned
char
sof
;
unsigned
short
portsc1
,
portsc2
;
/* Try to make sure there's enough memory */
if
(
len
<
80
*
6
)
return
0
;
usbcmd
=
inw
(
io_addr
+
0
);
usbstat
=
inw
(
io_addr
+
2
);
usbint
=
inw
(
io_addr
+
4
);
usbfrnum
=
inw
(
io_addr
+
6
);
flbaseadd
=
inl
(
io_addr
+
8
);
sof
=
inb
(
io_addr
+
12
);
portsc1
=
inw
(
io_addr
+
16
);
portsc2
=
inw
(
io_addr
+
18
);
out
+=
sprintf
(
out
,
" usbcmd = %04x %s%s%s%s%s%s%s%s
\n
"
,
usbcmd
,
(
usbcmd
&
USBCMD_MAXP
)
?
"Maxp64 "
:
"Maxp32 "
,
(
usbcmd
&
USBCMD_CF
)
?
"CF "
:
""
,
(
usbcmd
&
USBCMD_SWDBG
)
?
"SWDBG "
:
""
,
(
usbcmd
&
USBCMD_FGR
)
?
"FGR "
:
""
,
(
usbcmd
&
USBCMD_EGSM
)
?
"EGSM "
:
""
,
(
usbcmd
&
USBCMD_GRESET
)
?
"GRESET "
:
""
,
(
usbcmd
&
USBCMD_HCRESET
)
?
"HCRESET "
:
""
,
(
usbcmd
&
USBCMD_RS
)
?
"RS "
:
""
);
out
+=
sprintf
(
out
,
" usbstat = %04x %s%s%s%s%s%s
\n
"
,
usbstat
,
(
usbstat
&
USBSTS_HCH
)
?
"HCHalted "
:
""
,
(
usbstat
&
USBSTS_HCPE
)
?
"HostControllerProcessError "
:
""
,
(
usbstat
&
USBSTS_HSE
)
?
"HostSystemError "
:
""
,
(
usbstat
&
USBSTS_RD
)
?
"ResumeDetect "
:
""
,
(
usbstat
&
USBSTS_ERROR
)
?
"USBError "
:
""
,
(
usbstat
&
USBSTS_USBINT
)
?
"USBINT "
:
""
);
out
+=
sprintf
(
out
,
" usbint = %04x
\n
"
,
usbint
);
out
+=
sprintf
(
out
,
" usbfrnum = (%d)%03x
\n
"
,
(
usbfrnum
>>
10
)
&
1
,
0xfff
&
(
4
*
(
unsigned
int
)
usbfrnum
));
out
+=
sprintf
(
out
,
" flbaseadd = %08x
\n
"
,
flbaseadd
);
out
+=
sprintf
(
out
,
" sof = %02x
\n
"
,
sof
);
out
+=
uhci_show_sc
(
1
,
portsc1
,
out
,
len
-
(
out
-
buf
));
out
+=
uhci_show_sc
(
2
,
portsc2
,
out
,
len
-
(
out
-
buf
));
return
out
-
buf
;
}
static
int
uhci_show_urbp
(
struct
uhci_hcd
*
uhci
,
struct
urb_priv
*
urbp
,
char
*
buf
,
int
len
)
{
struct
list_head
*
tmp
;
...
...
@@ -512,7 +513,6 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
return
out
-
buf
;
}
#ifdef CONFIG_PROC_FS
#define MAX_OUTPUT (64 * 1024)
static
struct
proc_dir_entry
*
uhci_proc_root
=
NULL
;
...
...
drivers/usb/host/uhci-hcd.c
View file @
324b683a
...
...
@@ -2185,8 +2185,8 @@ static int uhci_reset(struct usb_hcd *hcd)
/* Maybe kick BIOS off this hardware. Then reset, so we won't get
* interrupts from any previous setup.
*/
pci_write_config_word
(
hcd
->
pdev
,
USBLEGSUP
,
USBLEGSUP_DEFAULT
);
reset_hc
(
uhci
);
pci_write_config_word
(
hcd
->
pdev
,
USBLEGSUP
,
USBLEGSUP_DEFAULT
);
return
0
;
}
...
...
drivers/usb/input/Kconfig
View file @
324b683a
...
...
@@ -186,8 +186,5 @@ config USB_XPAD
For information about how to connect the X-Box pad to USB, see
Documentation/input/xpad.txt.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called xpad. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
To compile this driver as a module, choose M here: the
module will be called xpad.
drivers/usb/misc/brlvger.c
View file @
324b683a
...
...
@@ -591,14 +591,14 @@ brlvger_write(struct file *file, const char __user *buffer,
int
firstpart
=
6
-
off
;
#ifdef WRITE_DEBUG
dbg3
(
"off: %d, rs: %d, count: %d, firstpart: %d"
,
dbg3
(
"off: %
ll
d, rs: %d, count: %d, firstpart: %d"
,
off
,
rs
,
count
,
firstpart
);
#endif
firstpart
=
(
firstpart
<
count
)
?
firstpart
:
count
;
#ifdef WRITE_DEBUG
dbg3
(
"off: %d"
,
off
);
dbg3
(
"off: %
ll
d"
,
off
);
dbg3
(
"firstpart: %d"
,
firstpart
);
#endif
...
...
@@ -618,7 +618,7 @@ brlvger_write(struct file *file, const char __user *buffer,
off
+=
2
;
#ifdef WRITE_DEBUG
dbg3
(
"off: %d, rs: %d, count: %d, firstpart: %d, "
dbg3
(
"off: %
ll
d, rs: %d, count: %d, firstpart: %d, "
"written: %d"
,
off
,
rs
,
count
,
firstpart
,
written
);
#endif
}
...
...
drivers/usb/misc/speedtch.c
View file @
324b683a
...
...
@@ -189,8 +189,7 @@ struct udsl_vcc_data {
struct
atm_vcc
*
vcc
;
/* raw cell reassembly */
struct
sk_buff
*
skb
;
unsigned
int
max_pdu
;
struct
sk_buff
*
sarb
;
};
/* send */
...
...
@@ -314,12 +313,10 @@ static void udsl_extract_cells (struct udsl_instance_data *instance, unsigned ch
{
struct
udsl_vcc_data
*
cached_vcc
=
NULL
;
struct
atm_vcc
*
vcc
;
struct
sk_buff
*
s
k
b
;
struct
sk_buff
*
s
ar
b
;
struct
udsl_vcc_data
*
vcc_data
;
int
cached_vci
=
0
;
unsigned
int
i
;
unsigned
int
length
;
unsigned
int
pdu_length
;
int
pti
;
int
vci
;
short
cached_vpi
=
0
;
...
...
@@ -344,74 +341,73 @@ static void udsl_extract_cells (struct udsl_instance_data *instance, unsigned ch
}
vcc
=
vcc_data
->
vcc
;
sarb
=
vcc_data
->
sarb
;
if
(
!
vcc_data
->
skb
&&
!
(
vcc_data
->
skb
=
dev_alloc_skb
(
vcc_data
->
max_pdu
)))
{
dbg
(
"udsl_extract_cells: no memory for skb (vcc: 0x%p)!"
,
vcc
);
if
(
pti
)
atomic_inc
(
&
vcc
->
stats
->
rx_err
);
continue
;
}
skb
=
vcc_data
->
skb
;
if
(
skb
->
len
+
ATM_CELL_PAYLOAD
>
vcc_data
->
max_pdu
)
{
dbg
(
"udsl_extract_cells: buffer overrun (max_pdu: %u, skb->len %u, vcc: 0x%p)"
,
vcc_data
->
max_pdu
,
skb
->
len
,
vcc
);
if
(
sarb
->
tail
+
ATM_CELL_PAYLOAD
>
sarb
->
end
)
{
dbg
(
"udsl_extract_cells: buffer overrun (sarb->len %u, vcc: 0x%p)!"
,
sarb
->
len
,
vcc
);
/* discard cells already received */
skb_trim
(
skb
,
0
);
DEBUG_ON
(
vcc_data
->
max_pdu
<
ATM_CELL_PAYLOAD
);
skb_trim
(
sarb
,
0
);
}
memcpy
(
s
k
b
->
tail
,
source
+
ATM_CELL_HEADER
,
ATM_CELL_PAYLOAD
);
__skb_put
(
s
k
b
,
ATM_CELL_PAYLOAD
);
memcpy
(
s
ar
b
->
tail
,
source
+
ATM_CELL_HEADER
,
ATM_CELL_PAYLOAD
);
__skb_put
(
s
ar
b
,
ATM_CELL_PAYLOAD
);
if
(
pti
)
{
struct
sk_buff
*
skb
;
unsigned
int
length
;
unsigned
int
pdu_length
;
length
=
(
source
[
ATM_CELL_SIZE
-
6
]
<<
8
)
+
source
[
ATM_CELL_SIZE
-
5
];
/* guard against overflow */
if
(
length
>
ATM_MAX_AAL5_PDU
)
{
dbg
(
"udsl_extract_cells: bogus length %u (vcc: 0x%p)"
,
length
,
vcc
);
goto
drop
;
dbg
(
"udsl_extract_cells: bogus length %u (vcc: 0x%p)!"
,
length
,
vcc
);
atomic_inc
(
&
vcc
->
stats
->
rx_err
);
goto
out
;
}
pdu_length
=
UDSL_NUM_CELLS
(
length
)
*
ATM_CELL_PAYLOAD
;
if
(
skb
->
len
<
pdu_length
)
{
dbg
(
"udsl_extract_cells: bogus pdu_length %u (skb->len: %u, vcc: 0x%p)"
,
pdu_length
,
skb
->
len
,
vcc
);
goto
drop
;
if
(
sarb
->
len
<
pdu_length
)
{
dbg
(
"udsl_extract_cells: bogus pdu_length %u (sarb->len: %u, vcc: 0x%p)!"
,
pdu_length
,
sarb
->
len
,
vcc
);
atomic_inc
(
&
vcc
->
stats
->
rx_err
);
goto
out
;
}
if
(
crc32_be
(
~
0
,
skb
->
tail
-
pdu_length
,
pdu_length
)
!=
0xc704dd7b
)
{
dbg
(
"udsl_extract_cells: packet failed crc check (vcc: 0x%p)"
,
vcc
);
goto
drop
;
if
(
crc32_be
(
~
0
,
sarb
->
tail
-
pdu_length
,
pdu_length
)
!=
0xc704dd7b
)
{
dbg
(
"udsl_extract_cells: packet failed crc check (vcc: 0x%p)!"
,
vcc
);
atomic_inc
(
&
vcc
->
stats
->
rx_err
);
goto
out
;
}
if
(
!
atm_charge
(
vcc
,
skb
->
truesize
))
{
dbg
(
"udsl_extract_cells: failed atm_charge (skb->truesize: %u)"
,
skb
->
truesize
);
goto
drop_no_stats
;
/* atm_charge increments rx_drop */
}
vdbg
(
"udsl_extract_cells: got packet (length: %u, pdu_length: %u, vcc: 0x%p)"
,
length
,
pdu_length
,
vcc
);
/* now that we are sure to send the skb, it is ok to change skb->data */
if
(
skb
->
len
>
pdu_length
)
skb_pull
(
skb
,
skb
->
len
-
pdu_length
);
/* discard initial junk */
if
(
!
(
skb
=
dev_alloc_skb
(
length
)))
{
dbg
(
"udsl_extract_cells: no memory for skb (length: %u)!"
,
length
);
atomic_inc
(
&
vcc
->
stats
->
rx_drop
);
goto
out
;
}
skb_trim
(
skb
,
length
);
/* drop zero padding and trailer */
vdbg
(
"udsl_extract_cells: allocated new sk_buff (skb: 0x%p, skb->truesize: %u)"
,
skb
,
skb
->
truesize
);
atomic_inc
(
&
vcc
->
stats
->
rx
);
if
(
!
atm_charge
(
vcc
,
skb
->
truesize
))
{
dbg
(
"udsl_extract_cells: failed atm_charge (skb->truesize: %u)!"
,
skb
->
truesize
);
dev_kfree_skb
(
skb
);
goto
out
;
/* atm_charge increments rx_drop */
}
PACKETDEBUG
(
skb
->
data
,
skb
->
len
);
memcpy
(
skb
->
data
,
sarb
->
tail
-
pdu_length
,
length
);
__skb_put
(
skb
,
length
);
vdbg
(
"udsl_extract_cells: sending skb 0x%p, skb->len %u, skb->truesize %u"
,
skb
,
skb
->
len
,
skb
->
truesize
);
vcc
->
push
(
vcc
,
skb
);
vcc_data
->
skb
=
NULL
;
PACKETDEBUG
(
skb
->
data
,
skb
->
len
);
continue
;
vcc
->
push
(
vcc
,
skb
)
;
drop:
atomic_inc
(
&
vcc
->
stats
->
rx_err
);
drop_no_stats:
skb_trim
(
skb
,
0
);
atomic_inc
(
&
vcc
->
stats
->
rx
);
out:
skb_trim
(
sarb
,
0
);
}
}
}
...
...
@@ -871,6 +867,7 @@ static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
{
struct
udsl_instance_data
*
instance
=
vcc
->
dev
->
dev_data
;
struct
udsl_vcc_data
*
new
;
unsigned
int
max_pdu
;
dbg
(
"udsl_atm_open: vpi %hd, vci %d"
,
vpi
,
vci
);
...
...
@@ -883,8 +880,10 @@ static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
return
-
EINVAL
;
/* only support AAL5 */
if
((
vcc
->
qos
.
aal
!=
ATM_AAL5
)
||
(
vcc
->
qos
.
rxtp
.
max_sdu
<
0
)
||
(
vcc
->
qos
.
rxtp
.
max_sdu
>
ATM_MAX_AAL5_PDU
))
if
((
vcc
->
qos
.
aal
!=
ATM_AAL5
)
||
(
vcc
->
qos
.
rxtp
.
max_sdu
<
0
)
||
(
vcc
->
qos
.
rxtp
.
max_sdu
>
ATM_MAX_AAL5_PDU
))
{
dbg
(
"udsl_atm_open: unsupported ATM type %d!"
,
vcc
->
qos
.
aal
);
return
-
EINVAL
;
}
if
(
!
instance
->
firmware_loaded
)
{
dbg
(
"udsl_atm_open: firmware not loaded!"
);
...
...
@@ -894,11 +893,13 @@ static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
down
(
&
instance
->
serialize
);
/* vs self, udsl_atm_close */
if
(
udsl_find_vcc
(
instance
,
vpi
,
vci
))
{
dbg
(
"udsl_atm_open: %hd/%d already in use!"
,
vpi
,
vci
);
up
(
&
instance
->
serialize
);
return
-
EADDRINUSE
;
}
if
(
!
(
new
=
kmalloc
(
sizeof
(
struct
udsl_vcc_data
),
GFP_KERNEL
)))
{
dbg
(
"udsl_atm_open: no memory for vcc_data!"
);
up
(
&
instance
->
serialize
);
return
-
ENOMEM
;
}
...
...
@@ -907,7 +908,15 @@ static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
new
->
vcc
=
vcc
;
new
->
vpi
=
vpi
;
new
->
vci
=
vci
;
new
->
max_pdu
=
max
(
1
,
UDSL_NUM_CELLS
(
vcc
->
qos
.
rxtp
.
max_sdu
))
*
ATM_CELL_PAYLOAD
;
/* udsl_extract_cells requires at least one cell */
max_pdu
=
max
(
1
,
UDSL_NUM_CELLS
(
vcc
->
qos
.
rxtp
.
max_sdu
))
*
ATM_CELL_PAYLOAD
;
if
(
!
(
new
->
sarb
=
alloc_skb
(
max_pdu
,
GFP_KERNEL
)))
{
dbg
(
"udsl_atm_open: no memory for SAR buffer!"
);
kfree
(
new
);
up
(
&
instance
->
serialize
);
return
-
ENOMEM
;
}
vcc
->
dev_data
=
new
;
vcc
->
vpi
=
vpi
;
...
...
@@ -925,7 +934,7 @@ static int udsl_atm_open (struct atm_vcc *vcc, short vpi, int vci)
tasklet_schedule
(
&
instance
->
receive_tasklet
);
dbg
(
"udsl_atm_open: allocated vcc data 0x%p (max_pdu: %u)"
,
new
,
new
->
max_pdu
);
dbg
(
"udsl_atm_open: allocated vcc data 0x%p (max_pdu: %u)"
,
new
,
max_pdu
);
return
0
;
}
...
...
@@ -952,9 +961,8 @@ static void udsl_atm_close (struct atm_vcc *vcc)
list_del
(
&
vcc_data
->
list
);
tasklet_enable
(
&
instance
->
receive_tasklet
);
if
(
vcc_data
->
skb
)
dev_kfree_skb
(
vcc_data
->
skb
);
vcc_data
->
skb
=
NULL
;
kfree_skb
(
vcc_data
->
sarb
);
vcc_data
->
sarb
=
NULL
;
kfree
(
vcc_data
);
vcc
->
dev_data
=
NULL
;
...
...
@@ -1216,7 +1224,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
for
(
i
=
0
;
i
<
num_rcv_urbs
;
i
++
)
if
((
result
=
usb_unlink_urb
(
instance
->
receivers
[
i
].
urb
))
<
0
)
dbg
(
"udsl_usb_disconnect: usb_unlink_urb on receive urb %d returned %d"
,
i
,
result
);
dbg
(
"udsl_usb_disconnect: usb_unlink_urb on receive urb %d returned %d
!
"
,
i
,
result
);
/* wait for completion handlers to finish */
do
{
...
...
@@ -1252,7 +1260,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
for
(
i
=
0
;
i
<
num_snd_urbs
;
i
++
)
if
((
result
=
usb_unlink_urb
(
instance
->
senders
[
i
].
urb
))
<
0
)
dbg
(
"udsl_usb_disconnect: usb_unlink_urb on send urb %d returned %d"
,
i
,
result
);
dbg
(
"udsl_usb_disconnect: usb_unlink_urb on send urb %d returned %d
!
"
,
i
,
result
);
/* wait for completion handlers to finish */
do
{
...
...
@@ -1298,11 +1306,9 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
static
int
__init
udsl_usb_init
(
void
)
{
struct
sk_buff
*
skb
;
/* dummy for sizeof */
dbg
(
"udsl_usb_init: driver version "
DRIVER_VERSION
);
if
(
sizeof
(
struct
udsl_control
)
>
sizeof
(
skb
->
cb
))
{
if
(
sizeof
(
struct
udsl_control
)
>
sizeof
(
((
struct
sk_buff
*
)
0
)
->
cb
))
{
printk
(
KERN_ERR
__FILE__
": unusable with this kernel!
\n
"
);
return
-
EIO
;
}
...
...
drivers/usb/serial/keyspan.c
View file @
324b683a
...
...
@@ -28,6 +28,9 @@
Change History
2003sep04 LPM (Keyspan) add support for new single port product USA19HS.
Improve setup message handling for all devices.
Wed Feb 19 22:00:00 PST 2003 (Jeffrey S. Laing <keyspan@jsl.com>)
Merged the current (1/31/03) Keyspan code with the current (2.4.21-pre4)
Linux source tree. The Linux tree lacked support for the 49WLC and
...
...
@@ -172,6 +175,7 @@ struct keyspan_port_private {
int
baud
;
int
old_baud
;
unsigned
int
cflag
;
unsigned
int
old_cflag
;
enum
{
flow_none
,
flow_cts
,
flow_xon
}
flow_control
;
int
rts_state
;
/* Handshaking pins (outputs) */
int
dtr_state
;
...
...
@@ -187,11 +191,12 @@ struct keyspan_port_private {
/* Include Keyspan message headers. All current Keyspan Adapters
make use of one of
three
message formats which are referred
to as USA-26, USA-28 and USA-49 by Keyspan and within this driver. */
make use of one of
four
message formats which are referred
to as USA-26, USA-28 and USA-49
, USA-90
by Keyspan and within this driver. */
#include "keyspan_usa26msg.h"
#include "keyspan_usa28msg.h"
#include "keyspan_usa49msg.h"
#include "keyspan_usa90msg.h"
/* Functions used by new usb-serial code. */
...
...
@@ -346,8 +351,8 @@ static int keyspan_ioctl(struct usb_serial_port *port, struct file *file,
return
-
ENOIOCTLCMD
;
}
/* Write function is
generic for the three
protocols used
with only a minor change for usa
49
required */
/* Write function is
similar for the four
protocols used
with only a minor change for usa
90 (usa19hs)
required */
static
int
keyspan_write
(
struct
usb_serial_port
*
port
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
)
{
...
...
@@ -356,18 +361,26 @@ static int keyspan_write(struct usb_serial_port *port, int from_user,
int
flip
;
int
left
,
todo
;
struct
urb
*
this_urb
;
int
err
;
int
err
,
maxDataLen
,
dataOffset
;
p_priv
=
usb_get_serial_port_data
(
port
);
d_details
=
p_priv
->
device_details
;
if
(
d_details
->
msg_format
==
msg_usa90
)
{
maxDataLen
=
64
;
dataOffset
=
0
;
}
else
{
maxDataLen
=
63
;
dataOffset
=
1
;
}
dbg
(
"%s - for port %d (%d chars), flip=%d"
,
__FUNCTION__
,
port
->
number
,
count
,
p_priv
->
out_flip
);
for
(
left
=
count
;
left
>
0
;
left
-=
todo
)
{
todo
=
left
;
if
(
todo
>
63
)
todo
=
63
;
if
(
todo
>
maxDataLen
)
todo
=
maxDataLen
;
flip
=
p_priv
->
out_flip
;
...
...
@@ -390,20 +403,20 @@ static int keyspan_write(struct usb_serial_port *port, int from_user,
break
;
}
/* First byte in buffer is "last flag" - unused so
/* First byte in buffer is "last flag"
(except for usa19hx)
- unused so
for now so set to zero */
((
char
*
)
this_urb
->
transfer_buffer
)[
0
]
=
0
;
if
(
from_user
)
{
if
(
copy_from_user
(
this_urb
->
transfer_buffer
+
1
,
buf
,
todo
))
if
(
copy_from_user
(
this_urb
->
transfer_buffer
+
dataOffset
,
buf
,
todo
))
return
-
EFAULT
;
}
else
{
memcpy
(
this_urb
->
transfer_buffer
+
1
,
buf
,
todo
);
memcpy
(
this_urb
->
transfer_buffer
+
dataOffset
,
buf
,
todo
);
}
buf
+=
todo
;
/* send the data out the bulk port */
this_urb
->
transfer_buffer_length
=
todo
+
1
;
this_urb
->
transfer_buffer_length
=
todo
+
dataOffset
;
this_urb
->
transfer_flags
&=
~
URB_ASYNC_UNLINK
;
this_urb
->
dev
=
port
->
serial
->
dev
;
...
...
@@ -443,9 +456,12 @@ static void usa26_indat_callback(struct urb *urb, struct pt_regs *regs)
if
(
urb
->
actual_length
)
{
/* 0x80 bit is error flag */
if
((
data
[
0
]
&
0x80
)
==
0
)
{
/* no error on any byte */
/* no errors on individual bytes, only possible overrun err*/
if
(
data
[
0
]
&
RXERROR_OVERRUN
)
err
=
TTY_OVERRUN
;
else
err
=
0
;
for
(
i
=
1
;
i
<
urb
->
actual_length
;
++
i
)
{
tty_insert_flip_char
(
tty
,
data
[
i
],
0
);
tty_insert_flip_char
(
tty
,
data
[
i
],
err
);
}
}
else
{
/* some bytes had errors, every byte has status */
...
...
@@ -474,7 +490,7 @@ static void usa26_indat_callback(struct urb *urb, struct pt_regs *regs)
return
;
}
/* Outdat handling is common for usa26, usa28 and usa49 messag
es */
/* Outdat handling is common for all devic
es */
static
void
usa2x_outdat_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
{
struct
usb_serial_port
*
port
;
...
...
@@ -577,7 +593,7 @@ static void usa26_glocont_callback(struct urb *urb, struct pt_regs *regs)
}
static
void
usa28_indat_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
static
void
usa28_indat_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
{
int
i
,
err
;
struct
usb_serial_port
*
port
;
...
...
@@ -861,29 +877,172 @@ static void usa49_outcont_callback(struct urb *urb, struct pt_regs *regs)
dbg
(
"%s"
,
__FUNCTION__
);
}
static
void
usa90_indat_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
{
int
i
,
err
;
int
endpoint
;
struct
usb_serial_port
*
port
;
struct
keyspan_port_private
*
p_priv
;
struct
tty_struct
*
tty
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
dbg
(
"%s"
,
__FUNCTION__
);
endpoint
=
usb_pipeendpoint
(
urb
->
pipe
);
if
(
urb
->
status
)
{
dbg
(
"%s - nonzero status: %x on endpoint %d."
,
__FUNCTION__
,
urb
->
status
,
endpoint
);
return
;
}
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
p_priv
=
usb_get_serial_port_data
(
port
);
tty
=
port
->
tty
;
if
(
urb
->
actual_length
)
{
/* if current mode is DMA, looks like usa28 format
otherwise looks like usa26 data format */
if
(
p_priv
->
baud
>
57600
)
{
for
(
i
=
0
;
i
<
urb
->
actual_length
;
++
i
)
tty_insert_flip_char
(
tty
,
data
[
i
],
0
);
}
else
{
/* 0x80 bit is error flag */
if
((
data
[
0
]
&
0x80
)
==
0
)
{
/* no errors on individual bytes, only possible overrun err*/
if
(
data
[
0
]
&
RXERROR_OVERRUN
)
err
=
TTY_OVERRUN
;
else
err
=
0
;
for
(
i
=
1
;
i
<
urb
->
actual_length
;
++
i
)
tty_insert_flip_char
(
tty
,
data
[
i
],
err
);
}
else
{
/* some bytes had errors, every byte has status */
dbg
(
"%s - RX error!!!!"
,
__FUNCTION__
);
for
(
i
=
0
;
i
+
1
<
urb
->
actual_length
;
i
+=
2
)
{
int
stat
=
data
[
i
],
flag
=
0
;
if
(
stat
&
RXERROR_OVERRUN
)
flag
|=
TTY_OVERRUN
;
if
(
stat
&
RXERROR_FRAMING
)
flag
|=
TTY_FRAME
;
if
(
stat
&
RXERROR_PARITY
)
flag
|=
TTY_PARITY
;
/* XXX should handle break (0x10) */
tty_insert_flip_char
(
tty
,
data
[
i
+
1
],
flag
);
}
}
}
tty_flip_buffer_push
(
tty
);
}
/* Resubmit urb so we continue receiving */
urb
->
dev
=
port
->
serial
->
dev
;
if
(
port
->
open_count
)
if
((
err
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
))
!=
0
)
{
dbg
(
"%s - resubmit read urb failed. (%d)"
,
__FUNCTION__
,
err
);
}
return
;
}
static
void
usa90_instat_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
{
unsigned
char
*
data
=
urb
->
transfer_buffer
;
struct
keyspan_usa90_portStatusMessage
*
msg
;
struct
usb_serial
*
serial
;
struct
usb_serial_port
*
port
;
struct
keyspan_port_private
*
p_priv
;
int
old_dcd_state
,
err
;
serial
=
(
struct
usb_serial
*
)
urb
->
context
;
if
(
urb
->
status
)
{
dbg
(
"%s - nonzero status: %x"
,
__FUNCTION__
,
urb
->
status
);
return
;
}
if
(
urb
->
actual_length
<
14
)
{
dbg
(
"%s - %d byte report??"
,
__FUNCTION__
,
urb
->
actual_length
);
goto
exit
;
}
msg
=
(
struct
keyspan_usa90_portStatusMessage
*
)
data
;
/* Now do something useful with the data */
port
=
serial
->
port
[
0
];
p_priv
=
usb_get_serial_port_data
(
port
);
/* Update handshaking pin state information */
old_dcd_state
=
p_priv
->
dcd_state
;
p_priv
->
cts_state
=
((
msg
->
cts
)
?
1
:
0
);
p_priv
->
dsr_state
=
((
msg
->
dsr
)
?
1
:
0
);
p_priv
->
dcd_state
=
((
msg
->
dcd
)
?
1
:
0
);
p_priv
->
ri_state
=
((
msg
->
ri
)
?
1
:
0
);
if
(
port
->
tty
&&
!
C_CLOCAL
(
port
->
tty
)
&&
old_dcd_state
!=
p_priv
->
dcd_state
)
{
if
(
old_dcd_state
)
tty_hangup
(
port
->
tty
);
/* else */
/* wake_up_interruptible(&p_priv->open_wait); */
}
/* Resubmit urb so we continue receiving */
urb
->
dev
=
serial
->
dev
;
if
((
err
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
))
!=
0
)
{
dbg
(
"%s - resubmit read urb failed. (%d)"
,
__FUNCTION__
,
err
);
}
exit:
;
}
static
void
usa90_outcont_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
)
{
struct
usb_serial_port
*
port
;
struct
keyspan_port_private
*
p_priv
;
port
=
(
struct
usb_serial_port
*
)
urb
->
context
;
p_priv
=
usb_get_serial_port_data
(
port
);
if
(
p_priv
->
resend_cont
)
{
dbg
(
"%s - sending setup"
,
__FUNCTION__
);
keyspan_usa90_send_setup
(
port
->
serial
,
port
,
p_priv
->
resend_cont
-
1
);
}
}
static
int
keyspan_write_room
(
struct
usb_serial_port
*
port
)
{
struct
keyspan_port_private
*
p_priv
;
const
struct
keyspan_device_details
*
d_details
;
int
flip
;
int
data_len
;
struct
urb
*
this_urb
;
dbg
(
"%s"
,
__FUNCTION__
);
p_priv
=
usb_get_serial_port_data
(
port
);
d_details
=
p_priv
->
device_details
;
if
(
d_details
->
msg_format
==
msg_usa90
)
data_len
=
64
;
else
data_len
=
63
;
flip
=
p_priv
->
out_flip
;
/* Check both endpoints to see if any are available. */
if
((
this_urb
=
p_priv
->
out_urbs
[
flip
])
!=
0
)
{
if
(
this_urb
->
status
!=
-
EINPROGRESS
)
return
(
63
);
return
(
data_len
);
flip
=
(
flip
+
1
)
&
d_details
->
outdat_endp_flip
;
if
((
this_urb
=
p_priv
->
out_urbs
[
flip
])
!=
0
)
if
(
this_urb
->
status
!=
-
EINPROGRESS
)
return
(
63
);
return
(
data_len
);
}
return
(
0
);
}
...
...
@@ -902,17 +1061,24 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
struct
usb_serial
*
serial
=
port
->
serial
;
const
struct
keyspan_device_details
*
d_details
;
int
i
,
err
;
int
baud_rate
,
device_port
;
struct
urb
*
urb
;
unsigned
int
cflag
;
s_priv
=
usb_get_serial_data
(
serial
);
p_priv
=
usb_get_serial_port_data
(
port
);
d_details
=
s
_priv
->
device_details
;
d_details
=
p
_priv
->
device_details
;
dbg
(
"%s - port%d."
,
__FUNCTION__
,
port
->
number
);
/* Set some sane defaults */
p_priv
->
rts_state
=
1
;
p_priv
->
dtr_state
=
1
;
p_priv
->
baud
=
9600
;
/* force baud and lcr to be set on open */
p_priv
->
old_baud
=
0
;
p_priv
->
old_cflag
=
0
;
p_priv
->
out_flip
=
0
;
p_priv
->
in_flip
=
0
;
...
...
@@ -922,7 +1088,10 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
if
((
urb
=
p_priv
->
in_urbs
[
i
])
==
NULL
)
continue
;
urb
->
dev
=
serial
->
dev
;
usb_settoggle
(
urb
->
dev
,
usb_pipeendpoint
(
urb
->
pipe
),
usb_pipeout
(
urb
->
pipe
),
0
);
/* make sure endpoint data toggle is synchronized with the device */
usb_clear_halt
(
urb
->
dev
,
urb
->
pipe
);
if
((
err
=
usb_submit_urb
(
urb
,
GFP_KERNEL
))
!=
0
)
{
dbg
(
"%s - submit urb %d failed (%d)"
,
__FUNCTION__
,
i
,
err
);
...
...
@@ -937,12 +1106,29 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
/* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */
}
// if the device is a USA49x, determine whether it is an W or WLC model
// and set the baud clock accordingly
/* get the terminal config for the setup message now so we don't
* need to send 2 of them */
cflag
=
port
->
tty
->
termios
->
c_cflag
;
device_port
=
port
->
number
-
port
->
serial
->
minor
;
/* Baud rate calculation takes baud rate as an integer
so other rates can be generated if desired. */
baud_rate
=
tty_get_baud_rate
(
port
->
tty
);
/* If no match or invalid, leave as default */
if
(
baud_rate
>=
0
&&
d_details
->
calculate_baud_rate
(
baud_rate
,
d_details
->
baudclk
,
NULL
,
NULL
,
NULL
,
device_port
)
==
KEYSPAN_BAUD_RATE_OK
)
{
p_priv
->
baud
=
baud_rate
;
}
/* set CTS/RTS handshake etc. */
p_priv
->
cflag
=
cflag
;
p_priv
->
flow_control
=
(
cflag
&
CRTSCTS
)
?
flow_cts
:
flow_none
;
keyspan_send_setup
(
port
,
1
);
//mdelay(100);
keyspan_set_termios
(
port
,
NULL
);
//
keyspan_set_termios(port, NULL);
return
(
0
);
}
...
...
@@ -977,7 +1163,7 @@ static void keyspan_close(struct usb_serial_port *port, struct file *filp)
keyspan_send_setup
(
port
,
2
);
/* pilot-xfer seems to work best with this delay */
mdelay
(
100
);
keyspan_set_termios
(
port
,
NULL
);
//
keyspan_set_termios(port, NULL);
}
/*while (p_priv->outcont_urb->status == -EINPROGRESS) {
...
...
@@ -1172,6 +1358,14 @@ static struct callbacks {
.
outdat_callback
=
usa2x_outdat_callback
,
.
inack_callback
=
usa49_inack_callback
,
.
outcont_callback
=
usa49_outcont_callback
,
},
{
/* msg_usa90 callbacks */
.
instat_callback
=
usa90_instat_callback
,
.
glocont_callback
=
usa28_glocont_callback
,
.
indat_callback
=
usa90_indat_callback
,
.
outdat_callback
=
usa2x_outdat_callback
,
.
inack_callback
=
usa28_inack_callback
,
.
outcont_callback
=
usa90_outcont_callback
,
}
};
...
...
@@ -1295,6 +1489,41 @@ static int keyspan_usa19_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi,
return
(
KEYSPAN_BAUD_RATE_OK
);
}
/* usa19hs function doesn't require prescaler */
static
int
keyspan_usa19hs_calc_baud
(
u32
baud_rate
,
u32
baudclk
,
u8
*
rate_hi
,
u8
*
rate_low
,
u8
*
prescaler
,
int
portnum
)
{
u32
b16
,
/* baud rate times 16 (actual rate used internally) */
div
;
/* divisor */
dbg
(
"%s - %d."
,
__FUNCTION__
,
baud_rate
);
/* prevent divide by zero... */
if
(
(
b16
=
(
baud_rate
*
16L
))
==
0
)
return
(
KEYSPAN_INVALID_BAUD_RATE
);
/* calculate the divisor */
if
(
(
div
=
(
baudclk
/
b16
))
==
0
)
return
(
KEYSPAN_INVALID_BAUD_RATE
);
if
(
div
>
0xffff
)
return
(
KEYSPAN_INVALID_BAUD_RATE
);
/* return the counter values if non-null */
if
(
rate_low
)
*
rate_low
=
(
u8
)
(
div
&
0xff
);
if
(
rate_hi
)
*
rate_hi
=
(
u8
)
((
div
>>
8
)
&
0xff
);
if
(
rate_low
&&
rate_hi
)
dbg
(
"%s - %d %02x %02x."
,
__FUNCTION__
,
baud_rate
,
*
rate_hi
,
*
rate_low
);
return
(
KEYSPAN_BAUD_RATE_OK
);
}
static
int
keyspan_usa19w_calc_baud
(
u32
baud_rate
,
u32
baudclk
,
u8
*
rate_hi
,
u8
*
rate_low
,
u8
*
prescaler
,
int
portnum
)
{
...
...
@@ -1447,6 +1676,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial,
p_priv
->
resend_cont
=
reset_port
+
1
;
if
(
this_urb
->
status
==
-
EINPROGRESS
)
{
/* dbg ("%s - already writing", __FUNCTION__); */
mdelay
(
5
);
return
(
-
1
);
}
...
...
@@ -1597,6 +1827,7 @@ static int keyspan_usa28_send_setup(struct usb_serial *serial,
p_priv
->
resend_cont
=
reset_port
+
1
;
if
(
this_urb
->
status
==
-
EINPROGRESS
)
{
dbg
(
"%s already writing"
,
__FUNCTION__
);
mdelay
(
5
);
return
(
-
1
);
}
...
...
@@ -1729,6 +1960,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial,
p_priv
->
resend_cont
=
reset_port
+
1
;
if
(
this_urb
->
status
==
-
EINPROGRESS
)
{
/* dbg ("%s - already writing", __FUNCTION__); */
mdelay
(
5
);
return
(
-
1
);
}
...
...
@@ -1857,6 +2089,144 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial,
return
(
0
);
}
static
int
keyspan_usa90_send_setup
(
struct
usb_serial
*
serial
,
struct
usb_serial_port
*
port
,
int
reset_port
)
{
struct
keyspan_usa90_portControlMessage
msg
;
struct
keyspan_serial_private
*
s_priv
;
struct
keyspan_port_private
*
p_priv
;
const
struct
keyspan_device_details
*
d_details
;
struct
urb
*
this_urb
;
int
err
;
u8
prescaler
;
dbg
(
"%s"
,
__FUNCTION__
);
s_priv
=
usb_get_serial_data
(
serial
);
p_priv
=
usb_get_serial_port_data
(
port
);
d_details
=
s_priv
->
device_details
;
/* only do something if we have a bulk out endpoint */
if
((
this_urb
=
p_priv
->
outcont_urb
)
==
NULL
)
{
dbg
(
"%s - oops no urb."
,
__FUNCTION__
);
return
-
1
;
}
/* Save reset port val for resend.
Don't overwrite resend for open/close condition. */
if
((
reset_port
+
1
)
>
p_priv
->
resend_cont
)
p_priv
->
resend_cont
=
reset_port
+
1
;
if
(
this_urb
->
status
==
-
EINPROGRESS
)
{
dbg
(
"%s already writing"
,
__FUNCTION__
);
mdelay
(
5
);
return
(
-
1
);
}
memset
(
&
msg
,
0
,
sizeof
(
struct
keyspan_usa90_portControlMessage
));
/* Only set baud rate if it's changed */
if
(
p_priv
->
old_baud
!=
p_priv
->
baud
)
{
p_priv
->
old_baud
=
p_priv
->
baud
;
msg
.
setClocking
=
0x01
;
if
(
d_details
->
calculate_baud_rate
(
p_priv
->
baud
,
d_details
->
baudclk
,
&
msg
.
baudHi
,
&
msg
.
baudLo
,
&
prescaler
,
0
)
==
KEYSPAN_INVALID_BAUD_RATE
)
{
dbg
(
"%s - Invalid baud rate %d requested, using 9600."
,
__FUNCTION__
,
p_priv
->
baud
);
p_priv
->
baud
=
9600
;
d_details
->
calculate_baud_rate
(
p_priv
->
baud
,
d_details
->
baudclk
,
&
msg
.
baudHi
,
&
msg
.
baudLo
,
&
prescaler
,
0
);
}
msg
.
setRxMode
=
1
;
msg
.
setTxMode
=
1
;
}
/* modes must always be correctly specified */
if
(
p_priv
->
baud
>
57600
)
{
msg
.
rxMode
=
RXMODE_DMA
;
msg
.
txMode
=
TXMODE_DMA
;
}
else
{
msg
.
rxMode
=
RXMODE_BYHAND
;
msg
.
txMode
=
TXMODE_BYHAND
;
}
msg
.
lcr
=
(
p_priv
->
cflag
&
CSTOPB
)
?
STOPBITS_678_2
:
STOPBITS_5678_1
;
switch
(
p_priv
->
cflag
&
CSIZE
)
{
case
CS5
:
msg
.
lcr
|=
USA_DATABITS_5
;
break
;
case
CS6
:
msg
.
lcr
|=
USA_DATABITS_6
;
break
;
case
CS7
:
msg
.
lcr
|=
USA_DATABITS_7
;
break
;
case
CS8
:
msg
.
lcr
|=
USA_DATABITS_8
;
break
;
}
if
(
p_priv
->
cflag
&
PARENB
)
{
/* note USA_PARITY_NONE == 0 */
msg
.
lcr
|=
(
p_priv
->
cflag
&
PARODD
)
?
USA_PARITY_ODD:
USA_PARITY_EVEN
;
}
if
(
p_priv
->
old_cflag
!=
p_priv
->
cflag
)
{
p_priv
->
old_cflag
=
p_priv
->
cflag
;
msg
.
setLcr
=
0x01
;
}
if
(
p_priv
->
flow_control
==
flow_cts
)
msg
.
txFlowControl
=
TXFLOW_CTS
;
msg
.
setTxFlowControl
=
0x01
;
msg
.
setRxFlowControl
=
0x01
;
msg
.
rxForwardingLength
=
16
;
msg
.
rxForwardingTimeout
=
16
;
msg
.
txAckSetting
=
0
;
msg
.
xonChar
=
17
;
msg
.
xoffChar
=
19
;
/* Opening port */
if
(
reset_port
==
1
)
{
msg
.
portEnabled
=
1
;
msg
.
rxFlush
=
1
;
msg
.
txBreak
=
(
p_priv
->
break_on
);
}
/* Closing port */
else
if
(
reset_port
==
2
)
{
msg
.
portEnabled
=
0
;
}
/* Sending intermediate configs */
else
{
if
(
port
->
open_count
)
msg
.
portEnabled
=
1
;
msg
.
txBreak
=
(
p_priv
->
break_on
);
}
/* Do handshaking outputs */
msg
.
setRts
=
0x01
;
msg
.
rts
=
p_priv
->
rts_state
;
msg
.
setDtr
=
0x01
;
msg
.
dtr
=
p_priv
->
dtr_state
;
p_priv
->
resend_cont
=
0
;
memcpy
(
this_urb
->
transfer_buffer
,
&
msg
,
sizeof
(
msg
));
/* send the data out the device on control endpoint */
this_urb
->
transfer_buffer_length
=
sizeof
(
msg
);
this_urb
->
dev
=
serial
->
dev
;
if
((
err
=
usb_submit_urb
(
this_urb
,
GFP_ATOMIC
))
!=
0
)
{
dbg
(
"%s - usb_submit_urb(setup) failed (%d)"
,
__FUNCTION__
,
err
);
}
return
(
0
);
}
static
void
keyspan_send_setup
(
struct
usb_serial_port
*
port
,
int
reset_port
)
{
struct
usb_serial
*
serial
=
port
->
serial
;
...
...
@@ -1878,9 +2248,13 @@ static void keyspan_send_setup(struct usb_serial_port *port, int reset_port)
case
msg_usa49
:
keyspan_usa49_send_setup
(
serial
,
port
,
reset_port
);
break
;
case
msg_usa90
:
keyspan_usa90_send_setup
(
serial
,
port
,
reset_port
);
break
;
}
}
/* Gets called by the "real" driver (ie once firmware is loaded
and renumeration has taken place. */
static
int
keyspan_startup
(
struct
usb_serial
*
serial
)
...
...
drivers/usb/serial/keyspan.h
View file @
324b683a
...
...
@@ -82,6 +82,10 @@ static int keyspan_usa28_calc_baud (u32 baud_rate, u32 baudclk,
u8
*
rate_hi
,
u8
*
rate_low
,
u8
*
prescaler
,
int
portnum
);
static
int
keyspan_usa19hs_calc_baud
(
u32
baud_rate
,
u32
baudclk
,
u8
*
rate_hi
,
u8
*
rate_low
,
u8
*
prescaler
,
int
portnum
);
static
int
keyspan_usa28_send_setup
(
struct
usb_serial
*
serial
,
struct
usb_serial_port
*
port
,
int
reset_port
);
...
...
@@ -92,6 +96,9 @@ static int keyspan_usa49_send_setup (struct usb_serial *serial,
struct
usb_serial_port
*
port
,
int
reset_port
);
static
int
keyspan_usa90_send_setup
(
struct
usb_serial
*
serial
,
struct
usb_serial_port
*
port
,
int
reset_port
);
/* Struct used for firmware - increased size of data section
to allow Keyspan's 'C' firmware struct to be used unmodified */
...
...
@@ -183,6 +190,7 @@ struct ezusb_hex_record {
#define KEYSPAN_USA18X_BAUDCLK (12000000L)
/* a guess */
#define KEYSPAN_USA19_BAUDCLK (12000000L)
#define KEYSPAN_USA19W_BAUDCLK (24000000L)
#define KEYSPAN_USA19HS_BAUDCLK (14769231L)
#define KEYSPAN_USA28_BAUDCLK (1843200L)
#define KEYSPAN_USA28X_BAUDCLK (12000000L)
#define KEYSPAN_USA49W_BAUDCLK (48000000L)
...
...
@@ -215,6 +223,7 @@ struct ezusb_hex_record {
#define keyspan_usa18x_product_id 0x0112
#define keyspan_usa19_product_id 0x0107
#define keyspan_usa19qi_product_id 0x010c
#define keyspan_usa19hs_product_id 0x0121
#define keyspan_mpr_product_id 0x011c
#define keyspan_usa19qw_product_id 0x0119
#define keyspan_usa19w_product_id 0x0108
...
...
@@ -230,7 +239,7 @@ struct keyspan_device_details {
/* product ID value */
int
product_id
;
enum
{
msg_usa26
,
msg_usa28
,
msg_usa49
}
msg_format
;
enum
{
msg_usa26
,
msg_usa28
,
msg_usa49
,
msg_usa90
}
msg_format
;
/* Number of physical ports */
int
num_ports
;
...
...
@@ -349,6 +358,22 @@ static const struct keyspan_device_details usa19w_device_details = {
.
baudclk
=
KEYSPAN_USA19W_BAUDCLK
,
};
static
const
struct
keyspan_device_details
usa19hs_device_details
=
{
product_id:
keyspan_usa19hs_product_id
,
msg_format:
msg_usa90
,
num_ports:
1
,
indat_endp_flip:
0
,
outdat_endp_flip:
0
,
indat_endpoints:
{
0x81
},
outdat_endpoints:
{
0x01
},
inack_endpoints:
{
-
1
},
outcont_endpoints:
{
0x02
},
instat_endpoint:
0x82
,
glocont_endpoint:
-
1
,
calculate_baud_rate:
keyspan_usa19hs_calc_baud
,
baudclk:
KEYSPAN_USA19HS_BAUDCLK
,
};
static
const
struct
keyspan_device_details
usa28_device_details
=
{
.
product_id
=
keyspan_usa28_product_id
,
.
msg_format
=
msg_usa28
,
...
...
@@ -437,6 +462,7 @@ static const struct keyspan_device_details *keyspan_devices[] = {
&
usa19qi_device_details
,
&
usa19qw_device_details
,
&
usa19w_device_details
,
&
usa19hs_device_details
,
&
usa28_device_details
,
&
usa28x_device_details
,
&
usa28xa_device_details
,
...
...
@@ -464,6 +490,7 @@ static struct usb_device_id keyspan_ids_combined[] = {
{
USB_DEVICE
(
KEYSPAN_VENDOR_ID
,
keyspan_usa19w_product_id
)
},
{
USB_DEVICE
(
KEYSPAN_VENDOR_ID
,
keyspan_usa19qi_product_id
)
},
{
USB_DEVICE
(
KEYSPAN_VENDOR_ID
,
keyspan_usa19qw_product_id
)
},
{
USB_DEVICE
(
KEYSPAN_VENDOR_ID
,
keyspan_usa19hs_product_id
)
},
{
USB_DEVICE
(
KEYSPAN_VENDOR_ID
,
keyspan_mpr_product_id
)
},
{
USB_DEVICE
(
KEYSPAN_VENDOR_ID
,
keyspan_usa28_product_id
)
},
{
USB_DEVICE
(
KEYSPAN_VENDOR_ID
,
keyspan_usa28x_product_id
)
},
...
...
@@ -544,8 +571,8 @@ static struct usb_serial_device_type keyspan_1port_device = {
.
short_name
=
"keyspan_1"
,
.
id_table
=
keyspan_1port_ids
,
.
num_interrupt_in
=
NUM_DONT_CARE
,
.
num_bulk_in
=
3
,
.
num_bulk_out
=
4
,
.
num_bulk_in
=
NUM_DONT_CARE
,
.
num_bulk_out
=
NUM_DONT_CARE
,
.
num_ports
=
1
,
.
open
=
keyspan_open
,
.
close
=
keyspan_close
,
...
...
drivers/usb/serial/keyspan_usa26msg.h
View file @
324b683a
...
...
@@ -4,7 +4,7 @@
Copyright (C) 1998-2000 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
Keyspan USB Async
Firmware to run on Anchor EZ-USB
Keyspan USB Async
Message Formats for the USA28X
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
...
...
@@ -19,11 +19,7 @@
This file is available under a BSD-style copyright
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of InnoSys Incorporated may not be used to endorse or promote
2. The name of InnoSys Incorporated may not be used to endorse or promote
products derived from this software without specific prior written
permission.
...
...
drivers/usb/serial/keyspan_usa28msg.h
View file @
324b683a
...
...
@@ -4,7 +4,7 @@
Copyright (C) 1998-2000 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
Keyspan USB Async
Firmware to run on Anchor EZ-USB
Keyspan USB Async
Message Formats for the USA26X
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
...
...
@@ -19,11 +19,7 @@
This file is available under a BSD-style copyright
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of InnoSys Incorporated may not be used to endorse or promote
2. The name of InnoSys Incorporated may not be used to endorse or promote
products derived from this software without specific prior written
permission.
...
...
drivers/usb/serial/keyspan_usa49msg.h
View file @
324b683a
...
...
@@ -4,7 +4,7 @@
Copyright (C) 1998-2000 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
Keyspan USB Async
Firmware to run on Anchor EZ-USB
Keyspan USB Async
Message Formats for the USA49W
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
...
...
@@ -19,11 +19,7 @@
This file is available under a BSD-style copyright
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of InnoSys Incorporated may not be used to endorse or promote
2. The name of InnoSys Incorporated may not be used to endorse or promote
products derived from this software without specific prior written
permission.
...
...
drivers/usb/serial/keyspan_usa90msg.h
0 → 100644
View file @
324b683a
/*
usa90msg.h
Copyright (c) 1998-2003 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
Keyspan USB Async Message Formats for the USA19HS
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain this licence text
without modification, this list of conditions, and the following
disclaimer. The following copyright notice must appear immediately at
the beginning of all source files:
Copyright (c) 1998-2003 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
2. The name of InnoSys Incorprated may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY INNOSYS CORP. ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Revisions:
2003feb14 add setTxMode/txMode and cancelRxXoff to portControl
2003mar21 change name of PARITY_0/1 to add MARK/SPACE
*/
#ifndef __USA90MSG__
#define __USA90MSG__
struct
keyspan_usa90_portControlMessage
{
/*
there are three types of "commands" sent in the control message:
1. configuration changes which must be requested by setting
the corresponding "set" flag (and should only be requested
when necessary, to reduce overhead on the device):
*/
u8
setClocking
,
// host requests baud rate be set
baudLo
,
// host does baud divisor calculation
baudHi
,
// host does baud divisor calculation
setLcr
,
// host requests lcr be set
lcr
,
// use PARITY, STOPBITS, DATABITS below
setRxMode
,
// set receive mode
rxMode
,
// RXMODE_DMA or RXMODE_BYHAND
setTxMode
,
// set transmit mode
txMode
,
// TXMODE_DMA or TXMODE_BYHAND
setTxFlowControl
,
// host requests tx flow control be set
txFlowControl
,
// use TX_FLOW... bits below
setRxFlowControl
,
// host requests rx flow control be set
rxFlowControl
,
// use RX_FLOW... bits below
sendXoff
,
// host requests XOFF transmitted immediately
sendXon
,
// host requests XON char transmitted
xonChar
,
// specified in current character format
xoffChar
,
// specified in current character format
sendChar
,
// host requests char transmitted immediately
txChar
,
// character to send
setRts
,
// host requests RTS output be set
rts
,
// 1=on, 0=off
setDtr
,
// host requests DTR output be set
dtr
;
// 1=on, 0=off
/*
2. configuration data which is simply used as is
and must be specified correctly in every host message.
*/
u8
rxForwardingLength
,
// forward when this number of chars available
rxForwardingTimeout
,
// (1-31 in ms)
txAckSetting
;
// 0=don't ack, 1=normal, 2-255 TBD...
/*
3. Firmware states which cause actions if they change
and must be specified correctly in every host message.
*/
u8
portEnabled
,
// 0=disabled, 1=enabled
txFlush
,
// 0=normal, 1=toss outbound data
txBreak
,
// 0=break off, 1=break on
loopbackMode
;
// 0=no loopback, 1=loopback enabled
/*
4. commands which are flags only; these are processed in order
(so that, e.g., if rxFlush and rxForward flags are set, the
port will have no data to forward); any non-zero value
is respected
*/
u8
rxFlush
,
// toss inbound data
rxForward
,
// forward all inbound data, NOW (as if fwdLen==1)
cancelRxXoff
,
// cancel any receive XOFF state (_txXoff)
returnStatus
;
// return current status NOW
};
// defines for bits in lcr
#define USA_DATABITS_5 0x00
#define USA_DATABITS_6 0x01
#define USA_DATABITS_7 0x02
#define USA_DATABITS_8 0x03
#define STOPBITS_5678_1 0x00 // 1 stop bit for all byte sizes
#define STOPBITS_5_1p5 0x04 // 1.5 stop bits for 5-bit byte
#define STOPBITS_678_2 0x04 // 2 stop bits for 6-8 bit byte
#define USA_PARITY_NONE 0x00
#define USA_PARITY_ODD 0x08
#define USA_PARITY_EVEN 0x18
#define PARITY_MARK_1 0x28 // force parity MARK
#define PARITY_SPACE_0 0x38 // force parity SPACE
#define TXFLOW_CTS 0x04
#define TXFLOW_DSR 0x08
#define TXFLOW_XOFF 0x01
#define TXFLOW_XOFF_ANY 0x02
#define TXFLOW_XOFF_BITS (TXFLOW_XOFF | TXFLOW_XOFF_ANY)
#define RXFLOW_XOFF 0x10
#define RXFLOW_RTS 0x20
#define RXFLOW_DTR 0x40
#define RXFLOW_DSR_SENSITIVITY 0x80
#define RXMODE_BYHAND 0x00
#define RXMODE_DMA 0x02
#define TXMODE_BYHAND 0x00
#define TXMODE_DMA 0x02
// all things called "StatusMessage" are sent on the status endpoint
struct
keyspan_usa90_portStatusMessage
{
u8
msr
,
// reports the actual MSR register
cts
,
// reports CTS pin
dcd
,
// reports DCD pin
dsr
,
// reports DSR pin
ri
,
// reports RI pin
_txXoff
,
// port is in XOFF state (we received XOFF)
rxBreak
,
// reports break state
rxOverrun
,
// count of overrun errors (since last reported)
rxParity
,
// count of parity errors (since last reported)
rxFrame
,
// count of frame errors (since last reported)
portState
,
// PORTSTATE_xxx bits (useful for debugging)
messageAck
,
// message acknowledgement
charAck
,
// character acknowledgement
controlResponse
;
// (value = returnStatus) a control message has been processed
};
// bits in RX data message when STAT byte is included
#define RXERROR_OVERRUN 0x02
#define RXERROR_PARITY 0x04
#define RXERROR_FRAMING 0x08
#define RXERROR_BREAK 0x10
#define PORTSTATE_ENABLED 0x80
#define PORTSTATE_TXFLUSH 0x01
#define PORTSTATE_TXBREAK 0x02
#define PORTSTATE_LOOPBACK 0x04
// MSR bits
#define MSR_dCTS 0x01 // CTS has changed since last report
#define MSR_dDSR 0x02
#define MSR_dRI 0x04
#define MSR_dDCD 0x08
#define MSR_CTS 0x10 // current state of CTS
#define MSR_DSR 0x20
#define MSR_RI 0x40
#define MSR_DCD 0x80
// ie: the maximum length of an endpoint buffer
#define MAX_DATA_LEN 64
#endif
drivers/usb/storage/freecom.c
View file @
324b683a
...
...
@@ -101,7 +101,8 @@ struct freecom_status {
#define FCM_PACKET_IDE_READ 0xC0
/* All packets (except for status) are 64 bytes long. */
#define FCM_PACKET_LENGTH 64
#define FCM_PACKET_LENGTH 64
#define FCM_STATUS_PACKET_LENGTH 4
static
int
freecom_readdata
(
Scsi_Cmnd
*
srb
,
struct
us_data
*
us
,
...
...
@@ -216,7 +217,7 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
/* There are times we can optimize out this status read, but it
* doesn't hurt us to always do it now. */
result
=
usb_stor_bulk_transfer_buf
(
us
,
ipipe
,
fst
,
FCM_PACKET_LENGTH
,
&
partial
);
FCM_
STATUS_
PACKET_LENGTH
,
&
partial
);
US_DEBUGP
(
"foo Status result %d %u
\n
"
,
result
,
partial
);
if
(
result
!=
USB_STOR_XFER_GOOD
)
return
USB_STOR_TRANSPORT_ERROR
;
...
...
@@ -256,10 +257,10 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
/* get the data */
result
=
usb_stor_bulk_transfer_buf
(
us
,
ipipe
,
fst
,
FCM_PACKET_LENGTH
,
&
partial
);
FCM_
STATUS_
PACKET_LENGTH
,
&
partial
);
US_DEBUGP
(
"bar Status result %d %u
\n
"
,
result
,
partial
);
if
(
result
>
USB_STOR_XFER_SHORT
)
if
(
result
!=
USB_STOR_XFER_GOOD
)
return
USB_STOR_TRANSPORT_ERROR
;
US_DEBUG
(
pdump
((
void
*
)
fst
,
partial
));
...
...
@@ -302,6 +303,9 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
switch
(
us
->
srb
->
sc_data_direction
)
{
case
SCSI_DATA_READ
:
/* catch bogus "read 0 length" case */
if
(
!
length
)
break
;
/* Make sure that the status indicates that the device
* wants data as well. */
if
((
fst
->
Status
&
DRQ_STAT
)
==
0
||
(
fst
->
Reason
&
3
)
!=
2
)
{
...
...
@@ -331,6 +335,9 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
break
;
case
SCSI_DATA_WRITE
:
/* catch bogus "write 0 length" case */
if
(
!
length
)
break
;
/* Make sure the status indicates that the device wants to
* send us data. */
/* !!IMPLEMENT!! */
...
...
@@ -362,6 +369,7 @@ int freecom_transport(Scsi_Cmnd *srb, struct us_data *us)
break
;
default:
/* should never hit here -- filtered in usb.c */
US_DEBUGP
(
"freecom unimplemented direction: %d
\n
"
,
us
->
srb
->
sc_data_direction
);
// Return fail, SCSI seems to handle this better.
...
...
drivers/usb/storage/unusual_devs.h
View file @
324b683a
...
...
@@ -394,6 +394,12 @@ UNUSUAL_DEV( 0x0686, 0x4011, 0x0001, 0x0001,
"Dimage F300"
,
US_SC_SCSI
,
US_PR_BULK
,
NULL
,
0
),
/* Reported by Miguel A. Fosas <amn3s1a@ono.com> */
UNUSUAL_DEV
(
0x0686
,
0x4017
,
0x0001
,
0x0001
,
"Minolta"
,
"DIMAGE E223"
,
US_SC_SCSI
,
US_PR_DEVICE
,
NULL
,
0
),
UNUSUAL_DEV
(
0x0693
,
0x0002
,
0x0100
,
0x0100
,
"Hagiwara"
,
"FlashGate SmartMedia"
,
...
...
@@ -542,7 +548,7 @@ UNUSUAL_DEV( 0x07c4, 0xa400, 0x0000, 0xffff,
* - They don't like the INQUIRY command. So we must handle this command
* of the SCSI layer ourselves.
*/
UNUSUAL_DEV
(
0x07cf
,
0x1001
,
0x1000
,
0x
9
009
,
UNUSUAL_DEV
(
0x07cf
,
0x1001
,
0x1000
,
0x
5
009
,
"Casio"
,
"QV DigitalCamera"
,
US_SC_8070
,
US_PR_CB
,
NULL
,
...
...
include/asm-i386/elf.h
View file @
324b683a
...
...
@@ -157,7 +157,10 @@ do { \
for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \
struct elf_phdr phdr = vsyscall_phdrs[i]; \
if (phdr.p_type == PT_LOAD) { \
BUG_ON(ofs != 0); \
ofs = phdr.p_offset = offset; \
phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \
phdr.p_filesz = phdr.p_memsz; \
offset += phdr.p_filesz; \
} \
else \
...
...
@@ -175,7 +178,7 @@ do { \
for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \
if (vsyscall_phdrs[i].p_type == PT_LOAD) \
DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \
vsyscall_phdrs[i].p_filesz);
\
PAGE_ALIGN(vsyscall_phdrs[i].p_memsz));
\
} \
} while (0)
...
...
include/asm-ia64/elf.h
View file @
324b683a
...
...
@@ -206,42 +206,46 @@ do { \
NEW_AUX_ENT(AT_SYSINFO_EHDR, (unsigned long) GATE_EHDR); \
} while (0)
/*
* These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out extra segments
* containing the gate DSO contents. Dumping its contents makes post-mortem fully
* interpretable later without matching up the same kernel and hardware config to see what
* IP values meant. Dumping its extra ELF program headers includes all the other
* information a debugger needs to easily find how the gate DSO was being used.
* These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
* extra segments containing the gate DSO contents. Dumping its
* contents makes post-mortem fully interpretable later without matching up
* the same kernel and hardware config to see what PC values meant.
* Dumping its extra ELF program headers includes all the other information
* a debugger needs to easily find how the gate DSO was being used.
*/
#define ELF_CORE_EXTRA_PHDRS (GATE_EHDR->e_phnum)
#define ELF_CORE_WRITE_EXTRA_PHDRS \
do { \
const struct elf_phdr *const
gate_phdrs =
\
(const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);
\
const struct elf_phdr *const
vsyscall_phdrs =
\
(const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);
\
int i; \
Elf
64_Off ofs = 0;
\
Elf
32_Off ofs = 0;
\
for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \
struct elf_phdr phdr =
gate_phdrs[i];
\
struct elf_phdr phdr =
vsyscall_phdrs[i];
\
if (phdr.p_type == PT_LOAD) { \
BUG_ON(ofs != 0); \
ofs = phdr.p_offset = offset; \
phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \
phdr.p_filesz = phdr.p_memsz; \
offset += phdr.p_filesz; \
} else \
} \
else \
phdr.p_offset += ofs; \
phdr.p_paddr = 0;
/* match other core phdrs */
\
DUMP_WRITE(&phdr, sizeof(phdr)); \
} \
} while (0)
#define ELF_CORE_WRITE_EXTRA_DATA \
do { \
const struct elf_phdr *const gate_phdrs = \
(const struct elf_phdr *) (GATE_ADDR \
+ GATE_EHDR->e_phoff); \
const struct elf_phdr *const vsyscall_phdrs = \
(const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \
int i; \
for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \
if (
gate_phdrs[i].p_type == PT_LOAD)
\
DUMP_WRITE((void *)
gate_phdrs[i].p_vaddr,
\
gate_phdrs[i].p_filesz);
\
if (
vsyscall_phdrs[i].p_type == PT_LOAD)
\
DUMP_WRITE((void *)
vsyscall_phdrs[i].p_vaddr,
\
PAGE_ALIGN(vsyscall_phdrs[i].p_memsz));
\
} \
} while (0)
...
...
include/linux/usb.h
View file @
324b683a
...
...
@@ -1038,9 +1038,9 @@ void usb_show_string(struct usb_device *dev, char *id, int index);
#define dbg(format, arg...) do {} while (0)
#endif
#define err(format, arg...) printk(KERN_ERR
__FILE__ ": " format "\n"
, ## arg)
#define info(format, arg...) printk(KERN_INFO
__FILE__ ": " format "\n"
, ## arg)
#define warn(format, arg...) printk(KERN_WARNING
__FILE__ ": " format "\n"
, ## arg)
#define err(format, arg...) printk(KERN_ERR
"%s: " format "\n" , __FILE__
, ## arg)
#define info(format, arg...) printk(KERN_INFO
"%s: " format "\n" , __FILE__
, ## arg)
#define warn(format, arg...) printk(KERN_WARNING
"%s: " format "\n" , __FILE__
, ## arg)
#endif
/* __KERNEL__ */
...
...
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