Deleted Added
full compact
isp.c (284808) isp.c (285146)
1/*-
2 * Copyright (c) 1997-2009 by Matthew Jacob
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 33 unchanged lines hidden (view full) ---

42 */
43#ifdef __NetBSD__
44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD$");
46#include <dev/ic/isp_netbsd.h>
47#endif
48#ifdef __FreeBSD__
49#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997-2009 by Matthew Jacob
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 33 unchanged lines hidden (view full) ---

42 */
43#ifdef __NetBSD__
44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD$");
46#include <dev/ic/isp_netbsd.h>
47#endif
48#ifdef __FreeBSD__
49#include <sys/cdefs.h>
50__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 284808 2015-06-25 10:03:38Z mav $");
50__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 285146 2015-07-04 18:38:46Z mav $");
51#include <dev/isp/isp_freebsd.h>
52#endif
53#ifdef __OpenBSD__
54#include <dev/ic/isp_openbsd.h>
55#endif
56#ifdef __linux__
57#include "isp_linux.h"
58#endif

--- 2159 unchanged lines hidden (view full) ---

2218
2219 /*
2220 * Whatever happens, we're now committed to being here.
2221 */
2222 isp->isp_state = ISP_INITSTATE;
2223}
2224
2225static void
51#include <dev/isp/isp_freebsd.h>
52#endif
53#ifdef __OpenBSD__
54#include <dev/ic/isp_openbsd.h>
55#endif
56#ifdef __linux__
57#include "isp_linux.h"
58#endif

--- 2159 unchanged lines hidden (view full) ---

2218
2219 /*
2220 * Whatever happens, we're now committed to being here.
2221 */
2222 isp->isp_state = ISP_INITSTATE;
2223}
2224
2225static void
2226isp_del_all_init_entries(ispsoftc_t *isp, int chan)
2227{
2228 fcparam *fcp = FCPARAM(isp, chan);
2229 fcportdb_t *lp;
2230 int i;
2231
2232 for (i = 0; i < MAX_FC_TARG; i++) {
2233 lp = &fcp->portdb[i];
2234 if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode)
2235 continue;
2236 /*
2237 * It's up to the outer layers to clear isp_dev_map.
2238 */
2239 lp->state = FC_PORTDB_STATE_NIL;
2240 isp_async(isp, ISPASYNC_DEV_GONE, chan, lp, 1);
2241 if (lp->autologin == 0) {
2242 (void) isp_plogx(isp, chan, lp->handle,
2243 lp->portid,
2244 PLOGX_FLG_CMD_LOGO |
2245 PLOGX_FLG_IMPLICIT |
2246 PLOGX_FLG_FREE_NPHDL, 0);
2247 } else {
2248 lp->autologin = 0;
2249 }
2250 lp->new_prli_word3 = 0;
2251 lp->new_portid = 0;
2252 }
2253}
2254
2255static void
2226isp_mark_portdb(ispsoftc_t *isp, int chan, int disposition)
2227{
2228 fcparam *fcp = FCPARAM(isp, chan);
2229 int i;
2230
2231 if (chan < 0 || chan >= isp->isp_nchan) {
2232 isp_prt(isp, ISP_LOGWARN, "isp_mark_portdb: bad channel %d", chan);
2233 return;

--- 742 unchanged lines hidden (view full) ---

2976
2977 switch (lp->state) {
2978 case FC_PORTDB_STATE_PROBATIONAL:
2979 case FC_PORTDB_STATE_DEAD:
2980 /*
2981 * It's up to the outer layers to clear isp_dev_map.
2982 */
2983 lp->state = FC_PORTDB_STATE_NIL;
2256isp_mark_portdb(ispsoftc_t *isp, int chan, int disposition)
2257{
2258 fcparam *fcp = FCPARAM(isp, chan);
2259 int i;
2260
2261 if (chan < 0 || chan >= isp->isp_nchan) {
2262 isp_prt(isp, ISP_LOGWARN, "isp_mark_portdb: bad channel %d", chan);
2263 return;

--- 742 unchanged lines hidden (view full) ---

3006
3007 switch (lp->state) {
3008 case FC_PORTDB_STATE_PROBATIONAL:
3009 case FC_PORTDB_STATE_DEAD:
3010 /*
3011 * It's up to the outer layers to clear isp_dev_map.
3012 */
3013 lp->state = FC_PORTDB_STATE_NIL;
2984 isp_async(isp, ISPASYNC_DEV_GONE, chan, lp);
3014 isp_async(isp, ISPASYNC_DEV_GONE, chan, lp, 0);
2985 if (lp->autologin == 0) {
2986 (void) isp_plogx(isp, chan, lp->handle,
2987 lp->portid,
2988 PLOGX_FLG_CMD_LOGO |
2989 PLOGX_FLG_IMPLICIT |
2990 PLOGX_FLG_FREE_NPHDL, 0);
2991 } else {
2992 lp->autologin = 0;

--- 1992 unchanged lines hidden (view full) ---

4985 if ((r & 0xffff) == MBOX_PORT_ID_USED) {
4986 p->handle = r >> 16;
4987 r = 0;
4988 break;
4989 }
4990 } while ((r & 0xffff) == MBOX_LOOP_ID_USED);
4991 return (r);
4992 }
3015 if (lp->autologin == 0) {
3016 (void) isp_plogx(isp, chan, lp->handle,
3017 lp->portid,
3018 PLOGX_FLG_CMD_LOGO |
3019 PLOGX_FLG_IMPLICIT |
3020 PLOGX_FLG_FREE_NPHDL, 0);
3021 } else {
3022 lp->autologin = 0;

--- 1992 unchanged lines hidden (view full) ---

5015 if ((r & 0xffff) == MBOX_PORT_ID_USED) {
5016 p->handle = r >> 16;
5017 r = 0;
5018 break;
5019 }
5020 } while ((r & 0xffff) == MBOX_LOOP_ID_USED);
5021 return (r);
5022 }
5023 case ISPCTL_CHANGE_ROLE:
5024 {
5025 int role, r;
5026
5027 va_start(ap, ctl);
5028 chan = va_arg(ap, int);
5029 role = va_arg(ap, int);
5030 va_end(ap);
5031 if (IS_FC(isp)) {
5032#ifdef ISP_TARGET_MODE
5033 if ((role & ISP_ROLE_TARGET) == 0)
5034 isp_del_all_wwn_entries(isp, chan);
5035#endif
5036 if ((role & ISP_ROLE_INITIATOR) == 0)
5037 isp_del_all_init_entries(isp, chan);
5038 r = isp_fc_change_role(isp, chan, role);
5039 } else {
5040 SDPARAM(isp, chan)->role = role;
5041 r = 0;
5042 }
5043 return (r);
5044 }
4993 default:
4994 isp_prt(isp, ISP_LOGERR, "Unknown Control Opcode 0x%x", ctl);
4995 break;
4996
4997 }
4998 return (-1);
4999}
5000

--- 3519 unchanged lines hidden ---
5045 default:
5046 isp_prt(isp, ISP_LOGERR, "Unknown Control Opcode 0x%x", ctl);
5047 break;
5048
5049 }
5050 return (-1);
5051}
5052

--- 3519 unchanged lines hidden ---