Commit a4ccbdfa authored by Ben Collins's avatar Ben Collins

[IEEE-1394] Sync IEEE-1394 to r1203

parent 45de4540
......@@ -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;
......
......@@ -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) {
......
......@@ -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)
......
......@@ -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 */
......@@ -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;
......
......@@ -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");
......
......@@ -89,7 +89,7 @@
#define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__)
static char version[] __devinitdata =
"$Rev: 1175 $ Ben Collins <bcollins@debian.org>";
"$Rev: 1198 $ 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: 1175 $");
strcpy (info.version, "$Rev: 1198 $");
/* FIXME XXX provide sane businfo */
strcpy (info.bus_info, "ieee1394");
if (copy_to_user (useraddr, &info, sizeof (info)))
......
......@@ -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);
......
......@@ -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;
......
This diff is collapsed.
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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: 1172 $ Ben Collins <bcollins@debian.org>";
"$Rev: 1203 $ 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)
......@@ -831,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;
}
/*
......@@ -840,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 */
......@@ -2234,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);
......@@ -2254,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);
}
}
......@@ -2426,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) {
......@@ -2746,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(
......@@ -2851,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) {
......
......@@ -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);
......@@ -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);
......
......@@ -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);
......
......@@ -78,7 +78,7 @@
#include "sbp2.h"
static char version[] __devinitdata =
"$Rev: 1170 $ Ben Collins <bcollins@debian.org>";
"$Rev: 1200 $ 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
*/
......@@ -1354,10 +1353,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);
int 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");
......@@ -1419,7 +1423,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);
int 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 +1456,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 +1646,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 +2286,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;
......
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment