ispvar.h (302408) | ispvar.h (316084) |
---|---|
1/* $FreeBSD: stable/11/sys/dev/isp/ispvar.h 300218 2016-05-19 17:02:33Z mav $ */ | 1/* $FreeBSD: stable/11/sys/dev/isp/ispvar.h 316084 2017-03-28 10:11:00Z mav $ */ |
2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 49 unchanged lines hidden (view full) --- 59typedef struct ispsoftc ispsoftc_t; 60struct ispmdvec { 61 int (*dv_rd_isr) (ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); 62 uint32_t (*dv_rd_reg) (ispsoftc_t *, int); 63 void (*dv_wr_reg) (ispsoftc_t *, int, uint32_t); 64 int (*dv_mbxdma) (ispsoftc_t *); 65 int (*dv_dmaset) (ispsoftc_t *, XS_T *, void *); 66 void (*dv_dmaclr) (ispsoftc_t *, XS_T *, uint32_t); | 2/*- 3 * Copyright (c) 1997-2009 by Matthew Jacob 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * --- 49 unchanged lines hidden (view full) --- 59typedef struct ispsoftc ispsoftc_t; 60struct ispmdvec { 61 int (*dv_rd_isr) (ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); 62 uint32_t (*dv_rd_reg) (ispsoftc_t *, int); 63 void (*dv_wr_reg) (ispsoftc_t *, int, uint32_t); 64 int (*dv_mbxdma) (ispsoftc_t *); 65 int (*dv_dmaset) (ispsoftc_t *, XS_T *, void *); 66 void (*dv_dmaclr) (ispsoftc_t *, XS_T *, uint32_t); |
67 void (*dv_reset0) (ispsoftc_t *); 68 void (*dv_reset1) (ispsoftc_t *); | 67 int (*dv_irqsetup) (ispsoftc_t *); |
69 void (*dv_dregs) (ispsoftc_t *, const char *); 70 const void * dv_ispfw; /* ptr to f/w */ 71 uint16_t dv_conf1; 72 uint16_t dv_clock; /* clock frequency */ 73}; 74 75/* 76 * Overall parameters --- 23 unchanged lines hidden (view full) --- 100 101#define ISP_DMASETUP(isp, xs, req) \ 102 (*(isp)->isp_mdvec->dv_dmaset)((isp), (xs), (req)) 103 104#define ISP_DMAFREE(isp, xs, hndl) \ 105 if ((isp)->isp_mdvec->dv_dmaclr) \ 106 (*(isp)->isp_mdvec->dv_dmaclr)((isp), (xs), (hndl)) 107 | 68 void (*dv_dregs) (ispsoftc_t *, const char *); 69 const void * dv_ispfw; /* ptr to f/w */ 70 uint16_t dv_conf1; 71 uint16_t dv_clock; /* clock frequency */ 72}; 73 74/* 75 * Overall parameters --- 23 unchanged lines hidden (view full) --- 99 100#define ISP_DMASETUP(isp, xs, req) \ 101 (*(isp)->isp_mdvec->dv_dmaset)((isp), (xs), (req)) 102 103#define ISP_DMAFREE(isp, xs, hndl) \ 104 if ((isp)->isp_mdvec->dv_dmaclr) \ 105 (*(isp)->isp_mdvec->dv_dmaclr)((isp), (xs), (hndl)) 106 |
108#define ISP_RESET0(isp) \ 109 if ((isp)->isp_mdvec->dv_reset0) (*(isp)->isp_mdvec->dv_reset0)((isp)) 110#define ISP_RESET1(isp) \ 111 if ((isp)->isp_mdvec->dv_reset1) (*(isp)->isp_mdvec->dv_reset1)((isp)) | 107#define ISP_IRQSETUP(isp) \ 108 (((isp)->isp_mdvec->dv_irqsetup) ? (*(isp)->isp_mdvec->dv_irqsetup)(isp) : 0) |
112#define ISP_DUMPREGS(isp, m) \ 113 if ((isp)->isp_mdvec->dv_dregs) (*(isp)->isp_mdvec->dv_dregs)((isp),(m)) 114 115#define ISP_SETBITS(isp, reg, val) \ 116 (*(isp)->isp_mdvec->dv_wr_reg)((isp), (reg), ISP_READ((isp), (reg)) | (val)) 117 118#define ISP_CLRBITS(isp, reg, val) \ 119 (*(isp)->isp_mdvec->dv_wr_reg)((isp), (reg), ISP_READ((isp), (reg)) & ~(val)) --- 440 unchanged lines hidden (view full) --- 560 uint16_t isp_rscchiwater; 561 uint16_t isp_fpcchiwater; 562 NANOTIME_T isp_init_time; /* time were last initialized */ 563 564 /* 565 * Volatile state 566 */ 567 | 109#define ISP_DUMPREGS(isp, m) \ 110 if ((isp)->isp_mdvec->dv_dregs) (*(isp)->isp_mdvec->dv_dregs)((isp),(m)) 111 112#define ISP_SETBITS(isp, reg, val) \ 113 (*(isp)->isp_mdvec->dv_wr_reg)((isp), (reg), ISP_READ((isp), (reg)) | (val)) 114 115#define ISP_CLRBITS(isp, reg, val) \ 116 (*(isp)->isp_mdvec->dv_wr_reg)((isp), (reg), ISP_READ((isp), (reg)) & ~(val)) --- 440 unchanged lines hidden (view full) --- 557 uint16_t isp_rscchiwater; 558 uint16_t isp_fpcchiwater; 559 NANOTIME_T isp_init_time; /* time were last initialized */ 560 561 /* 562 * Volatile state 563 */ 564 |
568 volatile uint32_t : 8, 569 : 2, 570 isp_dead : 1, 571 : 1, 572 isp_mboxbsy : 1, /* mailbox command active */ 573 isp_state : 3, 574 isp_nactive : 16; /* how many commands active */ | 565 volatile u_int isp_mboxbsy; /* mailbox command active */ 566 volatile u_int isp_state; 567 volatile u_int isp_nactive; /* how many commands active */ |
575 volatile mbreg_t isp_curmbx; /* currently active mailbox command */ 576 volatile uint32_t isp_reqodx; /* index of last ISP pickup */ 577 volatile uint32_t isp_reqidx; /* index of next request */ 578 volatile uint32_t isp_residx; /* index of last ISP write */ 579 volatile uint32_t isp_resodx; /* index of next result */ 580 volatile uint32_t isp_atioodx; /* index of next ATIO */ 581 volatile uint32_t isp_obits; /* mailbox command output */ 582 volatile uint32_t isp_serno; /* rolling serial number */ --- 231 unchanged lines hidden (view full) --- 814void isp_init(ispsoftc_t *); 815 816/* 817 * Reset the ISP and call completion for any orphaned commands. 818 */ 819int isp_reinit(ispsoftc_t *, int); 820 821/* | 568 volatile mbreg_t isp_curmbx; /* currently active mailbox command */ 569 volatile uint32_t isp_reqodx; /* index of last ISP pickup */ 570 volatile uint32_t isp_reqidx; /* index of next request */ 571 volatile uint32_t isp_residx; /* index of last ISP write */ 572 volatile uint32_t isp_resodx; /* index of next result */ 573 volatile uint32_t isp_atioodx; /* index of next ATIO */ 574 volatile uint32_t isp_obits; /* mailbox command output */ 575 volatile uint32_t isp_serno; /* rolling serial number */ --- 231 unchanged lines hidden (view full) --- 807void isp_init(ispsoftc_t *); 808 809/* 810 * Reset the ISP and call completion for any orphaned commands. 811 */ 812int isp_reinit(ispsoftc_t *, int); 813 814/* |
815 * Shutdown hardware after use. 816 */ 817void isp_shutdown(ispsoftc_t *); 818 819/* |
|
822 * Internal Interrupt Service Routine 823 * 824 * The outer layers do the spade work to get the appropriate status register, 825 * semaphore register and first mailbox register (if appropriate). This also 826 * means that most spurious/bogus interrupts not for us can be filtered first. 827 */ 828void isp_intr(ispsoftc_t *, uint16_t, uint16_t, uint16_t); 829 --- 327 unchanged lines hidden --- | 820 * Internal Interrupt Service Routine 821 * 822 * The outer layers do the spade work to get the appropriate status register, 823 * semaphore register and first mailbox register (if appropriate). This also 824 * means that most spurious/bogus interrupts not for us can be filtered first. 825 */ 826void isp_intr(ispsoftc_t *, uint16_t, uint16_t, uint16_t); 827 --- 327 unchanged lines hidden --- |