Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265296
b: refs/heads/master
c: 104ea55
h: refs/heads/master
v: v3
  • Loading branch information
frank.blaschka@de.ibm.com authored and David S. Miller committed Aug 13, 2011
1 parent 47a48d6 commit c7c9463
Show file tree
Hide file tree
Showing 8 changed files with 425 additions and 81 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3881ac441f642d56503818123446f7298442236b
refs/heads/master: 104ea556ee7f40039c9c635d0c267b1fde084a81
68 changes: 65 additions & 3 deletions trunk/arch/s390/include/asm/qdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,40 @@ struct slibe {
u64 parms;
};

/**
* struct qaob - queue asynchronous operation block
* @res0: reserved parameters
* @res1: reserved parameter
* @res2: reserved parameter
* @res3: reserved parameter
* @aorc: asynchronous operation return code
* @flags: internal flags
* @cbtbs: control block type
* @sb_count: number of storage blocks
* @sba: storage block element addresses
* @dcount: size of storage block elements
* @user0: user defineable value
* @res4: reserved paramater
* @user1: user defineable value
* @user2: user defineable value
*/
struct qaob {
u64 res0[6];
u8 res1;
u8 res2;
u8 res3;
u8 aorc;
u8 flags;
u16 cbtbs;
u8 sb_count;
u64 sba[QDIO_MAX_ELEMENTS_PER_BUFFER];
u16 dcount[QDIO_MAX_ELEMENTS_PER_BUFFER];
u64 user0;
u64 res4[2];
u64 user1;
u64 user2;
} __attribute__ ((packed, aligned(256)));

/**
* struct slib - storage list information block (SLIB)
* @nsliba: next SLIB address (if any)
Expand Down Expand Up @@ -225,6 +259,31 @@ struct slsb {
#define CHSC_AC2_DATA_DIV_AVAILABLE 0x0010
#define CHSC_AC2_DATA_DIV_ENABLED 0x0002

/**
* struct qdio_outbuf_state - SBAL related asynchronous operation information
* (for communication with upper layer programs)
* (only required for use with completion queues)
* @flags: flags indicating state of buffer
* @aob: pointer to QAOB used for the particular SBAL
* @user: pointer to upper layer program's state information related to SBAL
* (stored in user1 data of QAOB)
*/
struct qdio_outbuf_state {
u8 flags;
struct qaob *aob;
void *user;
};

#define QDIO_OUTBUF_STATE_FLAG_NONE 0x00
#define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01

#define CHSC_AC1_INITIATE_INPUTQ 0x80

#define CHSC_AC2_DATA_DIV_AVAILABLE 0x0010
#define CHSC_AC2_DATA_DIV_ENABLED 0x0002

#define CHSC_AC3_FORMAT2_CQ_AVAILABLE 0x8000

