Commit 741854e4 authored by Stefan Richter's avatar Stefan Richter Committed by Jody McIntyre

ieee1394: whitespace cleanup in hosts.[ch], ieee1394_core.[ch]

Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: default avatarJody McIntyre <scjody@modernduck.com>
parent 546513f9
...@@ -61,12 +61,12 @@ static void delayed_reset_bus(void * __reset_info) ...@@ -61,12 +61,12 @@ static void delayed_reset_bus(void * __reset_info)
static int dummy_transmit_packet(struct hpsb_host *h, struct hpsb_packet *p) static int dummy_transmit_packet(struct hpsb_host *h, struct hpsb_packet *p)
{ {
return 0; return 0;
} }
static int dummy_devctl(struct hpsb_host *h, enum devctl_cmd c, int arg) static int dummy_devctl(struct hpsb_host *h, enum devctl_cmd c, int arg)
{ {
return -1; return -1;
} }
static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg) static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg)
...@@ -75,9 +75,9 @@ static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned ...@@ -75,9 +75,9 @@ static int dummy_isoctl(struct hpsb_iso *iso, enum isoctl_cmd command, unsigned
} }
static struct hpsb_host_driver dummy_driver = { static struct hpsb_host_driver dummy_driver = {
.transmit_packet = dummy_transmit_packet, .transmit_packet = dummy_transmit_packet,
.devctl = dummy_devctl, .devctl = dummy_devctl,
.isoctl = dummy_isoctl .isoctl = dummy_isoctl
}; };
static int alloc_hostnum_cb(struct hpsb_host *host, void *__data) static int alloc_hostnum_cb(struct hpsb_host *host, void *__data)
...@@ -110,12 +110,12 @@ static DECLARE_MUTEX(host_num_alloc); ...@@ -110,12 +110,12 @@ static DECLARE_MUTEX(host_num_alloc);
struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
struct device *dev) struct device *dev)
{ {
struct hpsb_host *h; struct hpsb_host *h;
int i; int i;
int hostnum = 0; int hostnum = 0;
h = kzalloc(sizeof(*h) + extra, SLAB_KERNEL); h = kzalloc(sizeof(*h) + extra, SLAB_KERNEL);
if (!h) if (!h)
return NULL; return NULL;
h->csr.rom = csr1212_create_csr(&csr_bus_ops, CSR_BUS_INFO_SIZE, h); h->csr.rom = csr1212_create_csr(&csr_bus_ops, CSR_BUS_INFO_SIZE, h);
...@@ -125,7 +125,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, ...@@ -125,7 +125,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
} }
h->hostdata = h + 1; h->hostdata = h + 1;
h->driver = drv; h->driver = drv;
skb_queue_head_init(&h->pending_packet_queue); skb_queue_head_init(&h->pending_packet_queue);
INIT_LIST_HEAD(&h->addr_space); INIT_LIST_HEAD(&h->addr_space);
...@@ -145,8 +145,8 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, ...@@ -145,8 +145,8 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra,
h->timeout.function = abort_timedouts; h->timeout.function = abort_timedouts;
h->timeout_interval = HZ / 20; // 50ms by default h->timeout_interval = HZ / 20; // 50ms by default
h->topology_map = h->csr.topology_map + 3; h->topology_map = h->csr.topology_map + 3;
h->speed_map = (u8 *)(h->csr.speed_map + 2); h->speed_map = (u8 *)(h->csr.speed_map + 2);
down(&host_num_alloc); down(&host_num_alloc);
...@@ -186,14 +186,14 @@ int hpsb_add_host(struct hpsb_host *host) ...@@ -186,14 +186,14 @@ int hpsb_add_host(struct hpsb_host *host)
void hpsb_remove_host(struct hpsb_host *host) void hpsb_remove_host(struct hpsb_host *host)
{ {
host->is_shutdown = 1; host->is_shutdown = 1;
cancel_delayed_work(&host->delayed_reset); cancel_delayed_work(&host->delayed_reset);
flush_scheduled_work(); flush_scheduled_work();
host->driver = &dummy_driver; host->driver = &dummy_driver;
highlevel_remove_host(host); highlevel_remove_host(host);
hpsb_remove_extra_config_roms(host); hpsb_remove_extra_config_roms(host);
......
...@@ -17,47 +17,47 @@ struct hpsb_packet; ...@@ -17,47 +17,47 @@ struct hpsb_packet;
struct hpsb_iso; struct hpsb_iso;
struct hpsb_host { struct hpsb_host {
struct list_head host_list; struct list_head host_list;
void *hostdata; void *hostdata;
atomic_t generation; atomic_t generation;
struct sk_buff_head pending_packet_queue; struct sk_buff_head pending_packet_queue;
struct timer_list timeout; struct timer_list timeout;
unsigned long timeout_interval; unsigned long timeout_interval;
unsigned char iso_listen_count[64]; unsigned char iso_listen_count[64];
int node_count; /* number of identified nodes on this bus */ int node_count; /* number of identified nodes on this bus */
int selfid_count; /* total number of SelfIDs received */ int selfid_count; /* total number of SelfIDs received */
int nodes_active; /* number of nodes that are actually active */ int nodes_active; /* number of nodes that are actually active */
nodeid_t node_id; /* node ID of this host */ nodeid_t node_id; /* node ID of this host */
nodeid_t irm_id; /* ID of this bus' isochronous resource manager */ nodeid_t irm_id; /* ID of this bus' isochronous resource manager */
nodeid_t busmgr_id; /* ID of this bus' bus manager */ nodeid_t busmgr_id; /* ID of this bus' bus manager */
/* this nodes state */ /* this nodes state */
unsigned in_bus_reset:1; unsigned in_bus_reset:1;
unsigned is_shutdown:1; unsigned is_shutdown:1;
unsigned resume_packet_sent:1; unsigned resume_packet_sent:1;
/* this nodes' duties on the bus */ /* this nodes' duties on the bus */
unsigned is_root:1; unsigned is_root:1;
unsigned is_cycmst:1; unsigned is_cycmst:1;
unsigned is_irm:1; unsigned is_irm:1;
unsigned is_busmgr:1; unsigned is_busmgr:1;
int reset_retries; int reset_retries;
quadlet_t *topology_map; quadlet_t *topology_map;
u8 *speed_map; u8 *speed_map;
struct csr_control csr; struct csr_control csr;
/* Per node tlabel pool allocation */ /* Per node tlabel pool allocation */
struct hpsb_tlabel_pool tpool[64]; struct hpsb_tlabel_pool tpool[64];
struct hpsb_host_driver *driver; struct hpsb_host_driver *driver;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -77,34 +77,34 @@ struct hpsb_host { ...@@ -77,34 +77,34 @@ struct hpsb_host {
enum devctl_cmd { enum devctl_cmd {
/* Host is requested to reset its bus and cancel all outstanding async /* Host is requested to reset its bus and cancel all outstanding async
* requests. If arg == 1, it shall also attempt to become root on the * requests. If arg == 1, it shall also attempt to become root on the
* bus. Return void. */ * bus. Return void. */
RESET_BUS, RESET_BUS,
/* Arg is void, return value is the hardware cycle counter value. */ /* Arg is void, return value is the hardware cycle counter value. */
GET_CYCLE_COUNTER, GET_CYCLE_COUNTER,
/* Set the hardware cycle counter to the value in arg, return void. /* Set the hardware cycle counter to the value in arg, return void.
* FIXME - setting is probably not required. */ * FIXME - setting is probably not required. */
SET_CYCLE_COUNTER, SET_CYCLE_COUNTER,
/* Configure hardware for new bus ID in arg, return void. */ /* Configure hardware for new bus ID in arg, return void. */
SET_BUS_ID, SET_BUS_ID,
/* If arg true, start sending cycle start packets, stop if arg == 0. /* If arg true, start sending cycle start packets, stop if arg == 0.
* Return void. */ * Return void. */
ACT_CYCLE_MASTER, ACT_CYCLE_MASTER,
/* Cancel all outstanding async requests without resetting the bus. /* Cancel all outstanding async requests without resetting the bus.
* Return void. */ * Return void. */
CANCEL_REQUESTS, CANCEL_REQUESTS,
/* Start or stop receiving isochronous channel in arg. Return void. /* Start or stop receiving isochronous channel in arg. Return void.
* This acts as an optimization hint, hosts are not required not to * This acts as an optimization hint, hosts are not required not to
* listen on unrequested channels. */ * listen on unrequested channels. */
ISO_LISTEN_CHANNEL, ISO_LISTEN_CHANNEL,
ISO_UNLISTEN_CHANNEL ISO_UNLISTEN_CHANNEL
}; };
enum isoctl_cmd { enum isoctl_cmd {
...@@ -135,13 +135,13 @@ enum isoctl_cmd { ...@@ -135,13 +135,13 @@ enum isoctl_cmd {
}; };
enum reset_types { enum reset_types {
/* 166 microsecond reset -- only type of reset available on /* 166 microsecond reset -- only type of reset available on
non-1394a capable controllers */ non-1394a capable controllers */
LONG_RESET, LONG_RESET,
/* Short (arbitrated) reset -- only available on 1394a capable /* Short (arbitrated) reset -- only available on 1394a capable
controllers */ controllers */
SHORT_RESET, SHORT_RESET,
/* Variants that set force_root before issueing the bus reset */ /* Variants that set force_root before issueing the bus reset */
LONG_RESET_FORCE_ROOT, SHORT_RESET_FORCE_ROOT, LONG_RESET_FORCE_ROOT, SHORT_RESET_FORCE_ROOT,
...@@ -159,22 +159,22 @@ struct hpsb_host_driver { ...@@ -159,22 +159,22 @@ struct hpsb_host_driver {
* reads to the ConfigROM on its own. */ * reads to the ConfigROM on its own. */
void (*set_hw_config_rom) (struct hpsb_host *host, quadlet_t *config_rom); void (*set_hw_config_rom) (struct hpsb_host *host, quadlet_t *config_rom);
/* This function shall implement packet transmission based on /* This function shall implement packet transmission based on
* packet->type. It shall CRC both parts of the packet (unless * packet->type. It shall CRC both parts of the packet (unless
* packet->type == raw) and do byte-swapping as necessary or instruct * packet->type == raw) and do byte-swapping as necessary or instruct
* the hardware to do so. It can return immediately after the packet * the hardware to do so. It can return immediately after the packet
* was queued for sending. After sending, hpsb_sent_packet() has to be * was queued for sending. After sending, hpsb_sent_packet() has to be
* called. Return 0 on success, negative errno on failure. * called. Return 0 on success, negative errno on failure.
* NOTE: The function must be callable in interrupt context. * NOTE: The function must be callable in interrupt context.
*/ */
int (*transmit_packet) (struct hpsb_host *host, int (*transmit_packet) (struct hpsb_host *host,
struct hpsb_packet *packet); struct hpsb_packet *packet);
/* This function requests miscellanous services from the driver, see /* This function requests miscellanous services from the driver, see
* above for command codes and expected actions. Return -1 for unknown * above for command codes and expected actions. Return -1 for unknown
* command, though that should never happen. * command, though that should never happen.
*/ */
int (*devctl) (struct hpsb_host *host, enum devctl_cmd command, int arg); int (*devctl) (struct hpsb_host *host, enum devctl_cmd command, int arg);
/* ISO transmission/reception functions. Return 0 on success, -1 /* ISO transmission/reception functions. Return 0 on success, -1
* (or -EXXX errno code) on failure. If the low-level driver does not * (or -EXXX errno code) on failure. If the low-level driver does not
...@@ -182,15 +182,15 @@ struct hpsb_host_driver { ...@@ -182,15 +182,15 @@ struct hpsb_host_driver {
*/ */
int (*isoctl) (struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg); int (*isoctl) (struct hpsb_iso *iso, enum isoctl_cmd command, unsigned long arg);
/* This function is mainly to redirect local CSR reads/locks to the iso /* This function is mainly to redirect local CSR reads/locks to the iso
* management registers (bus manager id, bandwidth available, channels * management registers (bus manager id, bandwidth available, channels
* available) to the hardware registers in OHCI. reg is 0,1,2,3 for bus * available) to the hardware registers in OHCI. reg is 0,1,2,3 for bus
* mgr, bwdth avail, ch avail hi, ch avail lo respectively (the same ids * mgr, bwdth avail, ch avail hi, ch avail lo respectively (the same ids
* as OHCI uses). data and compare are the new data and expected data * as OHCI uses). data and compare are the new data and expected data
* respectively, return value is the old value. * respectively, return value is the old value.
*/ */
quadlet_t (*hw_csr_reg) (struct hpsb_host *host, int reg, quadlet_t (*hw_csr_reg) (struct hpsb_host *host, int reg,
quadlet_t data, quadlet_t compare); quadlet_t data, quadlet_t compare);
}; };
......
This diff is collapsed.
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
struct hpsb_packet { struct hpsb_packet {
/* This struct is basically read-only for hosts with the exception of /* This struct is basically read-only for hosts with the exception of
* the data buffer contents and xnext - see below. */ * the data buffer contents and xnext - see below. */
/* This can be used for host driver internal linking. /* This can be used for host driver internal linking.
* *
...@@ -21,47 +21,47 @@ struct hpsb_packet { ...@@ -21,47 +21,47 @@ struct hpsb_packet {
* driver_list when free'ing it. */ * driver_list when free'ing it. */
struct list_head driver_list; struct list_head driver_list;
nodeid_t node_id; nodeid_t node_id;
/* Async and Iso types should be clear, raw means send-as-is, do not /* Async and Iso types should be clear, raw means send-as-is, do not
* CRC! Byte swapping shall still be done in this case. */ * CRC! Byte swapping shall still be done in this case. */
enum { hpsb_async, hpsb_iso, hpsb_raw } __attribute__((packed)) type; enum { hpsb_async, hpsb_iso, hpsb_raw } __attribute__((packed)) type;
/* Okay, this is core internal and a no care for hosts. /* Okay, this is core internal and a no care for hosts.
* queued = queued for sending * queued = queued for sending
* pending = sent, waiting for response * pending = sent, waiting for response
* complete = processing completed, successful or not * complete = processing completed, successful or not
*/ */
enum { enum {
hpsb_unused, hpsb_queued, hpsb_pending, hpsb_complete hpsb_unused, hpsb_queued, hpsb_pending, hpsb_complete
} __attribute__((packed)) state; } __attribute__((packed)) state;
/* These are core internal. */ /* These are core internal. */
signed char tlabel; signed char tlabel;
signed char ack_code; signed char ack_code;
unsigned char tcode; unsigned char tcode;
unsigned expect_response:1; unsigned expect_response:1;
unsigned no_waiter:1; unsigned no_waiter:1;
/* Speed to transmit with: 0 = 100Mbps, 1 = 200Mbps, 2 = 400Mbps */ /* Speed to transmit with: 0 = 100Mbps, 1 = 200Mbps, 2 = 400Mbps */
unsigned speed_code:2; unsigned speed_code:2;
/* /*
* *header and *data are guaranteed to be 32-bit DMAable and may be * *header and *data are guaranteed to be 32-bit DMAable and may be
* overwritten to allow in-place byte swapping. Neither of these is * overwritten to allow in-place byte swapping. Neither of these is
* CRCed (the sizes also don't include CRC), but contain space for at * CRCed (the sizes also don't include CRC), but contain space for at
* least one additional quadlet to allow in-place CRCing. The memory is * least one additional quadlet to allow in-place CRCing. The memory is
* also guaranteed to be DMA mappable. * also guaranteed to be DMA mappable.
*/ */
quadlet_t *header; quadlet_t *header;
quadlet_t *data; quadlet_t *data;
size_t header_size; size_t header_size;
size_t data_size; size_t data_size;
struct hpsb_host *host; struct hpsb_host *host;
unsigned int generation; unsigned int generation;
atomic_t refcnt; atomic_t refcnt;
...@@ -73,10 +73,10 @@ struct hpsb_packet { ...@@ -73,10 +73,10 @@ struct hpsb_packet {
/* XXX This is just a hack at the moment */ /* XXX This is just a hack at the moment */
struct sk_buff *skb; struct sk_buff *skb;
/* Store jiffies for implementing bus timeouts. */ /* Store jiffies for implementing bus timeouts. */
unsigned long sendtime; unsigned long sendtime;
quadlet_t embedded_header[5]; quadlet_t embedded_header[5];
}; };
/* Set a task for when a packet completes */ /* Set a task for when a packet completes */
...@@ -102,7 +102,7 @@ void hpsb_free_packet(struct hpsb_packet *packet); ...@@ -102,7 +102,7 @@ void hpsb_free_packet(struct hpsb_packet *packet);
*/ */
static inline unsigned int get_hpsb_generation(struct hpsb_host *host) static inline unsigned int get_hpsb_generation(struct hpsb_host *host)
{ {
return atomic_read(&host->generation); return atomic_read(&host->generation);
} }
/* /*
...@@ -157,7 +157,7 @@ void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot); ...@@ -157,7 +157,7 @@ void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot);
* from within a transmit packet routine. * from within a transmit packet routine.
*/ */
void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet, void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
int ackcode); int ackcode);
/* /*
* Hand over received packet to the core. The contents of data are expected to * Hand over received packet to the core. The contents of data are expected to
...@@ -171,7 +171,7 @@ void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet, ...@@ -171,7 +171,7 @@ void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
* packet type. * packet type.
*/ */
void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size, void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
int write_acked); int write_acked);
/* /*
...@@ -197,20 +197,20 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size, ...@@ -197,20 +197,20 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
* Block 15 (240-255) reserved for drivers under development, etc. * Block 15 (240-255) reserved for drivers under development, etc.
*/ */
#define IEEE1394_MAJOR 171 #define IEEE1394_MAJOR 171
#define IEEE1394_MINOR_BLOCK_RAW1394 0 #define IEEE1394_MINOR_BLOCK_RAW1394 0
#define IEEE1394_MINOR_BLOCK_VIDEO1394 1 #define IEEE1394_MINOR_BLOCK_VIDEO1394 1
#define IEEE1394_MINOR_BLOCK_DV1394 2 #define IEEE1394_MINOR_BLOCK_DV1394 2
#define IEEE1394_MINOR_BLOCK_AMDTP 3 #define IEEE1394_MINOR_BLOCK_AMDTP 3
#define IEEE1394_MINOR_BLOCK_EXPERIMENTAL 15 #define IEEE1394_MINOR_BLOCK_EXPERIMENTAL 15
#define IEEE1394_CORE_DEV MKDEV(IEEE1394_MAJOR, 0) #define IEEE1394_CORE_DEV MKDEV(IEEE1394_MAJOR, 0)
#define IEEE1394_RAW1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16) #define IEEE1394_RAW1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)
#define IEEE1394_VIDEO1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_VIDEO1394 * 16) #define IEEE1394_VIDEO1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_VIDEO1394 * 16)
#define IEEE1394_DV1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16) #define IEEE1394_DV1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16)
#define IEEE1394_AMDTP_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_AMDTP * 16) #define IEEE1394_AMDTP_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_AMDTP * 16)
#define IEEE1394_EXPERIMENTAL_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16) #define IEEE1394_EXPERIMENTAL_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16)
/* return the index (within a minor number block) of a file */ /* return the index (within a minor number block) of a file */
static inline unsigned char ieee1394_file_to_instance(struct file *file) static inline unsigned char ieee1394_file_to_instance(struct file *file)
......
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