aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-03-03 07:10:30 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-04 02:50:45 -0500
commiteae6b58fb229bd17fea38d596020b80547e51381 (patch)
treebae4bf20fb4d130829ab142bebf0fea585128a29 /drivers/net/qlge
parent38d408152a86598a50680a82fe3353b506630409 (diff)
qlge: Add firmware support for insert/remove SFP.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r--drivers/net/qlge/qlge_mpi.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c
index ef610c674dfb..ebb7b0c48dea 100644
--- a/drivers/net/qlge/qlge_mpi.c
+++ b/drivers/net/qlge/qlge_mpi.c
@@ -200,6 +200,36 @@ exit:
200 ql_write32(qdev, CSR, CSR_CMD_CLR_R2PCI_INT); 200 ql_write32(qdev, CSR, CSR_CMD_CLR_R2PCI_INT);
201} 201}
202 202
203static int ql_sfp_in(struct ql_adapter *qdev, struct mbox_params *mbcp)
204{
205 int status;
206
207 mbcp->out_count = 5;
208
209 status = ql_get_mb_sts(qdev, mbcp);
210 if (status)
211 QPRINTK(qdev, DRV, ERR, "SFP in AEN broken!\n");
212 else
213 QPRINTK(qdev, DRV, ERR, "SFP insertion detected.\n");
214
215 return status;
216}
217
218static int ql_sfp_out(struct ql_adapter *qdev, struct mbox_params *mbcp)
219{
220 int status;
221
222 mbcp->out_count = 1;
223
224 status = ql_get_mb_sts(qdev, mbcp);
225 if (status)
226 QPRINTK(qdev, DRV, ERR, "SFP out AEN broken!\n");
227 else
228 QPRINTK(qdev, DRV, ERR, "SFP removal detected.\n");
229
230 return status;
231}
232
203static void ql_init_fw_done(struct ql_adapter *qdev, struct mbox_params *mbcp) 233static void ql_init_fw_done(struct ql_adapter *qdev, struct mbox_params *mbcp)
204{ 234{
205 mbcp->out_count = 2; 235 mbcp->out_count = 2;
@@ -284,6 +314,14 @@ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp)
284 ql_init_fw_done(qdev, mbcp); 314 ql_init_fw_done(qdev, mbcp);
285 break; 315 break;
286 316
317 case AEN_AEN_SFP_IN:
318 ql_sfp_in(qdev, mbcp);
319 break;
320
321 case AEN_AEN_SFP_OUT:
322 ql_sfp_out(qdev, mbcp);
323 break;
324
287 case AEN_FW_INIT_FAIL: 325 case AEN_FW_INIT_FAIL:
288 case AEN_SYS_ERR: 326 case AEN_SYS_ERR:
289 ql_queue_fw_error(qdev); 327 ql_queue_fw_error(qdev);