struct qdio_ssqd_desc {
u8 flags;
u8:8;
Expand All @@ -243,8 +302,7 @@ struct qdio_ssqd_desc {
u64 sch_token;
u8 mro;
u8 mri;
u8:8;
u8 sbalic;
u16 qdioac3;
u16:16;
u8:8;
u8 mmwc;
Expand Down Expand Up @@ -280,9 +338,11 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int,
* @no_output_qs: number of output queues
* @input_handler: handler to be called for input queues
* @output_handler: handler to be called for output queues
* @queue_start_poll: polling handlers (one per input queue or NULL)
* @int_parm: interruption parameter
* @input_sbal_addr_array: address of no_input_qs * 128 pointers
* @output_sbal_addr_array: address of no_output_qs * 128 pointers
* @output_sbal_state_array: no_output_qs * 128 state info (for CQ or NULL)
*/
struct qdio_initialize {
struct ccw_device *cdev;
Expand All @@ -297,11 +357,12 @@ struct qdio_initialize {
unsigned int no_output_qs;
qdio_handler_t *input_handler;
qdio_handler_t *output_handler;
void (*queue_start_poll) (struct ccw_device *, int, unsigned long);
void (**queue_start_poll) (struct ccw_device *, int, unsigned long);
int scan_threshold;
unsigned long int_parm;
void **input_sbal_addr_array;
void **output_sbal_addr_array;
struct qdio_outbuf_state *output_sbal_state_array;
};

#define QDIO_STATE_INACTIVE 0x00000002 /* after qdio_cleanup */
Expand All @@ -316,6 +377,7 @@ struct qdio_initialize {
extern int qdio_allocate(struct qdio_initialize *);
extern int qdio_establish(struct qdio_initialize *);
extern int qdio_activate(struct ccw_device *);
extern void qdio_release_aob(struct qaob *);
extern int do_QDIO(struct ccw_device *, unsigned int, int, unsigned int,
unsigned int);
extern int qdio_start_irq(struct ccw_device *, int);
Expand Down
29 changes: 27 additions & 2 deletions trunk/drivers/s390/cio/qdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum qdio_irq_states {
#define SLSB_STATE_NOT_INIT 0x0
#define SLSB_STATE_EMPTY 0x1
#define SLSB_STATE_PRIMED 0x2
#define SLSB_STATE_PENDING 0x3
#define SLSB_STATE_HALTED 0xe
#define SLSB_STATE_ERROR 0xf
#define SLSB_TYPE_INPUT 0x0
Expand All @@ -67,6 +68,8 @@ enum qdio_irq_states {
(SLSB_OWNER_PROG | SLSB_TYPE_OUTPUT | SLSB_STATE_NOT_INIT) /* 0xa0 */
#define SLSB_P_OUTPUT_EMPTY \
(SLSB_OWNER_PROG | SLSB_TYPE_OUTPUT | SLSB_STATE_EMPTY) /* 0xa1 */
#define SLSB_P_OUTPUT_PENDING \
(SLSB_OWNER_PROG | SLSB_TYPE_OUTPUT | SLSB_STATE_PENDING) /* 0xa3 */
#define SLSB_CU_OUTPUT_PRIMED \
(SLSB_OWNER_CU | SLSB_TYPE_OUTPUT | SLSB_STATE_PRIMED) /* 0x62 */
#define SLSB_P_OUTPUT_HALTED \
Expand Down Expand Up @@ -97,6 +100,7 @@ enum qdio_irq_states {
#define QDIO_SIGA_WRITE 0x00
#define QDIO_SIGA_READ 0x01
#define QDIO_SIGA_SYNC 0x02
#define QDIO_SIGA_WRITEQ 0x04
#define QDIO_SIGA_QEBSM_FLAG 0x80

#ifdef CONFIG_64BIT
Expand Down Expand Up @@ -253,6 +257,12 @@ struct qdio_input_q {
struct qdio_output_q {
/* PCIs are enabled for the queue */
int pci_out_enabled;
/* cq: use asynchronous output buffers */
int use_cq;
/* cq: aobs used for particual SBAL */
struct qaob **aobs;
/* cq: sbal state related to asynchronous operation */
struct qdio_outbuf_state *sbal_state;
/* timer to check for more outbound work */
struct timer_list timer;
/* used SBALs before tasklet schedule */
Expand Down Expand Up @@ -432,9 +442,20 @@ struct indicator_t {

extern struct indicator_t *q_indicators;

static inline int shared_ind(u32 *dsci)
static inline int has_multiple_inq_on_dsci(struct qdio_irq *irq)
{
return dsci == &q_indicators[TIQDIO_SHARED_IND].ind;
return irq->nr_input_qs > 1;
}

static inline int references_shared_dsci(struct qdio_irq *irq)
{
return irq->dsci == &q_indicators[TIQDIO_SHARED_IND].ind;
}

static inline int shared_ind(struct qdio_q *q)
{
struct qdio_irq *i = q->irq_ptr;
return references_shared_dsci(i) || has_multiple_inq_on_dsci(i);
}

/* prototypes for thin interrupt */
Expand All @@ -449,6 +470,7 @@ void tiqdio_free_memory(void);
int tiqdio_register_thinints(void);
void tiqdio_unregister_thinints(void);


/* prototypes for setup */
void qdio_inbound_processing(unsigned long data);
void qdio_outbound_processing(unsigned long data);
Expand All @@ -469,6 +491,9 @@ int qdio_setup_create_sysfs(struct ccw_device *cdev);
void qdio_setup_destroy_sysfs(struct ccw_device *cdev);
int qdio_setup_init(void);
void qdio_setup_exit(void);
int qdio_enable_async_operation(struct qdio_output_q *q);
void qdio_disable_async_operation(struct qdio_output_q *q);
struct qaob *qdio_allocate_aob(void);

int debug_get_buf_state(struct qdio_q *q, unsigned int bufnr,
unsigned char *state);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/s390/cio/qdio_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ static int qstat_show(struct seq_file *m, void *v)
case SLSB_P_OUTPUT_NOT_INIT:
seq_printf(m, "N");
break;
case SLSB_P_OUTPUT_PENDING:
seq_printf(m, "P");
break;
case SLSB_P_INPUT_PRIMED:
case SLSB_CU_OUTPUT_PRIMED:
seq_printf(m, "+");
Expand Down
Loading

0 comments on commit c7c9463

Please sign in to comment.