]> Pileus Git - ~andy/linux/blobdiff - drivers/scsi/bfa/bfa_port.c
Merge remote-tracking branch 'regulator/fix/doc' into tmp
[~andy/linux] / drivers / scsi / bfa / bfa_port.c
index 95e4ad8759acfbcfc5d7ff27d29b40bac2e2f7b9..8ea7697deb9bdd87f6be661d6cf5a70ff44c171a 100644 (file)
@@ -250,6 +250,12 @@ bfa_port_enable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn,
                return BFA_STATUS_IOC_FAILURE;
        }
 
+       /* if port is d-port enabled, return error */
+       if (port->dport_enabled) {
+               bfa_trc(port, BFA_STATUS_DPORT_ERR);
+               return BFA_STATUS_DPORT_ERR;
+       }
+
        if (port->endis_pending) {
                bfa_trc(port, BFA_STATUS_DEVBUSY);
                return BFA_STATUS_DEVBUSY;
@@ -300,6 +306,12 @@ bfa_port_disable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn,
                return BFA_STATUS_IOC_FAILURE;
        }
 
+       /* if port is d-port enabled, return error */
+       if (port->dport_enabled) {
+               bfa_trc(port, BFA_STATUS_DPORT_ERR);
+               return BFA_STATUS_DPORT_ERR;
+       }
+
        if (port->endis_pending) {
                bfa_trc(port, BFA_STATUS_DEVBUSY);
                return BFA_STATUS_DEVBUSY;
@@ -431,6 +443,10 @@ bfa_port_notify(void *arg, enum bfa_ioc_event_e event)
                        port->endis_cbfn = NULL;
                        port->endis_pending = BFA_FALSE;
                }
+
+               /* clear D-port mode */
+               if (port->dport_enabled)
+                       bfa_port_set_dportenabled(port, BFA_FALSE);
                break;
        default:
                break;
@@ -467,6 +483,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
        port->stats_cbfn = NULL;
        port->endis_cbfn = NULL;
        port->pbc_disabled = BFA_FALSE;
+       port->dport_enabled = BFA_FALSE;
 
        bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port);
        bfa_q_qe_init(&port->ioc_notify);
@@ -482,6 +499,21 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
        bfa_trc(port, 0);
 }
 
+/*
+ * bfa_port_set_dportenabled();
+ *
+ * Port module- set pbc disabled flag
+ *
+ * @param[in] port - Pointer to the Port module data structure
+ *
+ * @return void
+ */
+void
+bfa_port_set_dportenabled(struct bfa_port_s *port, bfa_boolean_t enabled)
+{
+       port->dport_enabled = enabled;
+}
+
 /*
  *     CEE module specific definitions
  */