lpfc_mbox.c (8fa38513ddc1076f3e26c651f3567b084c273ba2) lpfc_mbox.c (a0c87cbdb52467a16343b31251f2722643db603c)
1/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2009 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com *
7 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
8 * *

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

74 mb->un.varDmp.resp_offset = 0;
75 pmb->context2 = ctx;
76 mb->mbxOwner = OWN_HOST;
77
78 return;
79}
80
81/**
1/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2009 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com *
7 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
8 * *

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

74 mb->un.varDmp.resp_offset = 0;
75 pmb->context2 = ctx;
76 mb->mbxOwner = OWN_HOST;
77
78 return;
79}
80
81/**
82 * lpfc_dump_mem - Prepare a mailbox command for retrieving HBA's VPD memory
82 * lpfc_down_link - Bring down HBAs link.
83 * @phba: pointer to lpfc hba data structure.
84 * @pmb: pointer to the driver internal queue element for mailbox command.
83 * @phba: pointer to lpfc hba data structure.
84 * @pmb: pointer to the driver internal queue element for mailbox command.
85 * @offset: offset for dumping VPD memory mailbox command.
86 *
85 *
86 * This routine prepares a mailbox command to bring down HBA link.
87 **/
88void
89lpfc_down_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
90{
91 MAILBOX_t *mb;
92 memset(pmb, 0, sizeof(LPFC_MBOXQ_t));
93 mb = &pmb->u.mb;
94 mb->mbxCommand = MBX_DOWN_LINK;
95 mb->mbxOwner = OWN_HOST;
96}
97
98/**
99 * lpfc_dump_mem - Prepare a mailbox command for reading a region.
100 * @phba: pointer to lpfc hba data structure.
101 * @pmb: pointer to the driver internal queue element for mailbox command.
102 * @offset: offset into the region.
103 * @region_id: config region id.
104 *
87 * The dump mailbox command provides a method for the device driver to obtain
88 * various types of information from the HBA device.
89 *
105 * The dump mailbox command provides a method for the device driver to obtain
106 * various types of information from the HBA device.
107 *
90 * This routine prepares the mailbox command for dumping HBA Vital Product
91 * Data (VPD) memory. This mailbox command is to be used for retrieving a
92 * portion (DMP_RSP_SIZE bytes) of a HBA's VPD from the HBA at an address
93 * offset specified by the offset parameter.
108 * This routine prepares the mailbox command for dumping HBA's config region.
94 **/
95void
109 **/
110void
96lpfc_dump_mem(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb, uint16_t offset)
111lpfc_dump_mem(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset,
112 uint16_t region_id)
97{
98 MAILBOX_t *mb;
99 void *ctx;
100
101 mb = &pmb->u.mb;
102 ctx = pmb->context2;
103
104 /* Setup to dump VPD region */
105 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
106 mb->mbxCommand = MBX_DUMP_MEMORY;
107 mb->un.varDmp.cv = 1;
108 mb->un.varDmp.type = DMP_NV_PARAMS;
109 mb->un.varDmp.entry_index = offset;
113{
114 MAILBOX_t *mb;
115 void *ctx;
116
117 mb = &pmb->u.mb;
118 ctx = pmb->context2;
119
120 /* Setup to dump VPD region */
121 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
122 mb->mbxCommand = MBX_DUMP_MEMORY;
123 mb->un.varDmp.cv = 1;
124 mb->un.varDmp.type = DMP_NV_PARAMS;
125 mb->un.varDmp.entry_index = offset;
110 mb->un.varDmp.region_id = DMP_REGION_VPD;
126 mb->un.varDmp.region_id = region_id;
111 mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t));
112 mb->un.varDmp.co = 0;
113 mb->un.varDmp.resp_offset = 0;
114 pmb->context2 = ctx;
115 mb->mbxOwner = OWN_HOST;
116 return;
117}
118

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

1859 memset(mp->virt, 0, LPFC_BPL_SIZE);
1860 INIT_LIST_HEAD(&mp->list);
1861
1862 /* save address for completion */
1863 mbox->context1 = (uint8_t *) mp;
1864
1865 mb->mbxCommand = MBX_DUMP_MEMORY;
1866 mb->un.varDmp.type = DMP_NV_PARAMS;
127 mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t));
128 mb->un.varDmp.co = 0;
129 mb->un.varDmp.resp_offset = 0;
130 pmb->context2 = ctx;
131 mb->mbxOwner = OWN_HOST;
132 return;
133}
134

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

1875 memset(mp->virt, 0, LPFC_BPL_SIZE);
1876 INIT_LIST_HEAD(&mp->list);
1877
1878 /* save address for completion */
1879 mbox->context1 = (uint8_t *) mp;
1880
1881 mb->mbxCommand = MBX_DUMP_MEMORY;
1882 mb->un.varDmp.type = DMP_NV_PARAMS;
1867 mb->un.varDmp.region_id = DMP_REGION_FCOEPARAM;
1868 mb->un.varDmp.sli4_length = DMP_FCOEPARAM_RGN_SIZE;
1883 mb->un.varDmp.region_id = DMP_REGION_23;
1884 mb->un.varDmp.sli4_length = DMP_RGN23_SIZE;
1869 mb->un.varWords[3] = putPaddrLow(mp->phys);
1870 mb->un.varWords[4] = putPaddrHigh(mp->phys);
1871 return 0;
1872}
1873
1874/**
1875 * lpfc_reg_fcfi - Initialize the REG_FCFI mailbox command
1876 * @phba: pointer to the hba structure containing the FCF index and RQ ID.

--- 68 unchanged lines hidden ---
1885 mb->un.varWords[3] = putPaddrLow(mp->phys);
1886 mb->un.varWords[4] = putPaddrHigh(mp->phys);
1887 return 0;
1888}
1889
1890/**
1891 * lpfc_reg_fcfi - Initialize the REG_FCFI mailbox command
1892 * @phba: pointer to the hba structure containing the FCF index and RQ ID.

--- 68 unchanged lines hidden ---