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
b0e15db0
Commit
b0e15db0
authored
Apr 15, 2004
by
Ben Collins
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://linux.bkbits.net/linux-2.5
into debian.org:/usr/src/kernel/ieee1394-2.6
parents
162ed082
bd6b55b0
Changes
33
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
1142 additions
and
1120 deletions
+1142
-1120
drivers/ieee1394/Kconfig
drivers/ieee1394/Kconfig
+1
-1
drivers/ieee1394/amdtp.c
drivers/ieee1394/amdtp.c
+20
-19
drivers/ieee1394/amdtp.h
drivers/ieee1394/amdtp.h
+1
-1
drivers/ieee1394/cmp.c
drivers/ieee1394/cmp.c
+6
-6
drivers/ieee1394/csr.c
drivers/ieee1394/csr.c
+16
-16
drivers/ieee1394/csr1212.c
drivers/ieee1394/csr1212.c
+13
-16
drivers/ieee1394/csr1212.h
drivers/ieee1394/csr1212.h
+4
-3
drivers/ieee1394/dma.c
drivers/ieee1394/dma.c
+12
-1
drivers/ieee1394/dma.h
drivers/ieee1394/dma.h
+2
-2
drivers/ieee1394/dv1394-private.h
drivers/ieee1394/dv1394-private.h
+42
-43
drivers/ieee1394/dv1394.c
drivers/ieee1394/dv1394.c
+207
-210
drivers/ieee1394/dv1394.h
drivers/ieee1394/dv1394.h
+17
-17
drivers/ieee1394/eth1394.c
drivers/ieee1394/eth1394.c
+26
-30
drivers/ieee1394/highlevel.c
drivers/ieee1394/highlevel.c
+1
-1
drivers/ieee1394/highlevel.h
drivers/ieee1394/highlevel.h
+7
-7
drivers/ieee1394/hosts.c
drivers/ieee1394/hosts.c
+1
-3
drivers/ieee1394/hosts.h
drivers/ieee1394/hosts.h
+5
-3
drivers/ieee1394/ieee1394.h
drivers/ieee1394/ieee1394.h
+2
-2
drivers/ieee1394/ieee1394_core.c
drivers/ieee1394/ieee1394_core.c
+133
-141
drivers/ieee1394/ieee1394_core.h
drivers/ieee1394/ieee1394_core.h
+12
-6
drivers/ieee1394/ieee1394_transactions.c
drivers/ieee1394/ieee1394_transactions.c
+22
-22
drivers/ieee1394/iso.c
drivers/ieee1394/iso.c
+2
-2
drivers/ieee1394/nodemgr.c
drivers/ieee1394/nodemgr.c
+17
-18
drivers/ieee1394/nodemgr.h
drivers/ieee1394/nodemgr.h
+3
-3
drivers/ieee1394/ohci1394.c
drivers/ieee1394/ohci1394.c
+210
-193
drivers/ieee1394/ohci1394.h
drivers/ieee1394/ohci1394.h
+10
-10
drivers/ieee1394/pcilynx.c
drivers/ieee1394/pcilynx.c
+43
-46
drivers/ieee1394/pcilynx.h
drivers/ieee1394/pcilynx.h
+10
-10
drivers/ieee1394/raw1394-private.h
drivers/ieee1394/raw1394-private.h
+1
-1
drivers/ieee1394/raw1394.c
drivers/ieee1394/raw1394.c
+107
-108
drivers/ieee1394/sbp2.c
drivers/ieee1394/sbp2.c
+97
-88
drivers/ieee1394/sbp2.h
drivers/ieee1394/sbp2.h
+11
-11
drivers/ieee1394/video1394.c
drivers/ieee1394/video1394.c
+81
-80
No files found.
drivers/ieee1394/Kconfig
View file @
b0e15db0
...
...
@@ -124,7 +124,7 @@ config IEEE1394_SBP2_PHYS_DMA
config IEEE1394_ETH1394
tristate "Ethernet over 1394"
depends on IEEE1394 && EXPERIMENTAL
depends on IEEE1394 && EXPERIMENTAL
&& INET
select IEEE1394_CONFIG_ROM_IP1394
select IEEE1394_EXTRA_CONFIG_ROMS
help
...
...
drivers/ieee1394/amdtp.c
View file @
b0e15db0
...
...
@@ -1266,6 +1266,7 @@ static int __init amdtp_init_module (void)
{
cdev_init
(
&
amdtp_cdev
,
&
amdtp_fops
);
amdtp_cdev
.
owner
=
THIS_MODULE
;
kobject_set_name
(
&
amdtp_cdev
.
kobj
,
"amdtp"
);
if
(
cdev_add
(
&
amdtp_cdev
,
IEEE1394_AMDTP_DEV
,
16
))
{
HPSB_ERR
(
"amdtp: unable to add char device"
);
return
-
EIO
;
...
...
drivers/ieee1394/amdtp.h
View file @
b0e15db0
drivers/ieee1394/cmp.c
View file @
b0e15db0
drivers/ieee1394/csr.c
View file @
b0e15db0
drivers/ieee1394/csr1212.c
View file @
b0e15db0
...
...
@@ -256,8 +256,7 @@ struct csr1212_keyval *csr1212_new_leaf(u_int8_t key, const void *data, size_t d
if
(
data_len
>
0
)
{
kv
->
value
.
leaf
.
data
=
CSR1212_MALLOC
(
data_len
);
if
(
!
kv
->
value
.
leaf
.
data
)
{
if
(
!
kv
->
value
.
leaf
.
data
)
{
CSR1212_FREE
(
kv
);
return
NULL
;
}
...
...
@@ -788,8 +787,7 @@ static int csr1212_append_new_cache(struct csr1212_csr *csr, size_t romsize)
return
CSR1212_ENOMEM
;
}
if
(
csr1212_attach_keyval_to_directory
(
csr
->
root_kv
,
cache
->
ext_rom
)
!=
CSR1212_SUCCESS
)
{
if
(
csr1212_attach_keyval_to_directory
(
csr
->
root_kv
,
cache
->
ext_rom
)
!=
CSR1212_SUCCESS
)
{
csr1212_release_keyval
(
cache
->
ext_rom
);
csr
->
ops
->
release_addr
(
csr_addr
,
csr
->
private
);
CSR1212_FREE
(
cache
);
...
...
@@ -1124,7 +1122,6 @@ int csr1212_generate_csr_image(struct csr1212_csr *csr)
csr1212_remove_cache
(
csr
,
oc
);
}
/* Go through the list backward so that when done, the correct CRC
* will be calculated for the Extended ROM areas. */
for
(
cache
=
csr
->
cache_tail
;
cache
;
cache
=
cache
->
prev
)
{
...
...
drivers/ieee1394/csr1212.h
View file @
b0e15db0
...
...
@@ -37,6 +37,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#define CSR1212_MALLOC(size) kmalloc((size), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL)
#define CSR1212_FREE(ptr) kfree(ptr)
...
...
drivers/ieee1394/dma.c
View file @
b0e15db0
...
...
@@ -196,6 +196,8 @@ void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, un
pci_dma_sync_sg_for_device
(
dma
->
dev
,
&
dma
->
sglist
[
first
],
last
-
first
+
1
,
dma
->
direction
);
}
#ifdef CONFIG_MMU
/* nopage() handler for mmap access */
static
struct
page
*
...
...
@@ -251,3 +253,12 @@ int dma_region_mmap(struct dma_region *dma, struct file *file, struct vm_area_st
return
0
;
}
#else
/* CONFIG_MMU */
int
dma_region_mmap
(
struct
dma_region
*
dma
,
struct
file
*
file
,
struct
vm_area_struct
*
vma
)
{
return
-
EINVAL
;
}
#endif
/* CONFIG_MMU */
drivers/ieee1394/dma.h
View file @
b0e15db0
drivers/ieee1394/dv1394-private.h
View file @
b0e15db0
...
...
@@ -511,7 +511,6 @@ struct video_card {
The interrupt handler will NEVER advance active_frame to a
frame that is not READY.
*/
int
active_frame
;
int
first_run
;
...
...
drivers/ieee1394/dv1394.c
View file @
b0e15db0
...
...
@@ -834,8 +834,7 @@ static void start_dma_receive(struct video_card *video)
printk
(
"RUNNING!
\n
"
);
}
#endif
}
else
if
(
reg_read
(
video
->
ohci
,
video
->
ohci_IsoRcvContextControlSet
)
&
(
1
<<
11
)
)
{
}
else
if
(
reg_read
(
video
->
ohci
,
video
->
ohci_IsoRcvContextControlSet
)
&
(
1
<<
11
)
)
{
debug_printk
(
"DEAD, event = %x
\n
"
,
reg_read
(
video
->
ohci
,
video
->
ohci_IsoRcvContextControlSet
)
&
0x1F
);
...
...
@@ -1986,8 +1985,6 @@ static void it_tasklet_func(unsigned long data)
video
->
dropped_frames
++
;
}
}
/* for (each frame) */
}
...
...
@@ -2013,8 +2010,7 @@ static void ir_tasklet_func(unsigned long data)
goto
out
;
if
(
(
video
->
ohci_ir_ctx
!=
-
1
)
&&
(
reg_read
(
video
->
ohci
,
video
->
ohci_IsoRcvContextControlSet
)
&
(
1
<<
10
))
)
{
(
reg_read
(
video
->
ohci
,
video
->
ohci_IsoRcvContextControlSet
)
&
(
1
<<
10
))
)
{
int
sof
=
0
;
/* start-of-frame flag */
struct
frame
*
f
;
...
...
@@ -2616,6 +2612,7 @@ static int __init dv1394_init_module(void)
cdev_init
(
&
dv1394_cdev
,
&
dv1394_fops
);
dv1394_cdev
.
owner
=
THIS_MODULE
;
kobject_set_name
(
&
dv1394_cdev
.
kobj
,
"dv1394"
);
ret
=
cdev_add
(
&
dv1394_cdev
,
IEEE1394_DV1394_DEV
,
16
);
if
(
ret
)
{
printk
(
KERN_ERR
"dv1394: unable to register character device
\n
"
);
...
...
drivers/ieee1394/dv1394.h
View file @
b0e15db0
drivers/ieee1394/eth1394.c
View file @
b0e15db0
...
...
@@ -89,7 +89,7 @@
#define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__)
static
char
version
[]
__devinitdata
=
"$Rev: 11
75
$ Ben Collins <bcollins@debian.org>"
;
"$Rev: 11
98
$ Ben Collins <bcollins@debian.org>"
;
struct
fragment_info
{
struct
list_head
list
;
...
...
@@ -216,7 +216,7 @@ static struct hpsb_highlevel eth1394_highlevel = {
/* This is called after an "ifup" */
static
int
ether1394_open
(
struct
net_device
*
dev
)
{
struct
eth1394_priv
*
priv
=
(
struct
eth1394_priv
*
)
dev
->
priv
;
struct
eth1394_priv
*
priv
=
dev
->
priv
;
int
ret
=
0
;
/* Something bad happened, don't even try */
...
...
@@ -278,7 +278,7 @@ static void ether1394_tx_timeout (struct net_device *dev)
static
int
ether1394_change_mtu
(
struct
net_device
*
dev
,
int
new_mtu
)
{
struct
eth1394_priv
*
priv
=
(
struct
eth1394_priv
*
)
dev
->
priv
;
struct
eth1394_priv
*
priv
=
dev
->
priv
;
if
((
new_mtu
<
68
)
||
(
new_mtu
>
min
(
ETH1394_DATA_LEN
,
...
...
@@ -479,7 +479,7 @@ static void ether1394_reset_priv (struct net_device *dev, int set_mtu)
{
unsigned
long
flags
;
int
i
;
struct
eth1394_priv
*
priv
=
(
struct
eth1394_priv
*
)
dev
->
priv
;
struct
eth1394_priv
*
priv
=
dev
->
priv
;
struct
hpsb_host
*
host
=
priv
->
host
;
u64
guid
=
*
((
u64
*
)
&
(
host
->
csr
.
rom
->
bus_info_data
[
3
]));
u16
maxpayload
=
1
<<
(
host
->
csr
.
max_rec
+
1
);
...
...
@@ -731,14 +731,12 @@ static int ether1394_header(struct sk_buff *skb, struct net_device *dev,
eth
->
h_proto
=
htons
(
type
);
if
(
dev
->
flags
&
(
IFF_LOOPBACK
|
IFF_NOARP
))
{
if
(
dev
->
flags
&
(
IFF_LOOPBACK
|
IFF_NOARP
))
{
memset
(
eth
->
h_dest
,
0
,
dev
->
addr_len
);
return
(
dev
->
hard_header_len
);
}
if
(
daddr
)
{
if
(
daddr
)
{
memcpy
(
eth
->
h_dest
,
daddr
,
dev
->
addr_len
);
return
dev
->
hard_header_len
;
}
...
...
@@ -760,8 +758,8 @@ static int ether1394_rebuild_header(struct sk_buff *skb)
struct
eth1394hdr
*
eth
=
(
struct
eth1394hdr
*
)
skb
->
data
;
struct
net_device
*
dev
=
skb
->
dev
;
switch
(
eth
->
h_proto
)
{
switch
(
eth
->
h_proto
)
{
#ifdef CONFIG_INET
case
__constant_htons
(
ETH_P_IP
):
return
arp_find
((
unsigned
char
*
)
&
eth
->
h_dest
,
skb
);
...
...
@@ -867,7 +865,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
nodeid_t
srcid
,
nodeid_t
destid
,
u16
ether_type
)
{
struct
eth1394_priv
*
priv
=
(
struct
eth1394_priv
*
)
dev
->
priv
;
struct
eth1394_priv
*
priv
=
dev
->
priv
;
u64
dest_hw
;
unsigned
short
ret
=
0
;
...
...
@@ -1538,7 +1536,6 @@ static inline void ether1394_free_packet(struct hpsb_packet *packet)
{
if
(
packet
->
tcode
!=
TCODE_STREAM_DATA
)
hpsb_free_tlabel
(
packet
);
packet
->
data
=
NULL
;
hpsb_free_packet
(
packet
);
}
...
...
@@ -1583,7 +1580,7 @@ static inline void ether1394_dg_complete(struct packet_task *ptask, int fail)
{
struct
sk_buff
*
skb
=
ptask
->
skb
;
struct
net_device
*
dev
=
skb
->
dev
;
struct
eth1394_priv
*
priv
=
(
struct
eth1394_priv
*
)
dev
->
priv
;
struct
eth1394_priv
*
priv
=
dev
->
priv
;
unsigned
long
flags
;
/* Statistics */
...
...
@@ -1616,8 +1613,7 @@ static void ether1394_complete_cb(void *__ptask)
ether1394_free_packet
(
packet
);
ptask
->
outstanding_pkts
--
;
if
(
ptask
->
outstanding_pkts
>
0
&&
!
fail
)
{
if
(
ptask
->
outstanding_pkts
>
0
&&
!
fail
)
{
int
tx_len
;
/* Add the encapsulation header to the fragment */
...
...
@@ -1637,7 +1633,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
{
int
kmflags
=
in_interrupt
()
?
GFP_ATOMIC
:
GFP_KERNEL
;
struct
eth1394hdr
*
eth
;
struct
eth1394_priv
*
priv
=
(
struct
eth1394_priv
*
)
dev
->
priv
;
struct
eth1394_priv
*
priv
=
dev
->
priv
;
int
proto
;
unsigned
long
flags
;
nodeid_t
dest_node
;
...
...
@@ -1797,7 +1793,7 @@ static int ether1394_ethtool_ioctl(struct net_device *dev, void *useraddr)
case
ETHTOOL_GDRVINFO
:
{
struct
ethtool_drvinfo
info
=
{
ETHTOOL_GDRVINFO
};
strcpy
(
info
.
driver
,
driver_name
);
strcpy
(
info
.
version
,
"$Rev: 11
75
$"
);
strcpy
(
info
.
version
,
"$Rev: 11
98
$"
);
/* FIXME XXX provide sane businfo */
strcpy
(
info
.
bus_info
,
"ieee1394"
);
if
(
copy_to_user
(
useraddr
,
&
info
,
sizeof
(
info
)))
...
...
drivers/ieee1394/highlevel.c
View file @
b0e15db0
drivers/ieee1394/highlevel.h
View file @
b0e15db0
drivers/ieee1394/hosts.c
View file @
b0e15db0
...
...
@@ -126,9 +126,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
h
->
hostdata
=
h
+
1
;
h
->
driver
=
drv
;
INIT_LIST_HEAD
(
&
h
->
pending_packets
);
spin_lock_init
(
&
h
->
pending_pkt_lock
);
skb_queue_head_init
(
&
h
->
pending_packet_queue
);
INIT_LIST_HEAD
(
&
h
->
addr_space
);
init_timer
(
&
h
->
delayed_reset
);
...
...
drivers/ieee1394/hosts.h
View file @
b0e15db0
...
...
@@ -5,6 +5,8 @@
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/skbuff.h>
#include <asm/semaphore.h>
#include "ieee1394_types.h"
...
...
@@ -21,8 +23,8 @@ struct hpsb_host {
atomic_t
generation
;
struct
list_head
pending_packets
;
spinlock_t
pending_pkt_lock
;
struct
sk_buff_head
pending_packet_queue
;
struct
timer_list
timeout
;
unsigned
long
timeout_interval
;
...
...
drivers/ieee1394/ieee1394.h
View file @
b0e15db0
drivers/ieee1394/ieee1394_core.c
View file @
b0e15db0
This diff is collapsed.
Click to expand it.
drivers/ieee1394/ieee1394_core.h
View file @
b0e15db0
...
...
@@ -12,9 +12,13 @@
struct
hpsb_packet
{
/* This struct is basically read-only for hosts with the exception of
* the data buffer contents and xnext - see below. */
struct
list_head
list
;
/* This can be used for host driver internal linking. */
/* This can be used for host driver internal linking.
*
* NOTE: This must be left in init state when the driver is done
* with it (e.g. by using list_del_init()), since the core does
* some sanity checks to make sure the packet is not on a
* driver_list when free'ing it. */
struct
list_head
driver_list
;
nodeid_t
node_id
;
...
...
@@ -27,10 +31,9 @@ struct hpsb_packet {
* queued = queued for sending
* pending = sent, waiting for response
* complete = processing completed, successful or not
* incoming = incoming packet
*/
enum
{
hpsb_unused
,
hpsb_queued
,
hpsb_pending
,
hpsb_complete
,
hpsb_incoming
hpsb_unused
,
hpsb_queued
,
hpsb_pending
,
hpsb_complete
}
__attribute__
((
packed
))
state
;
/* These are core internal. */
...
...
@@ -67,6 +70,9 @@ struct hpsb_packet {
void
(
*
complete_routine
)(
void
*
);
void
*
complete_data
;
/* XXX This is just a hack at the moment */
struct
sk_buff
*
skb
;
/* Store jiffies for implementing bus timeouts. */
unsigned
long
sendtime
;
...
...
drivers/ieee1394/ieee1394_transactions.c
View file @
b0e15db0
...
...
@@ -268,7 +268,7 @@ struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node,
if
(
length
==
0
)
return
NULL
;
packet
=
hpsb_alloc_packet
(
(
length
+
3
)
&
~
3
);
packet
=
hpsb_alloc_packet
(
length
);
if
(
!
packet
)
return
NULL
;
...
...
@@ -296,7 +296,7 @@ struct hpsb_packet *hpsb_make_writepacket (struct hpsb_host *host, nodeid_t node
if
(
length
==
0
)
return
NULL
;
packet
=
hpsb_alloc_packet
(
(
length
+
3
)
&
~
3
);
packet
=
hpsb_alloc_packet
(
length
);
if
(
!
packet
)
return
NULL
;
...
...
@@ -330,7 +330,7 @@ struct hpsb_packet *hpsb_make_streampacket(struct hpsb_host *host, u8 *buffer, i
if
(
length
==
0
)
return
NULL
;
packet
=
hpsb_alloc_packet
(
(
length
+
3
)
&
~
3
);
packet
=
hpsb_alloc_packet
(
length
);
if
(
!
packet
)
return
NULL
;
...
...
drivers/ieee1394/iso.c
View file @
b0e15db0
drivers/ieee1394/nodemgr.c
View file @
b0e15db0
...
...
@@ -356,7 +356,6 @@ static int nodemgr_rescan_bus_thread(void *__unused)
{
/* No userlevel access needed */
daemonize
(
"kfwrescan"
);
allow_signal
(
SIGTERM
);
bus_rescan_devices
(
&
ieee1394_bus_type
);
...
...
@@ -1056,13 +1055,14 @@ static int nodemgr_hotplug(struct class_device *cdev, char **envp, int num_envp,
#define PUT_ENVP(fmt,val) \
do { \
int printed; \
envp[i++] = buffer; \
length +
= snprintf(buffer, buffer_size - length, \
printed
= snprintf(buffer, buffer_size - length, \
fmt, val); \
if ((buffer_size -
length
<= 0) || (i >= num_envp)) \
if ((buffer_size -
(length+printed)
<= 0) || (i >= num_envp)) \
return -ENOMEM; \
++length;
\
buffer +=
length
; \
length += printed+1;
\
buffer +=
printed+1
; \
} while (0)
PUT_ENVP
(
"VENDOR_ID=%06x"
,
ud
->
vendor_id
);
...
...
@@ -1152,7 +1152,6 @@ static void nodemgr_update_node(struct node_entry *ne, struct csr1212_csr *csr,
static
void
nodemgr_node_scan_one
(
struct
host_info
*
hi
,
nodeid_t
nodeid
,
int
generation
)
{
...
...
@@ -1382,7 +1381,8 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
{
quadlet_t
bc
;
if
(
!
host
->
is_irm
)
/* if irm_id == -1 then there is no IRM on this bus */
if
(
!
host
->
is_irm
||
host
->
irm_id
==
(
nodeid_t
)
-
1
)
return
1
;
host
->
csr
.
broadcast_channel
|=
0x40000000
;
/* set validity bit */
...
...
@@ -1467,7 +1467,6 @@ static int nodemgr_host_thread(void *__hi)
/* No userlevel access needed */
daemonize
(
hi
->
daemon_name
);
allow_signal
(
SIGTERM
);
/* Setup our device-model entries */
nodemgr_create_host_dev_files
(
host
);
...
...
drivers/ieee1394/nodemgr.h
View file @
b0e15db0
drivers/ieee1394/ohci1394.c
View file @
b0e15db0
...
...
@@ -162,7 +162,7 @@ printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args)
printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id , ## args)
static
char
version
[]
__devinitdata
=
"$Rev: 1
172
$ Ben Collins <bcollins@debian.org>"
;
"$Rev: 1
203
$ Ben Collins <bcollins@debian.org>"
;
/* Module Parameters */
static
int
phys_dma
=
1
;
...
...
@@ -367,32 +367,6 @@ static void ohci_soft_reset(struct ti_ohci *ohci) {
DBGMSG
(
"Soft reset finished"
);
}
static
int
run_context
(
struct
ti_ohci
*
ohci
,
int
reg
,
char
*
msg
)
{
u32
nodeId
;
/* check that the node id is valid */
nodeId
=
reg_read
(
ohci
,
OHCI1394_NodeID
);
if
(
!
(
nodeId
&
0x80000000
))
{
PRINT
(
KERN_ERR
,
"Running dma failed because Node ID is not valid"
);
return
-
1
;
}
/* check that the node number != 63 */
if
((
nodeId
&
0x3f
)
==
63
)
{
PRINT
(
KERN_ERR
,
"Running dma failed because Node ID == 63"
);
return
-
1
;
}
/* Run the dma context */
reg_write
(
ohci
,
reg
,
0x8000
);
if
(
msg
)
PRINT
(
KERN_DEBUG
,
"%s"
,
msg
);
return
0
;
}
/* Generate the dma receive prgs and start the context */
static
void
initialize_dma_rcv_ctx
(
struct
dma_rcv_ctx
*
d
,
int
generate_irq
)
...
...
@@ -620,6 +594,39 @@ static void ohci_initialize(struct ti_ohci *ohci)
if
(
status
&
0x20
)
set_phy_reg
(
ohci
,
8
,
status
&
~
1
);
}
/* Serial EEPROM Sanity check. */
if
((
ohci
->
max_packet_size
<
512
)
||
(
ohci
->
max_packet_size
>
4096
))
{
/* Serial EEPROM contents are suspect, set a sane max packet
* size and print the raw contents for bug reports if verbose
* debug is enabled. */
#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
int
i
;
#endif
PRINT
(
KERN_DEBUG
,
"Serial EEPROM has suspicious values, "
"attempting to setting max_packet_size to 512 bytes"
);
reg_write
(
ohci
,
OHCI1394_BusOptions
,
(
reg_read
(
ohci
,
OHCI1394_BusOptions
)
&
0xf007
)
|
0x8002
);
ohci
->
max_packet_size
=
512
;
#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
PRINT
(
KERN_DEBUG
,
" EEPROM Present: %d"
,
(
reg_read
(
ohci
,
OHCI1394_Version
)
>>
24
)
&
0x1
);
reg_write
(
ohci
,
OHCI1394_GUID_ROM
,
0x80000000
);
for
(
i
=
0
;
((
i
<
1000
)
&&
(
reg_read
(
ohci
,
OHCI1394_GUID_ROM
)
&
0x80000000
));
i
++
)
udelay
(
10
);
for
(
i
=
0
;
i
<
0x20
;
i
++
)
{
reg_write
(
ohci
,
OHCI1394_GUID_ROM
,
0x02000000
);
PRINT
(
KERN_DEBUG
,
" EEPROM %02x: %02x"
,
i
,
(
reg_read
(
ohci
,
OHCI1394_GUID_ROM
)
>>
16
)
&
0xff
);
}
#endif
}
}
/*
...
...
@@ -798,7 +805,7 @@ static void insert_packet(struct ti_ohci *ohci,
/* queue the packet in the appropriate context queue */
list_add_tail
(
&
packet
->
driver_list
,
&
d
->
fifo_list
);
d
->
prg_ind
=
(
d
->
prg_ind
+
1
)
%
d
->
num_desc
;
d
->
prg_ind
=
(
d
->
prg_ind
+
1
)
%
d
->
num_desc
;
}
/*
...
...
@@ -807,45 +814,53 @@ static void insert_packet(struct ti_ohci *ohci,
*
* The function MUST be called with the d->lock held.
*/
static
int
dma_trm_flush
(
struct
ti_ohci
*
ohci
,
struct
dma_trm_ctx
*
d
)
static
void
dma_trm_flush
(
struct
ti_ohci
*
ohci
,
struct
dma_trm_ctx
*
d
)
{
struct
hpsb_packet
*
p
;
int
idx
,
z
;
struct
hpsb_packet
*
packet
,
*
ptmp
;
int
idx
=
d
->
prg_ind
;
int
z
=
0
;
if
(
list_empty
(
&
d
->
pending_list
)
||
d
->
free_prgs
==
0
)
return
0
;
/* insert the packets into the dma fifo */
list_for_each_entry_safe
(
packet
,
ptmp
,
&
d
->
pending_list
,
driver_list
)
{
if
(
!
d
->
free_prgs
)
break
;
p
=
driver_packet
(
d
->
pending_list
.
next
);
idx
=
d
->
prg_ind
;
z
=
(
p
->
data_size
)
?
3
:
2
;
/* For the first packet only */
if
(
!
z
)
z
=
(
packet
->
data_size
)
?
3
:
2
;
/* insert the packets into the dma fifo */
while
(
d
->
free_prgs
>
0
&&
!
list_empty
(
&
d
->
pending_list
))
{
struct
hpsb_packet
*
p
=
driver_packet
(
d
->
pending_list
.
next
);
list_del
(
&
p
->
driver_list
);
insert_packet
(
ohci
,
d
,
p
);
/* Insert the packet */
list_del_init
(
&
packet
->
driver_list
);
insert_packet
(
ohci
,
d
,
packet
);
}
if
(
d
->
free_prgs
==
0
)
DBGMSG
(
"Transmit DMA FIFO ctx=%d is full... waiting"
,
d
->
ctx
);
/* Nothing must have been done, either no free_prgs or no packets */
if
(
z
==
0
)
return
;
/* Is the context running ? (should be unless it is
the first packet to be sent in this context) */
if
(
!
(
reg_read
(
ohci
,
d
->
ctrlSet
)
&
0x8000
))
{
u32
nodeId
=
reg_read
(
ohci
,
OHCI1394_NodeID
);
DBGMSG
(
"Starting transmit DMA ctx=%d"
,
d
->
ctx
);
reg_write
(
ohci
,
d
->
cmdPtr
,
d
->
prg_bus
[
idx
]
|
z
);
run_context
(
ohci
,
d
->
ctrlSet
,
NULL
);
}
else
{
reg_write
(
ohci
,
d
->
cmdPtr
,
d
->
prg_bus
[
idx
]
|
z
);
/* Check that the node id is valid, and not 63 */
if
(
!
(
nodeId
&
0x80000000
)
||
(
nodeId
&
0x3f
)
==
63
)
PRINT
(
KERN_ERR
,
"Running dma failed because Node ID is not valid"
);
else
reg_write
(
ohci
,
d
->
ctrlSet
,
0x8000
);
}
else
{
/* Wake up the dma context if necessary */
if
(
!
(
reg_read
(
ohci
,
d
->
ctrlSet
)
&
0x400
))
{
if
(
!
(
reg_read
(
ohci
,
d
->
ctrlSet
)
&
0x400
))
DBGMSG
(
"Waking transmit DMA ctx=%d"
,
d
->
ctx
);
}
/* do this always, to avoid race condition */
reg_write
(
ohci
,
d
->
ctrlSet
,
0x1000
);
}
return
1
;
return
;
}
/* Transmission of an async or iso packet */
...
...
@@ -2201,6 +2216,7 @@ static void dma_trm_reset(struct dma_trm_ctx *d)
unsigned
long
flags
;
LIST_HEAD
(
packet_list
);
struct
ti_ohci
*
ohci
=
d
->
ohci
;
struct
hpsb_packet
*
packet
,
*
ptmp
;
ohci1394_stop_context
(
ohci
,
d
->
ctrlClear
,
NULL
);
...
...
@@ -2221,15 +2237,16 @@ static void dma_trm_reset(struct dma_trm_ctx *d)
spin_unlock_irqrestore
(
&
d
->
lock
,
flags
);
/* Now process subsystem callbacks for the packets from the
* context. */
if
(
list_empty
(
&
packet_list
))
return
;
while
(
!
list_empty
(
&
packet_list
))
{
struct
hpsb_packet
*
p
=
driver_packet
(
packet_list
.
next
);
PRINT
(
KERN_INFO
,
"AT dma reset ctx=%d, aborting transmission"
,
d
->
ctx
);
list_del
(
&
p
->
driver_list
);
hpsb_packet_sent
(
ohci
->
host
,
p
,
ACKX_ABORTED
);
PRINT
(
KERN_INFO
,
"AT dma reset ctx=%d, aborting transmission"
,
d
->
ctx
);
/* Now process subsystem callbacks for the packets from this
* context. */
list_for_each_entry_safe
(
packet
,
ptmp
,
&
packet_list
,
driver_list
)
{
list_del_init
(
&
packet
->
driver_list
);
hpsb_packet_sent
(
ohci
->
host
,
packet
,
ACKX_ABORTED
);
}
}
...
...
@@ -2393,7 +2410,8 @@ static irqreturn_t ohci_irq_handler(int irq, void *dev_id,
ohci1394_stop_context
(
ohci
,
d
->
ctrlClear
,
"reqTxComplete"
);
else
tasklet_schedule
(
&
d
->
task
);
dma_trm_tasklet
((
unsigned
long
)
d
);
//tasklet_schedule(&d->task);
event
&=
~
OHCI1394_reqTxComplete
;
}
if
(
event
&
OHCI1394_respTxComplete
)
{
...
...
@@ -2713,15 +2731,14 @@ static void dma_trm_tasklet (unsigned long data)
{
struct
dma_trm_ctx
*
d
=
(
struct
dma_trm_ctx
*
)
data
;
struct
ti_ohci
*
ohci
=
(
struct
ti_ohci
*
)(
d
->
ohci
);
struct
hpsb_packet
*
packet
;
struct
hpsb_packet
*
packet
,
*
ptmp
;
unsigned
long
flags
;
u32
status
,
ack
;
size_t
datasize
;
spin_lock_irqsave
(
&
d
->
lock
,
flags
);
while
(
!
list_empty
(
&
d
->
fifo_list
))
{
packet
=
driver_packet
(
d
->
fifo_list
.
next
);
list_for_each_entry_safe
(
packet
,
ptmp
,
&
d
->
fifo_list
,
driver_list
)
{
datasize
=
packet
->
data_size
;
if
(
datasize
&&
packet
->
type
!=
hpsb_raw
)
status
=
le32_to_cpu
(
...
...
@@ -2818,7 +2835,7 @@ static void dma_trm_tasklet (unsigned long data)
}
}
list_del
(
&
packet
->
driver_list
);
list_del_init
(
&
packet
->
driver_list
);
hpsb_packet_sent
(
ohci
->
host
,
packet
,
ack
);
if
(
datasize
)
{
...
...
drivers/ieee1394/ohci1394.h
View file @
b0e15db0
drivers/ieee1394/pcilynx.c
View file @
b0e15db0
...
...
@@ -484,8 +484,7 @@ static void send_next(struct ti_lynx *lynx, int what)
}
packet
=
driver_packet
(
d
->
queue
.
next
);
list_del
(
&
packet
->
driver_list
);
list_add_tail
(
&
packet
->
driver_list
,
&
d
->
pcl_queue
);
list_move_tail
(
&
packet
->
driver_list
,
&
d
->
pcl_queue
);
d
->
header_dma
=
pci_map_single
(
lynx
->
dev
,
packet
->
header
,
packet
->
header_size
,
PCI_DMA_TODEVICE
);
...
...
@@ -500,11 +499,9 @@ static void send_next(struct ti_lynx *lynx, int what)
pcl
.
next
=
PCL_NEXT_INVALID
;
pcl
.
async_error_next
=
PCL_NEXT_INVALID
;
pcl
.
pcl_status
=
0
;
#ifdef __BIG_ENDIAN
pcl
.
buffer
[
0
].
control
=
packet
->
speed_code
<<
14
|
packet
->
header_size
;
#else
pcl
.
buffer
[
0
].
control
=
packet
->
speed_code
<<
14
|
packet
->
header_size
|
PCL_BIGENDIAN
;
#ifdef __BIG_ENDIAN
pcl
.
buffer
[
0
].
control
|=
PCL_BIGENDIAN
;
#endif
pcl
.
buffer
[
0
].
pointer
=
d
->
header_dma
;
pcl
.
buffer
[
1
].
control
=
PCL_LAST_BUFF
|
packet
->
data_size
;
...
...
@@ -767,7 +764,7 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
get_pcl
(
lynx
,
lynx
->
async
.
pcl
,
&
pcl
);
packet
=
driver_packet
(
lynx
->
async
.
pcl_queue
.
next
);
list_del
(
&
packet
->
driver_list
);
list_del_init
(
&
packet
->
driver_list
);
pci_unmap_single
(
lynx
->
dev
,
lynx
->
async
.
header_dma
,
packet
->
header_size
,
PCI_DMA_TODEVICE
);
...
...
@@ -795,7 +792,7 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
while
(
!
list_empty
(
&
packet_list
))
{
packet
=
driver_packet
(
packet_list
.
next
);
list_del
(
&
packet
->
driver_list
);
list_del
_init
(
&
packet
->
driver_list
);
hpsb_packet_sent
(
host
,
packet
,
ACKX_ABORTED
);
}
...
...
@@ -1292,7 +1289,7 @@ static irqreturn_t lynx_irq_handler(int irq, void *dev_id,
get_pcl
(
lynx
,
lynx
->
async
.
pcl
,
&
pcl
);
packet
=
driver_packet
(
lynx
->
async
.
pcl_queue
.
next
);
list_del
(
&
packet
->
driver_list
);
list_del
_init
(
&
packet
->
driver_list
);
pci_unmap_single
(
lynx
->
dev
,
lynx
->
async
.
header_dma
,
packet
->
header_size
,
PCI_DMA_TODEVICE
);
...
...
@@ -1338,7 +1335,7 @@ static irqreturn_t lynx_irq_handler(int irq, void *dev_id,
get_pcl
(
lynx
,
lynx
->
iso_send
.
pcl
,
&
pcl
);
packet
=
driver_packet
(
lynx
->
iso_send
.
pcl_queue
.
next
);
list_del
(
&
packet
->
driver_list
);
list_del
_init
(
&
packet
->
driver_list
);
pci_unmap_single
(
lynx
->
dev
,
lynx
->
iso_send
.
header_dma
,
packet
->
header_size
,
PCI_DMA_TODEVICE
);
...
...
@@ -1460,7 +1457,7 @@ static void remove_card(struct pci_dev *dev)
reg_write
(
lynx
,
PCI_INT_ENABLE
,
0
);
free_irq
(
lynx
->
dev
->
irq
,
lynx
);
/* Disable IRM Contender */
/* Disable IRM Contender
and LCtrl
*/
if
(
lynx
->
phyic
.
reg_1394a
)
set_phy_reg
(
lynx
,
4
,
~
0xc0
&
get_phy_reg
(
lynx
,
4
));
...
...
@@ -1698,13 +1695,13 @@ static int __devinit add_card(struct pci_dev *dev,
pcl
.
next
=
PCL_NEXT_INVALID
;
pcl
.
async_error_next
=
PCL_NEXT_INVALID
;
#ifdef __BIG_ENDIAN
pcl
.
buffer
[
0
].
control
=
PCL_CMD_RCV
|
16
;
pcl
.
buffer
[
1
].
control
=
PCL_LAST_BUFF
|
4080
;
#else
pcl
.
buffer
[
0
].
control
=
PCL_CMD_RCV
|
PCL_BIGENDIAN
|
16
;
pcl
.
buffer
[
1
].
control
=
PCL_LAST_BUFF
|
4080
;
#ifdef __BIG_ENDIAN
pcl
.
buffer
[
0
].
control
|=
PCL_BIGENDIAN
;
#endif
pcl
.
buffer
[
1
].
control
=
PCL_LAST_BUFF
|
4080
;
pcl
.
buffer
[
0
].
pointer
=
lynx
->
rcv_page_dma
;
pcl
.
buffer
[
1
].
pointer
=
lynx
->
rcv_page_dma
+
16
;
put_pcl
(
lynx
,
lynx
->
rcv_pcl
,
&
pcl
);
...
...
@@ -1788,12 +1785,12 @@ static int __devinit add_card(struct pci_dev *dev,
reg_set_bits
(
lynx
,
GPIO_CTRL_A
,
0x1
);
reg_write
(
lynx
,
GPIO_DATA_BASE
+
0x3c
,
0x1
);
}
else
{
/* set the contender bit in the extended PHY register
/* set the contender
and LCtrl
bit in the extended PHY register
* set. (Should check that bis 0,1,2 (=0xE0) is set
* in register 2?)
*/
i
=
get_phy_reg
(
lynx
,
4
);
if
(
i
!=
-
1
)
set_phy_reg
(
lynx
,
4
,
i
|
0x
4
0
);
if
(
i
!=
-
1
)
set_phy_reg
(
lynx
,
4
,
i
|
0x
c
0
);
}
...
...
drivers/ieee1394/pcilynx.h
View file @
b0e15db0
drivers/ieee1394/raw1394-private.h
View file @
b0e15db0
drivers/ieee1394/raw1394.c
View file @
b0e15db0
...
...
@@ -807,8 +807,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
int
expect_response
=
req
->
req
.
misc
>>
16
;
if
((
header_length
>
req
->
req
.
length
)
||
(
header_length
<
12
))
{
(
header_length
<
12
))
{
req
->
req
.
error
=
RAW1394_ERROR_INVALID_ARG
;
req
->
req
.
length
=
0
;
queue_complete_req
(
req
);
...
...
@@ -2746,9 +2745,9 @@ static int __init init_raw1394(void)
cdev_init
(
&
raw1394_cdev
,
&
raw1394_fops
);
raw1394_cdev
.
owner
=
THIS_MODULE
;
kobject_set_name
(
&
raw1394_cdev
.
kobj
,
RAW1394_DEVICE_NAME
);
ret
=
cdev_add
(
&
raw1394_cdev
,
IEEE1394_RAW1394_DEV
,
1
);
if
(
ret
)
{
/* jmc: leaves reference to (static) raw1394_cdev */
HPSB_ERR
(
"raw1394 failed to register minor device block"
);
devfs_remove
(
RAW1394_DEVICE_NAME
);
hpsb_unregister_highlevel
(
&
raw1394_highlevel
);
...
...
drivers/ieee1394/sbp2.c
View file @
b0e15db0
...
...
@@ -78,7 +78,7 @@
#include "sbp2.h"
static
char
version
[]
__devinitdata
=
"$Rev: 1
170
$ Ben Collins <bcollins@debian.org>"
;
"$Rev: 1
205
$ Ben Collins <bcollins@debian.org>"
;
/*
* Module load parameter definitions
...
...
@@ -658,7 +658,7 @@ static int sbp2_update(struct unit_directory *ud)
if
(
sbp2_login_device
(
scsi_id
))
{
/* Login failed too, just fail, and the backend
* will call our sbp2_remove for us */
SBP2_
INFO
(
"sbp2_reconnect_device failed
!"
);
SBP2_
ERR
(
"Failed to reconnect to sbp2 device
!"
);
return
-
EBUSY
;
}
}
...
...
@@ -906,7 +906,6 @@ static int sbp2_start_device(struct scsi_id_instance_data *scsi_id)
set_current_state
(
TASK_INTERRUPTIBLE
);
schedule_timeout
(
HZ
);
/*
* Login to the sbp-2 device
*/
...
...
@@ -1314,6 +1313,7 @@ static int sbp2_logout_device(struct scsi_id_instance_data *scsi_id)
{
struct
sbp2scsi_host_info
*
hi
=
scsi_id
->
hi
;
quadlet_t
data
[
2
];
int
error
;
SBP2_DEBUG
(
"sbp2_logout_device"
);
...
...
@@ -1354,10 +1354,15 @@ static int sbp2_logout_device(struct scsi_id_instance_data *scsi_id)
atomic_set
(
&
scsi_id
->
sbp2_login_complete
,
0
);
hpsb_node_write
(
scsi_id
->
ne
,
scsi_id
->
sbp2_management_agent_addr
,
data
,
8
);
error
=
hpsb_node_write
(
scsi_id
->
ne
,
scsi_id
->
sbp2_management_agent_addr
,
data
,
8
);
if
(
error
)
return
error
;
/* Wait for device to logout...1 second. */
sbp2util_down_timeout
(
&
scsi_id
->
sbp2_login_complete
,
HZ
);
if
(
sbp2util_down_timeout
(
&
scsi_id
->
sbp2_login_complete
,
HZ
))
return
-
EIO
;
SBP2_INFO
(
"Logged out of SBP-2 device"
);
...
...
@@ -1373,6 +1378,7 @@ static int sbp2_reconnect_device(struct scsi_id_instance_data *scsi_id)
{
struct
sbp2scsi_host_info
*
hi
=
scsi_id
->
hi
;
quadlet_t
data
[
2
];
int
error
;
SBP2_DEBUG
(
"sbp2_reconnect_device"
);
...
...
@@ -1419,7 +1425,11 @@ static int sbp2_reconnect_device(struct scsi_id_instance_data *scsi_id)
atomic_set
(
&
scsi_id
->
sbp2_login_complete
,
0
);
hpsb_node_write
(
scsi_id
->
ne
,
scsi_id
->
sbp2_management_agent_addr
,
data
,
8
);
error
=
hpsb_node_write
(
scsi_id
->
ne
,
scsi_id
->
sbp2_management_agent_addr
,
data
,
8
);
if
(
error
)
return
error
;
/*
* Wait for reconnect status (up to 1 second)...
...
...
@@ -1448,7 +1458,7 @@ static int sbp2_reconnect_device(struct scsi_id_instance_data *scsi_id)
return
(
-
EIO
);
}
SBP2_INFO
(
"Reconnected to SBP-2 device"
);
HPSB_DEBUG
(
"Reconnected to SBP-2 device"
);
return
(
0
);
...
...
@@ -1638,7 +1648,7 @@ static int sbp2_max_speed_and_size(struct scsi_id_instance_data *scsi_id)
scsi_id
->
max_payload_size
=
min
(
sbp2_speedto_max_payload
[
scsi_id
->
speed_code
],
(
u8
)(
hi
->
host
->
csr
.
max_rec
-
1
));
SBP2_ERR
(
"Node "
NODE_BUS_FMT
": Max speed [%s] - Max payload [%u]"
,
HPSB_DEBUG
(
"Node "
NODE_BUS_FMT
": Max speed [%s] - Max payload [%u]"
,
NODE_BUS_ARGS
(
hi
->
host
,
scsi_id
->
ne
->
nodeid
),
hpsb_speedto_str
[
scsi_id
->
speed_code
],
1
<<
((
u32
)
scsi_id
->
max_payload_size
+
2
));
...
...
@@ -2278,7 +2288,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
scsi_buf
[
2
]
=
scsi_buf
[
3
];
/* Device specific parameter */
scsi_buf
[
3
]
=
scsi_buf
[
7
];
/* Block descriptor length */
memcpy
(
scsi_buf
+
4
,
scsi_buf
+
8
,
scsi_buf
[
0
]);
}
break
;
...
...
drivers/ieee1394/sbp2.h
View file @
b0e15db0
drivers/ieee1394/video1394.c
View file @
b0e15db0
...
...
@@ -1438,7 +1438,7 @@ static void __exit video1394_exit_module (void)
ret
|=
unregister_ioctl32_conversion
(
VIDEO1394_IOC32_TALK_WAIT_BUFFER
);
ret
|=
unregister_ioctl32_conversion
(
VIDEO1394_IOC32_LISTEN_POLL_BUFFER
);
if
(
ret
)
PRINT_G
(
KERN_
INFO
,
"Error unregistering ioctl32 translations"
);
PRINT_G
(
KERN_
CRIT
,
"Error unregistering ioctl32 translations"
);
#endif
hpsb_unregister_protocol
(
&
video1394_driver
);
...
...
@@ -1457,6 +1457,7 @@ static int __init video1394_init_module (void)
cdev_init
(
&
video1394_cdev
,
&
video1394_fops
);
video1394_cdev
.
owner
=
THIS_MODULE
;
kobject_set_name
(
&
video1394_cdev
.
kobj
,
VIDEO1394_DRIVER_NAME
);
ret
=
cdev_add
(
&
video1394_cdev
,
IEEE1394_VIDEO1394_DEV
,
16
);
if
(
ret
)
{
PRINT_G
(
KERN_ERR
,
"video1394: unable to get minor device block"
);
...
...
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