summaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/ohci1394.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/ohci1394.h')
-rw-r--r--drivers/ieee1394/ohci1394.h133
1 files changed, 87 insertions, 46 deletions
diff --git a/drivers/ieee1394/ohci1394.h b/drivers/ieee1394/ohci1394.h
index d778cbe7d..af1aeb2a6 100644
--- a/drivers/ieee1394/ohci1394.h
+++ b/drivers/ieee1394/ohci1394.h
@@ -22,8 +22,8 @@
#define _OHCI1394_H
#include "ieee1394_types.h"
-/* include this for the video frame grabber */
-/* #include "video1394.h" */
+
+#define IEEE1394_USE_BOTTOM_HALVES 0
#define OHCI1394_DRIVER_NAME "ohci1394"
@@ -71,6 +71,18 @@
#define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018
#endif
+#ifndef PCI_DEVICE_ID_ALI_OHCI1394_M5251
+#define PCI_DEVICE_ID_ALI_OHCI1394_M5251 0x5251
+#endif
+
+#ifndef PCI_VENDOR_ID_LUCENT
+#define PCI_VENDOR_ID_LUCENT 0x11c1
+#endif
+
+#ifndef PCI_DEVICE_ID_LUCENT_FW323
+#define PCI_DEVICE_ID_LUCENT_FW323 0x5811
+#endif
+
#define MAX_OHCI1394_CARDS 4
#define OHCI1394_MAX_AT_REQ_RETRIES 0x2
@@ -87,8 +99,8 @@
#define AR_RESP_SPLIT_BUF_SIZE 4096 /* split packet buffer */
#define IR_NUM_DESC 16 /* number of IR descriptors */
-#define IR_BUF_SIZE 6480 /* 6480 bytes/buffer */
-#define IR_SPLIT_BUF_SIZE 8192 /* split packet buffer */
+#define IR_BUF_SIZE 4096 /* 6480 bytes/buffer */
+#define IR_SPLIT_BUF_SIZE 4096 /* split packet buffer */
#define AT_REQ_NUM_DESC 32 /* number of AT req descriptors */
#define AT_RESP_NUM_DESC 32 /* number of AT resp descriptors */
@@ -113,8 +125,15 @@ struct dma_rcv_ctx {
unsigned int num_desc;
unsigned int buf_size;
unsigned int split_buf_size;
- struct dma_cmd **prg;
- quadlet_t **buf;
+
+ /* dma block descriptors */
+ struct dma_cmd **prg_cpu;
+ dma_addr_t *prg_bus;
+
+ /* dma buffers */
+ quadlet_t **buf_cpu;
+ dma_addr_t *buf_bus;
+
unsigned int buf_ind;
unsigned int buf_offset;
quadlet_t *spb;
@@ -130,45 +149,37 @@ struct dma_trm_ctx {
void *ohci;
int ctx;
unsigned int num_desc;
- struct at_dma_prg *prg;
+
+ /* dma block descriptors */
+ struct at_dma_prg **prg_cpu;
+ dma_addr_t *prg_bus;
+
unsigned int prg_ind;
unsigned int sent_ind;
int free_prgs;
quadlet_t *branchAddrPtr;
- struct hpsb_packet *first;
- struct hpsb_packet *last;
+
+ /* list of packets inserted in the AT FIFO */
+ struct hpsb_packet *fifo_first;
+ struct hpsb_packet *fifo_last;
+
+ /* list of pending packets to be inserted in the AT FIFO */
+ struct hpsb_packet *pending_first;
+ struct hpsb_packet *pending_last;
+
spinlock_t lock;
struct tq_struct task;
int ctrlClear;
int ctrlSet;
int cmdPtr;
- wait_queue_head_t waitq;
};
-#ifdef _VIDEO_1394_H
-
-#define OHCI1394_MAJOR 172
-#define ISO_CHANNELS 64
-
-struct dma_fbuf_ctx {
- void *ohci;
- int ctx;
- int channel;
- int last_buffer;
- unsigned int num_desc;
- unsigned int buf_size;
- unsigned int frame_size;
- unsigned int nb_cmd;
- unsigned char *buf;
- struct dma_cmd **prg;
- unsigned int *buffer_status;
- int ctrlClear;
- int ctrlSet;
- int cmdPtr;
- int ctxMatch;
- wait_queue_head_t waitq;
+/* video device template */
+struct video_template {
+ void (*irq_handler) (int card, quadlet_t isoRecvEvent,
+ quadlet_t isoXmitEvent);
};
-#endif
+
struct ti_ohci {
int id; /* sequential card number */
@@ -180,8 +191,13 @@ struct ti_ohci {
/* remapped memory spaces */
void *registers;
- quadlet_t *self_id_buffer; /* dma buffer for self-id packets */
- quadlet_t *csr_config_rom; /* buffer for csr config rom */
+ /* dma buffer for self-id packets */
+ quadlet_t *selfid_buf_cpu;
+ dma_addr_t selfid_buf_bus;
+
+ /* buffer for csr config rom */
+ quadlet_t *csr_config_rom_cpu;
+ dma_addr_t csr_config_rom_bus;
unsigned int max_packet_size;
@@ -197,13 +213,10 @@ struct ti_ohci {
struct dma_rcv_ctx *ir_context;
u64 IR_channel_usage;
spinlock_t IR_channel_lock;
- int nb_iso_ctx;
+ int nb_iso_rcv_ctx;
-#ifdef _VIDEO_1394_H
- /* frame buffer context */
- struct dma_fbuf_ctx **fbuf_context;
- struct dma_fbuf_ctx *current_fbuf_ctx;
-#endif
+ /* iso transmit */
+ int nb_iso_xmit_ctx;
/* IEEE-1394 part follows */
struct hpsb_host *host;
@@ -214,8 +227,23 @@ struct ti_ohci {
int self_id_errors;
int NumBusResets;
+
+ /* video device */
+ struct video_template *video_tmpl;
};
+inline static int cross_bound(unsigned long addr, unsigned int size)
+{
+ int cross=0;
+ if (size>PAGE_SIZE) {
+ cross = size/PAGE_SIZE;
+ size -= cross*PAGE_SIZE;
+ }
+ if ((PAGE_SIZE-addr%PAGE_SIZE)<size)
+ cross++;
+ return cross;
+}
+
/*
* Register read and write helper functions.
*/
@@ -310,7 +338,7 @@ quadlet_t ohci_csr_rom[] = {
#define OHCI1394_Version 0x000
#define OHCI1394_GUID_ROM 0x004
#define OHCI1394_ATRetries 0x008
-#define OHCI1394_CSRReadData 0x00C
+#define OHCI1394_CSRData 0x00C
#define OHCI1394_CSRCompareData 0x010
#define OHCI1394_CSRControl 0x014
#define OHCI1394_ConfigROMhdr 0x018
@@ -370,12 +398,18 @@ quadlet_t ohci_csr_rom[] = {
#define OHCI1394_AsRspRcvContextControlClear 0x1E4
#define OHCI1394_AsRspRcvCommandPtr 0x1EC
+/* Isochronous transmit registers */
+/* Add (32 * n) for context n */
+#define OHCI1394_IsoXmitContextControlSet 0x200
+#define OHCI1394_IsoXmitContextControlClear 0x204
+#define OHCI1394_IsoXmitCommandPtr 0x20C
+
/* Isochronous receive registers */
/* Add (32 * n) for context n */
-#define OHCI1394_IrRcvContextControlSet 0x400
-#define OHCI1394_IrRcvContextControlClear 0x404
-#define OHCI1394_IrRcvCommandPtr 0x40C
-#define OHCI1394_IrRcvContextMatch 0x410
+#define OHCI1394_IsoRcvContextControlSet 0x400
+#define OHCI1394_IsoRcvContextControlClear 0x404
+#define OHCI1394_IsoRcvCommandPtr 0x40C
+#define OHCI1394_IsoRcvContextMatch 0x410
/* Interrupts Mask/Events */
@@ -410,5 +444,12 @@ quadlet_t ohci_csr_rom[] = {
#define DMA_SPEED_200 0x1
#define DMA_SPEED_400 0x2
+void ohci1394_stop_context(struct ti_ohci *ohci, int reg, char *msg);
+struct ti_ohci *ohci1394_get_struct(int card_num);
+int ohci1394_register_video(struct ti_ohci *ohci,
+ struct video_template *tmpl);
+void ohci1394_unregister_video(struct ti_ohci *ohci,
+ struct video_template *tmpl);
+
#endif