PERFORCE change 95954 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Apr 23 21:19:09 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=95954
Change 95954 by marcel at marcel_nfs on 2006/04/23 21:19:06
IFC @95953
Affected files ...
.. //depot/projects/uart/alpha/pci/pcibus.c#7 integrate
.. //depot/projects/uart/arm/arm/pmap.c#14 integrate
.. //depot/projects/uart/ddb/db_command.c#10 integrate
.. //depot/projects/uart/dev/acpica/acpi_powerres.c#7 integrate
.. //depot/projects/uart/dev/isp/isp.c#12 integrate
.. //depot/projects/uart/dev/isp/isp_freebsd.c#14 integrate
.. //depot/projects/uart/dev/isp/isp_freebsd.h#10 integrate
.. //depot/projects/uart/dev/isp/isp_ioctl.h#7 integrate
.. //depot/projects/uart/dev/isp/isp_library.c#3 integrate
.. //depot/projects/uart/dev/isp/isp_pci.c#12 integrate
.. //depot/projects/uart/dev/isp/isp_sbus.c#10 integrate
.. //depot/projects/uart/dev/isp/isp_target.c#8 integrate
.. //depot/projects/uart/dev/isp/isp_target.h#7 integrate
.. //depot/projects/uart/dev/isp/isp_tpublic.h#6 integrate
.. //depot/projects/uart/dev/isp/ispmbox.h#7 integrate
.. //depot/projects/uart/dev/mpt/mpt_cam.c#12 integrate
.. //depot/projects/uart/dev/pci/pci_pci.c#9 integrate
.. //depot/projects/uart/dev/sound/pci/via8233.c#10 integrate
.. //depot/projects/uart/dev/uart/uart_dev_ns8250.c#42 integrate
.. //depot/projects/uart/kern/kern_sig.c#28 integrate
.. //depot/projects/uart/kern/subr_sleepqueue.c#11 integrate
.. //depot/projects/uart/kern/subr_turnstile.c#8 integrate
.. //depot/projects/uart/kern/uipc_socket.c#18 integrate
.. //depot/projects/uart/netinet/in_pcb.c#15 integrate
.. //depot/projects/uart/netinet/tcp_subr.c#20 integrate
.. //depot/projects/uart/netinet6/in6_ifattach.c#10 integrate
.. //depot/projects/uart/netinet6/in6_pcb.c#12 integrate
.. //depot/projects/uart/netinet6/in6_pcb.h#5 integrate
.. //depot/projects/uart/netnatm/natm.c#11 integrate
.. //depot/projects/uart/netnatm/natm_pcb.c#5 integrate
.. //depot/projects/uart/security/mac_bsdextended/mac_bsdextended.c#9 integrate
.. //depot/projects/uart/security/mac_bsdextended/mac_bsdextended.h#3 integrate
.. //depot/projects/uart/sys/param.h#24 integrate
.. //depot/projects/uart/ufs/ffs/ffs_vfsops.c#21 integrate
Differences ...
==== //depot/projects/uart/alpha/pci/pcibus.c#7 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.38 2006/04/20 04:16:02 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.39 2006/04/22 19:04:21 marcel Exp $");
#include "opt_isa.h"
@@ -96,12 +96,7 @@
alpha_platform_alloc_ide_intr(int chan)
{
int irqs[2] = { 14, 15 };
- struct resource *rv;
-
- rv = isa_alloc_intr(0, 0, irqs[chan]);
- if (rv != NULL)
- rman_set_rid(rv, *rid);
- return (rv);
+ return (isa_alloc_intr(0, 0, irqs[chan]));
}
int
==== //depot/projects/uart/arm/arm/pmap.c#14 (text+ko) ====
@@ -147,7 +147,7 @@
#include "opt_vm.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.46 2006/04/03 21:16:07 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.47 2006/04/22 22:51:32 cognet Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -1204,18 +1204,6 @@
}
/*
- * this routine defines the region(s) of memory that should
- * not be tested for the modified bit.
- */
-static PMAP_INLINE int
-pmap_track_modified(vm_offset_t va)
-{
- if ((va < kmi.clean_sva) || (va >= kmi.clean_eva))
- return 1;
- else
- return 0;
-}
-/*
* PTE_SYNC_CURRENT:
*
* Make sure the pte is written out to RAM.
@@ -1559,8 +1547,7 @@
ptep = &l2b->l2b_kva[l2pte_index(va)];
npte = opte = *ptep;
- if (maskbits & (PVF_WRITE|PVF_MOD) &&
- !pmap_track_modified(pv->pv_va)) {
+ if (maskbits & (PVF_WRITE|PVF_MOD)) {
if ((pv->pv_flags & PVF_NC)) {
/*
* Entry is not cacheable:
@@ -1618,7 +1605,7 @@
}
}
- if (maskbits & PVF_REF && !pmap_track_modified(pv->pv_va)) {
+ if (maskbits & PVF_REF) {
if ((pv->pv_flags & PVF_NC) == 0 &&
(maskbits & (PVF_WRITE|PVF_MOD)) == 0) {
/*
@@ -2056,10 +2043,8 @@
goto out;
}
- if (pmap_track_modified(pv->pv_va)) {
- pg->md.pvh_attrs |= PVF_REF | PVF_MOD;
- vm_page_dirty(pg);
- }
+ pg->md.pvh_attrs |= PVF_REF | PVF_MOD;
+ vm_page_dirty(pg);
pv->pv_flags |= PVF_REF | PVF_MOD;
/*
@@ -3267,8 +3252,7 @@
f = pmap_modify_pv(pg, pm, sva,
PVF_WRITE, 0);
pmap_vac_me_harder(pg, pm, sva);
- if (pmap_track_modified(sva))
- vm_page_dirty(pg);
+ vm_page_dirty(pg);
} else
f = PVF_REF | PVF_EXEC;
@@ -3391,8 +3375,7 @@
* writable from the outset.
*/
nflags |= PVF_MOD;
- if (!(m->md.pvh_attrs & PVF_MOD) &&
- pmap_track_modified(va))
+ if (!(m->md.pvh_attrs & PVF_MOD))
vm_page_dirty(m);
}
if (m && opte)
@@ -3477,8 +3460,11 @@
if ((pve = pmap_get_pv_entry()) == NULL) {
panic("pmap_enter: no pv entries");
}
- if (m && !(m->flags & (PG_UNMANAGED | PG_FICTITIOUS)))
+ if (m && !(m->flags & (PG_UNMANAGED | PG_FICTITIOUS))) {
+ KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva,
+ ("pmap_enter: managed mapping within the clean submap"));
pmap_enter_pv(m, pve, pmap, va, nflags);
+ }
}
/*
* Make sure userland mappings get the right permissions
==== //depot/projects/uart/ddb/db_command.c#10 (text+ko) ====
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.65 2006/03/07 22:17:05 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/ddb/db_command.c,v 1.66 2006/04/21 20:39:51 jhb Exp $");
#include <sys/param.h>
#include <sys/linker_set.h>
@@ -679,7 +679,7 @@
quit = 0;
db_setup_paging(db_simple_pager, &quit, db_lines_per_page);
- for (p = LIST_FIRST(&allproc); p != NULL; p = LIST_NEXT(p, p_list)) {
+ LIST_FOREACH(p, &allproc, p_list) {
FOREACH_THREAD_IN_PROC(p, td) {
db_printf("\nTracing command %s pid %d tid %ld td %p\n",
p->p_comm, p->p_pid, (long)td->td_tid, td);
==== //depot/projects/uart/dev/acpica/acpi_powerres.c#7 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_powerres.c,v 1.29 2005/09/11 18:39:01 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_powerres.c,v 1.30 2006/04/21 19:06:29 jkim Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -247,7 +247,7 @@
ACPI_SERIAL_ASSERT(powerres);
/* Check to see whether we know about this consumer already */
- if ((pc = acpi_pwr_find_consumer(consumer)) != NULL)
+ if (acpi_pwr_find_consumer(consumer) != NULL)
return_ACPI_STATUS (AE_OK);
/* Allocate a new power consumer */
==== //depot/projects/uart/dev/isp/isp.c#12 (text+ko) ====
@@ -34,7 +34,7 @@
*/
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp.c,v 1.117 2006/02/15 00:31:48 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp.c,v 1.119 2006/04/21 18:46:35 mjacob Exp $");
#endif
/*
@@ -114,40 +114,40 @@
/*
* Local function prototypes.
*/
-static int isp_parse_async(struct ispsoftc *, uint16_t);
-static int isp_handle_other_response(struct ispsoftc *, int, isphdr_t *,
+static int isp_parse_async(ispsoftc_t *, uint16_t);
+static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *,
uint16_t *);
static void
-isp_parse_status(struct ispsoftc *, ispstatusreq_t *, XS_T *);
-static void isp_fastpost_complete(struct ispsoftc *, uint16_t);
-static int isp_mbox_continue(struct ispsoftc *);
-static void isp_scsi_init(struct ispsoftc *);
-static void isp_scsi_channel_init(struct ispsoftc *, int);
-static void isp_fibre_init(struct ispsoftc *);
-static void isp_mark_getpdb_all(struct ispsoftc *);
-static int isp_getmap(struct ispsoftc *, fcpos_map_t *);
-static int isp_getpdb(struct ispsoftc *, int, isp_pdb_t *);
-static uint64_t isp_get_portname(struct ispsoftc *, int, int);
-static int isp_fclink_test(struct ispsoftc *, int);
+isp_parse_status(ispsoftc_t *, ispstatusreq_t *, XS_T *);
+static void isp_fastpost_complete(ispsoftc_t *, uint16_t);
+static int isp_mbox_continue(ispsoftc_t *);
+static void isp_scsi_init(ispsoftc_t *);
+static void isp_scsi_channel_init(ispsoftc_t *, int);
+static void isp_fibre_init(ispsoftc_t *);
+static void isp_mark_getpdb_all(ispsoftc_t *);
+static int isp_getmap(ispsoftc_t *, fcpos_map_t *);
+static int isp_getpdb(ispsoftc_t *, int, isp_pdb_t *);
+static uint64_t isp_get_portname(ispsoftc_t *, int, int);
+static int isp_fclink_test(ispsoftc_t *, int);
static char *isp2100_fw_statename(int);
-static int isp_pdb_sync(struct ispsoftc *);
-static int isp_scan_loop(struct ispsoftc *);
-static int isp_fabric_mbox_cmd(struct ispsoftc *, mbreg_t *);
-static int isp_scan_fabric(struct ispsoftc *, int);
-static void isp_register_fc4_type(struct ispsoftc *);
-static void isp_fw_state(struct ispsoftc *);
-static void isp_mboxcmd_qnw(struct ispsoftc *, mbreg_t *, int);
-static void isp_mboxcmd(struct ispsoftc *, mbreg_t *, int);
+static int isp_pdb_sync(ispsoftc_t *);
+static int isp_scan_loop(ispsoftc_t *);
+static int isp_fabric_mbox_cmd(ispsoftc_t *, mbreg_t *);
+static int isp_scan_fabric(ispsoftc_t *, int);
+static void isp_register_fc4_type(ispsoftc_t *);
+static void isp_fw_state(ispsoftc_t *);
+static void isp_mboxcmd_qnw(ispsoftc_t *, mbreg_t *, int);
+static void isp_mboxcmd(ispsoftc_t *, mbreg_t *, int);
-static void isp_update(struct ispsoftc *);
-static void isp_update_bus(struct ispsoftc *, int);
-static void isp_setdfltparm(struct ispsoftc *, int);
-static int isp_read_nvram(struct ispsoftc *);
-static void isp_rdnvram_word(struct ispsoftc *, int, uint16_t *);
-static void isp_parse_nvram_1020(struct ispsoftc *, uint8_t *);
-static void isp_parse_nvram_1080(struct ispsoftc *, int, uint8_t *);
-static void isp_parse_nvram_12160(struct ispsoftc *, int, uint8_t *);
-static void isp_parse_nvram_2100(struct ispsoftc *, uint8_t *);
+static void isp_update(ispsoftc_t *);
+static void isp_update_bus(ispsoftc_t *, int);
+static void isp_setdfltparm(ispsoftc_t *, int);
+static int isp_read_nvram(ispsoftc_t *);
+static void isp_rdnvram_word(ispsoftc_t *, int, uint16_t *);
+static void isp_parse_nvram_1020(ispsoftc_t *, uint8_t *);
+static void isp_parse_nvram_1080(ispsoftc_t *, int, uint8_t *);
+static void isp_parse_nvram_12160(ispsoftc_t *, int, uint8_t *);
+static void isp_parse_nvram_2100(ispsoftc_t *, uint8_t *);
/*
* Reset Hardware.
@@ -158,7 +158,7 @@
*/
void
-isp_reset(struct ispsoftc *isp)
+isp_reset(ispsoftc_t *isp)
{
mbreg_t mbs;
uint16_t code_org;
@@ -837,7 +837,7 @@
*/
void
-isp_init(struct ispsoftc *isp)
+isp_init(ispsoftc_t *isp)
{
/*
* Must do this first to get defaults established.
@@ -854,7 +854,7 @@
}
static void
-isp_scsi_init(struct ispsoftc *isp)
+isp_scsi_init(ispsoftc_t *isp)
{
sdparam *sdp_chan0, *sdp_chan1;
mbreg_t mbs;
@@ -1053,7 +1053,7 @@
}
static void
-isp_scsi_channel_init(struct ispsoftc *isp, int channel)
+isp_scsi_channel_init(ispsoftc_t *isp, int channel)
{
sdparam *sdp;
mbreg_t mbs;
@@ -1174,7 +1174,7 @@
* Locks are held before coming here.
*/
static void
-isp_fibre_init(struct ispsoftc *isp)
+isp_fibre_init(ispsoftc_t *isp)
{
fcparam *fcp;
isp_icb_t local, *icbp = &local;
@@ -1277,7 +1277,7 @@
/*
* We end up with these Loop IDs for F-Port topologies
*/
- if (icbp->icb_hardaddr != 0xff || icbp->icb_hardaddr != 0x800) {
+ if (icbp->icb_hardaddr != 0xff && icbp->icb_hardaddr != 0x800) {
isp_prt(isp, ISP_LOGERR,
"bad hard address %u- resetting to zero",
icbp->icb_hardaddr);
@@ -1390,7 +1390,8 @@
mbs.param[3] = 0;
isp_mboxcmd(isp, &mbs, MBLOGALL);
}
- icbp->icb_logintime = 30; /* 30 second login timeout */
+ icbp->icb_logintime = ICB_LOGIN_TOV;
+ icbp->icb_lunetimeout = ICB_LUN_ENABLE_TOV;
if (IS_23XX(isp)) {
ISP_WRITE(isp, isp->isp_rqstinrp, 0);
@@ -1472,7 +1473,7 @@
*/
static int
-isp_getmap(struct ispsoftc *isp, fcpos_map_t *map)
+isp_getmap(ispsoftc_t *isp, fcpos_map_t *map)
{
fcparam *fcp = (fcparam *) isp->isp_param;
mbreg_t mbs;
@@ -1504,7 +1505,7 @@
}
static void
-isp_mark_getpdb_all(struct ispsoftc *isp)
+isp_mark_getpdb_all(ispsoftc_t *isp)
{
fcparam *fcp = (fcparam *) isp->isp_param;
int i;
@@ -1514,7 +1515,7 @@
}
static int
-isp_getpdb(struct ispsoftc *isp, int id, isp_pdb_t *pdbp)
+isp_getpdb(ispsoftc_t *isp, int id, isp_pdb_t *pdbp)
{
fcparam *fcp = (fcparam *) isp->isp_param;
mbreg_t mbs;
@@ -1550,7 +1551,7 @@
}
static uint64_t
-isp_get_portname(struct ispsoftc *isp, int loopid, int nodename)
+isp_get_portname(ispsoftc_t *isp, int loopid, int nodename)
{
uint64_t wwn = 0;
mbreg_t mbs;
@@ -1587,7 +1588,7 @@
*/
static int
-isp_fclink_test(struct ispsoftc *isp, int usdelay)
+isp_fclink_test(ispsoftc_t *isp, int usdelay)
{
static char *toponames[] = {
"Private Loop",
@@ -1864,7 +1865,7 @@
*/
static int
-isp_pdb_sync(struct ispsoftc *isp)
+isp_pdb_sync(ispsoftc_t *isp)
{
struct lportdb *lp;
fcparam *fcp = isp->isp_param;
@@ -2190,7 +2191,7 @@
}
static int
-isp_scan_loop(struct ispsoftc *isp)
+isp_scan_loop(ispsoftc_t *isp)
{
struct lportdb *lp;
fcparam *fcp = isp->isp_param;
@@ -2462,7 +2463,7 @@
static int
-isp_fabric_mbox_cmd(struct ispsoftc *isp, mbreg_t *mbp)
+isp_fabric_mbox_cmd(ispsoftc_t *isp, mbreg_t *mbp)
{
isp_mboxcmd(isp, mbp, MBLOGNONE);
if (mbp->param[0] != MBOX_COMMAND_COMPLETE) {
@@ -2511,7 +2512,7 @@
#ifdef ISP_USE_GA_NXT
static int
-isp_scan_fabric(struct ispsoftc *isp, int ftype)
+isp_scan_fabric(ispsoftc_t *isp, int ftype)
{
fcparam *fcp = isp->isp_param;
uint32_t portid, first_portid, last_portid;
@@ -2675,7 +2676,7 @@
#define GXOFF (256)
static int
-isp_scan_fabric(struct ispsoftc *isp, int ftype)
+isp_scan_fabric(ispsoftc_t *isp, int ftype)
{
fcparam *fcp = FCPARAM(isp);
mbreg_t mbs;
@@ -2981,7 +2982,7 @@
#endif
static void
-isp_register_fc4_type(struct ispsoftc *isp)
+isp_register_fc4_type(ispsoftc_t *isp)
{
fcparam *fcp = isp->isp_param;
uint8_t local[SNS_RFT_ID_REQ_SIZE];
@@ -3028,7 +3029,7 @@
int
isp_start(XS_T *xs)
{
- struct ispsoftc *isp;
+ ispsoftc_t *isp;
uint16_t nxti, optr, handle;
uint8_t local[QENTRY_LEN];
ispreq_t *reqp, *qep;
@@ -3401,7 +3402,7 @@
*/
int
-isp_control(struct ispsoftc *isp, ispctl_t ctl, void *arg)
+isp_control(ispsoftc_t *isp, ispctl_t ctl, void *arg)
{
XS_T *xs;
mbreg_t mbs;
@@ -3514,7 +3515,10 @@
case ISPCTL_FCLINK_TEST:
if (IS_FC(isp)) {
- int usdelay = (arg)? *((int *) arg) : 250000;
+ int usdelay = *((int *) arg);
+ if (usdelay == 0) {
+ usdelay = 250000;
+ }
return (isp_fclink_test(isp, usdelay));
}
break;
@@ -3614,7 +3618,7 @@
#endif
void
-isp_intr(struct ispsoftc *isp, uint16_t isr, uint16_t sema, uint16_t mbox)
+isp_intr(ispsoftc_t *isp, uint16_t isr, uint16_t sema, uint16_t mbox)
{
XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs;
uint16_t iptr, optr, junk;
@@ -4059,7 +4063,7 @@
*/
static int
-isp_parse_async(struct ispsoftc *isp, uint16_t mbox)
+isp_parse_async(ispsoftc_t *isp, uint16_t mbox)
{
int rval = 0;
int bus;
@@ -4414,7 +4418,7 @@
*/
static int
-isp_handle_other_response(struct ispsoftc *isp, int type,
+isp_handle_other_response(ispsoftc_t *isp, int type,
isphdr_t *hp, uint16_t *optrp)
{
switch (type) {
@@ -4464,7 +4468,7 @@
}
static void
-isp_parse_status(struct ispsoftc *isp, ispstatusreq_t *sp, XS_T *xs)
+isp_parse_status(ispsoftc_t *isp, ispstatusreq_t *sp, XS_T *xs)
{
switch (sp->req_completion_status & 0xff) {
case RQCS_COMPLETE:
@@ -4848,7 +4852,7 @@
}
static void
-isp_fastpost_complete(struct ispsoftc *isp, uint16_t fph)
+isp_fastpost_complete(ispsoftc_t *isp, uint16_t fph)
{
XS_T *xs;
@@ -4881,7 +4885,7 @@
}
static int
-isp_mbox_continue(struct ispsoftc *isp)
+isp_mbox_continue(ispsoftc_t *isp)
{
mbreg_t mbs;
uint16_t *ptr;
@@ -5398,7 +5402,7 @@
#endif
static void
-isp_mboxcmd_qnw(struct ispsoftc *isp, mbreg_t *mbp, int nodelay)
+isp_mboxcmd_qnw(ispsoftc_t *isp, mbreg_t *mbp, int nodelay)
{
unsigned int ibits, obits, box, opcode;
const uint32_t *mcp;
@@ -5438,7 +5442,7 @@
}
static void
-isp_mboxcmd(struct ispsoftc *isp, mbreg_t *mbp, int logmask)
+isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mbp, int logmask)
{
char *cname, *xname, tname[16], mname[16];
unsigned int lim, ibits, obits, box, opcode;
@@ -5586,7 +5590,7 @@
}
static void
-isp_fw_state(struct ispsoftc *isp)
+isp_fw_state(ispsoftc_t *isp)
{
if (IS_FC(isp)) {
mbreg_t mbs;
@@ -5602,7 +5606,7 @@
}
static void
-isp_update(struct ispsoftc *isp)
+isp_update(ispsoftc_t *isp)
{
int bus, upmask;
@@ -5615,7 +5619,7 @@
}
static void
-isp_update_bus(struct ispsoftc *isp, int bus)
+isp_update_bus(ispsoftc_t *isp, int bus)
{
int tgt;
mbreg_t mbs;
@@ -5740,7 +5744,7 @@
#endif
static void
-isp_setdfltparm(struct ispsoftc *isp, int channel)
+isp_setdfltparm(ispsoftc_t *isp, int channel)
{
int tgt;
mbreg_t mbs;
@@ -5967,7 +5971,7 @@
*/
void
-isp_reinit(struct ispsoftc *isp)
+isp_reinit(ispsoftc_t *isp)
{
XS_T *xs;
int i;
@@ -6013,7 +6017,7 @@
* NVRAM Routines
*/
static int
-isp_read_nvram(struct ispsoftc *isp)
+isp_read_nvram(ispsoftc_t *isp)
{
int i, amt;
uint8_t csum, minversion;
@@ -6087,7 +6091,7 @@
}
static void
-isp_rdnvram_word(struct ispsoftc *isp, int wo, uint16_t *rp)
+isp_rdnvram_word(ispsoftc_t *isp, int wo, uint16_t *rp)
{
int i, cbits;
uint16_t bit, rqst;
@@ -6153,7 +6157,7 @@
}
static void
-isp_parse_nvram_1020(struct ispsoftc *isp, uint8_t *nvram_data)
+isp_parse_nvram_1020(ispsoftc_t *isp, uint8_t *nvram_data)
{
sdparam *sdp = (sdparam *) isp->isp_param;
int tgt;
@@ -6279,7 +6283,7 @@
}
static void
-isp_parse_nvram_1080(struct ispsoftc *isp, int bus, uint8_t *nvram_data)
+isp_parse_nvram_1080(ispsoftc_t *isp, int bus, uint8_t *nvram_data)
{
sdparam *sdp = (sdparam *) isp->isp_param;
int tgt;
@@ -6371,7 +6375,7 @@
}
static void
-isp_parse_nvram_12160(struct ispsoftc *isp, int bus, uint8_t *nvram_data)
+isp_parse_nvram_12160(ispsoftc_t *isp, int bus, uint8_t *nvram_data)
{
sdparam *sdp = (sdparam *) isp->isp_param;
int tgt;
@@ -6462,7 +6466,7 @@
}
static void
-isp_parse_nvram_2100(struct ispsoftc *isp, uint8_t *nvram_data)
+isp_parse_nvram_2100(ispsoftc_t *isp, uint8_t *nvram_data)
{
fcparam *fcp = (fcparam *) isp->isp_param;
uint64_t wwn;
@@ -6554,11 +6558,11 @@
}
#ifdef ISP_FW_CRASH_DUMP
-static void isp2200_fw_dump(struct ispsoftc *);
-static void isp2300_fw_dump(struct ispsoftc *);
+static void isp2200_fw_dump(ispsoftc_t *);
+static void isp2300_fw_dump(ispsoftc_t *);
static void
-isp2200_fw_dump(struct ispsoftc *isp)
+isp2200_fw_dump(ispsoftc_t *isp)
{
int i, j;
mbreg_t mbs;
@@ -6703,7 +6707,7 @@
}
static void
-isp2300_fw_dump(struct ispsoftc *isp)
+isp2300_fw_dump(ispsoftc_t *isp)
{
int i, j;
mbreg_t mbs;
@@ -6867,7 +6871,7 @@
}
void
-isp_fw_dump(struct ispsoftc *isp)
+isp_fw_dump(ispsoftc_t *isp)
{
if (IS_2200(isp))
isp2200_fw_dump(isp);
==== //depot/projects/uart/dev/isp/isp_freebsd.c#14 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.112 2006/03/03 07:04:43 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.114 2006/04/21 18:46:35 mjacob Exp $");
#include <dev/isp/isp_freebsd.h>
#include <sys/unistd.h>
@@ -53,17 +53,36 @@
static void isp_action(struct cam_sim *, union ccb *);
+#if __FreeBSD_version < 500000
+#define ISP_CDEV_MAJOR 248
+static struct cdevsw isp_cdevsw = {
+ /* open */ nullopen,
+ /* close */ nullclose,
+ /* read */ noread,
+ /* write */ nowrite,
+ /* ioctl */ ispioctl,
+ /* poll */ nopoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "isp",
+ /* maj */ ISP_CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_TAPE,
+};
+#else
static struct cdevsw isp_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_ioctl = ispioctl,
.d_name = "isp",
};
+#endif
-static struct ispsoftc *isplist = NULL;
+static ispsoftc_t *isplist = NULL;
void
-isp_attach(struct ispsoftc *isp)
+isp_attach(ispsoftc_t *isp)
{
int primary, secondary;
struct ccb_setasync csa;
@@ -140,11 +159,17 @@
*/
if (IS_FC(isp)) {
ISPLOCK_2_CAMLOCK(isp);
+#if __FreeBSD_version >= 500000
/* XXX: LOCK VIOLATION */
cv_init(&isp->isp_osinfo.kthread_cv, "isp_kthread_cv");
if (kthread_create(isp_kthread, isp, &isp->isp_osinfo.kproc,
RFHIGHPID, 0, "%s: fc_thrd",
- device_get_nameunit(isp->isp_dev))) {
+ device_get_nameunit(isp->isp_dev)))
+#else
+ if (kthread_create(isp_kthread, isp, &isp->isp_osinfo.kproc,
+ "%s: fc_thrd", device_get_nameunit(isp->isp_dev)))
+#endif
+ {
xpt_bus_deregister(cam_sim_path(sim));
cam_sim_free(sim, TRUE);
config_intrhook_disestablish(&isp->isp_osinfo.ehook);
@@ -214,7 +239,7 @@
if (isplist == NULL) {
isplist = isp;
} else {
- struct ispsoftc *tmp = isplist;
+ ispsoftc_t *tmp = isplist;
while (tmp->isp_osinfo.next) {
tmp = tmp->isp_osinfo.next;
}
@@ -224,7 +249,7 @@
}
static __inline void
-isp_freeze_loopdown(struct ispsoftc *isp, char *msg)
+isp_freeze_loopdown(ispsoftc_t *isp, char *msg)
{
if (isp->isp_osinfo.simqfrozen == 0) {
isp_prt(isp, ISP_LOGDEBUG0, "%s: freeze simq (loopdown)", msg);
@@ -238,10 +263,19 @@
}
}
+
+#if __FreeBSD_version < 500000
+#define _DEV dev_t
+#define _IOP struct proc
+#else
+#define _IOP struct thread
+#define _DEV struct cdev *
+#endif
+
static int
-ispioctl(struct cdev *dev, u_long c, caddr_t addr, int flags, struct thread *td)
+ispioctl(_DEV dev, u_long c, caddr_t addr, int flags, _IOP *td)
{
- struct ispsoftc *isp;
+ ispsoftc_t *isp;
int nr, retval = ENOTTY;
isp = isplist;
@@ -577,7 +611,7 @@
static void
isp_intr_enable(void *arg)
{
- struct ispsoftc *isp = arg;
+ ispsoftc_t *isp = arg;
if (isp->isp_role != ISP_ROLE_NONE) {
ENABLE_INTS(isp);
#if 0
@@ -594,29 +628,29 @@
#ifdef ISP_TARGET_MODE
-static __inline int is_lun_enabled(struct ispsoftc *, int, lun_id_t);
-static __inline int are_any_luns_enabled(struct ispsoftc *, int);
-static __inline tstate_t *get_lun_statep(struct ispsoftc *, int, lun_id_t);
-static __inline void rls_lun_statep(struct ispsoftc *, tstate_t *);
-static __inline atio_private_data_t *isp_get_atpd(struct ispsoftc *, int);
+static __inline int is_lun_enabled(ispsoftc_t *, int, lun_id_t);
+static __inline int are_any_luns_enabled(ispsoftc_t *, int);
+static __inline tstate_t *get_lun_statep(ispsoftc_t *, int, lun_id_t);
+static __inline void rls_lun_statep(ispsoftc_t *, tstate_t *);
+static __inline atio_private_data_t *isp_get_atpd(ispsoftc_t *, int);
static cam_status
-create_lun_state(struct ispsoftc *, int, struct cam_path *, tstate_t **);
-static void destroy_lun_state(struct ispsoftc *, tstate_t *);
-static int isp_en_lun(struct ispsoftc *, union ccb *);
-static void isp_ledone(struct ispsoftc *, lun_entry_t *);
-static cam_status isp_abort_tgt_ccb(struct ispsoftc *, union ccb *);
+create_lun_state(ispsoftc_t *, int, struct cam_path *, tstate_t **);
+static void destroy_lun_state(ispsoftc_t *, tstate_t *);
+static int isp_en_lun(ispsoftc_t *, union ccb *);
+static void isp_ledone(ispsoftc_t *, lun_entry_t *);
+static cam_status isp_abort_tgt_ccb(ispsoftc_t *, union ccb *);
static timeout_t isp_refire_putback_atio;
static void isp_complete_ctio(union ccb *);
static void isp_target_putback_atio(union ccb *);
-static cam_status isp_target_start_ctio(struct ispsoftc *, union ccb *);
-static int isp_handle_platform_atio(struct ispsoftc *, at_entry_t *);
-static int isp_handle_platform_atio2(struct ispsoftc *, at2_entry_t *);
-static int isp_handle_platform_ctio(struct ispsoftc *, void *);
-static int isp_handle_platform_notify_scsi(struct ispsoftc *, in_entry_t *);
-static int isp_handle_platform_notify_fc(struct ispsoftc *, in_fcentry_t *);
+static void isp_target_start_ctio(ispsoftc_t *, union ccb *);
+static int isp_handle_platform_atio(ispsoftc_t *, at_entry_t *);
+static int isp_handle_platform_atio2(ispsoftc_t *, at2_entry_t *);
+static int isp_handle_platform_ctio(ispsoftc_t *, void *);
+static int isp_handle_platform_notify_scsi(ispsoftc_t *, in_entry_t *);
+static int isp_handle_platform_notify_fc(ispsoftc_t *, in_fcentry_t *);
static __inline int
-is_lun_enabled(struct ispsoftc *isp, int bus, lun_id_t lun)
+is_lun_enabled(ispsoftc_t *isp, int bus, lun_id_t lun)
{
tstate_t *tptr;
tptr = isp->isp_osinfo.lun_hash[LUN_HASH_FUNC(isp, bus, lun)];
@@ -632,7 +666,7 @@
}
static __inline int
-are_any_luns_enabled(struct ispsoftc *isp, int port)
+are_any_luns_enabled(ispsoftc_t *isp, int port)
{
int lo, hi;
if (IS_DUALBUS(isp)) {
@@ -651,7 +685,7 @@
}
static __inline tstate_t *
-get_lun_statep(struct ispsoftc *isp, int bus, lun_id_t lun)
+get_lun_statep(ispsoftc_t *isp, int bus, lun_id_t lun)
{
tstate_t *tptr = NULL;
@@ -679,14 +713,14 @@
}
static __inline void
-rls_lun_statep(struct ispsoftc *isp, tstate_t *tptr)
+rls_lun_statep(ispsoftc_t *isp, tstate_t *tptr)
{
if (tptr->hold)
tptr->hold--;
}
static __inline atio_private_data_t *
-isp_get_atpd(struct ispsoftc *isp, int tag)
+isp_get_atpd(ispsoftc_t *isp, int tag)
{
atio_private_data_t *atp;
for (atp = isp->isp_osinfo.atpdp;
@@ -698,7 +732,7 @@
}
static cam_status
-create_lun_state(struct ispsoftc *isp, int bus,
+create_lun_state(ispsoftc_t *isp, int bus,
struct cam_path *path, tstate_t **rslt)
{
cam_status status;
@@ -744,7 +778,7 @@
}
static __inline void
-destroy_lun_state(struct ispsoftc *isp, tstate_t *tptr)
+destroy_lun_state(ispsoftc_t *isp, tstate_t *tptr)
{
int hfx;
tstate_t *lw, *pw;
@@ -780,7 +814,7 @@
* Enable luns.
*/
static int
-isp_en_lun(struct ispsoftc *isp, union ccb *ccb)
+isp_en_lun(ispsoftc_t *isp, union ccb *ccb)
{
struct ccb_en_lun *cel = &ccb->cel;
tstate_t *tptr;
@@ -1023,7 +1057,7 @@
}
static void
-isp_ledone(struct ispsoftc *isp, lun_entry_t *lep)
+isp_ledone(ispsoftc_t *isp, lun_entry_t *lep)
{
const char lfmt[] = "lun %d now %sabled for target mode on channel %d";
union ccb *ccb;
@@ -1073,7 +1107,7 @@
if (cel->enable) {
ccb->ccb_h.status = CAM_REQ_CMP;
- isp_prt(isp, /* ISP_LOGINFO */ ISP_LOGALL, lfmt,
+ isp_prt(isp, ISP_LOGINFO, lfmt,
XS_LUN(ccb), "en", XS_CHANNEL(ccb));
rls_lun_statep(isp, tptr);
isp->isp_osinfo.leact[seq] = 0;
@@ -1119,7 +1153,7 @@
static cam_status
-isp_abort_tgt_ccb(struct ispsoftc *isp, union ccb *ccb)
+isp_abort_tgt_ccb(ispsoftc_t *isp, union ccb *ccb)
{
tstate_t *tptr;
struct ccb_hdr_slist *lp;
@@ -1197,8 +1231,8 @@
return (CAM_PATH_INVALID);
}
-static cam_status
-isp_target_start_ctio(struct ispsoftc *isp, union ccb *ccb)
+static void
+isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb)
{
void *qe;
struct ccb_scsiio *cso = &ccb->csio;
@@ -1210,7 +1244,8 @@
if (isp_getrqentry(isp, &nxti, &optr, &qe)) {
xpt_print_path(ccb->ccb_h.path);
printf("Request Queue Overflow in isp_target_start_ctio\n");
- return (CAM_RESRC_UNAVAIL);
+ XS_SETERR(ccb, CAM_REQUEUE_REQ);
+ goto out;
}
bzero(local, QENTRY_LEN);
@@ -1234,7 +1269,8 @@
isp_prt(isp, ISP_LOGERR,
"cannot find private data adjunct for tag %x",
cso->tag_id);
- return (-1);
+ XS_SETERR(ccb, CAM_REQ_CMP_ERR);
+ goto out;
}
cto->ct_rxid = cso->tag_id;
@@ -1297,8 +1333,9 @@
cso->dxfer_len, cto->ct_resid);
cto->ct_flags |= CT2_CCINCR;
atp->state = ATPD_STATE_LAST_CTIO;
- } else
+ } else {
atp->state = ATPD_STATE_CTIO;
+ }
cto->ct_timeout = 10;
hp = &cto->ct_syshandle;
} else {
@@ -1342,7 +1379,8 @@
if (isp_save_xs_tgt(isp, ccb, hp)) {
xpt_print_path(ccb->ccb_h.path);
printf("No XFLIST pointers for isp_target_start_ctio\n");
- return (CAM_RESRC_UNAVAIL);
+ XS_SETERR(ccb, CAM_REQUEUE_REQ);
+ goto out;
}
@@ -1360,17 +1398,22 @@
switch (ISP_DMASETUP(isp, cso, (ispreq_t *) local, &nxti, optr)) {
case CMD_QUEUED:
ISP_ADD_REQUEST(isp, nxti);
- return (CAM_REQ_INPROG);
+ ccb->ccb_h.status |= CAM_SIM_QUEUED;
+ return;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list