Deleted Added
sdiff udiff text old ( 231437 ) new ( 231879 )
full compact
1/*-
2 * Copyright (C) 2012 Emulex
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 are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

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

32 * freebsd-drivers@emulex.com
33 *
34 * Emulex
35 * 3333 Susan Street
36 * Costa Mesa, CA 92626
37 */
38
39
40
41/* $FreeBSD: head/sys/dev/oce/oce_mbox.c 231437 2012-02-10 21:03:04Z luigi $ */
42
43
44#include "oce_if.h"
45
46
47/**
48 * @brief Reset (firmware) common function
49 * @param sc software handle to the device
50 * @returns 0 on success, ETIMEDOUT on failure
51 */

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

140 }
141
142 device_printf(sc->dev, "Mailbox timed out\n");
143
144 return ETIMEDOUT;
145}
146
147
148
149/**
150 * @brief Mailbox dispatch
151 * @param sc software handle to the device
152 * @param tmo_sec timeout in seconds
153 */
154int
155oce_mbox_dispatch(POCE_SOFTC sc, uint32_t tmo_sec)
156{

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

284
285 bcopy(fwcmd->params.rsp.fw_ver_str, sc->fw_version, 32);
286
287 return 0;
288}
289
290
291/**
292 * @brief Function to post a MBX to the mbox
293 * @param sc software handle to the device
294 * @param mbx pointer to the MBX to send
295 * @param mbxctx pointer to the mbx context structure
296 * @returns 0 on success, error on failure
297 */
298int
299oce_mbox_post(POCE_SOFTC sc, struct oce_mbx *mbx, struct oce_mbx_ctx *mbxctx)

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

1323 mbx.u0.s.sge_count = 1;
1324
1325 sgl = &mbx.payload.u0.u1.sgl[0];
1326 sgl->pa_hi = upper_32_bits(pdma_mem->paddr);
1327 sgl->pa_lo = pdma_mem->paddr & 0xFFFFFFFF;
1328 sgl->length = payload_len;
1329
1330 /* post the command */
1331 if (rc) {
1332 device_printf(sc->dev, "Write FlashROM mbox post failed\n");
1333 } else {
1334 rc = fwcmd->hdr.u0.rsp.status;
1335 }
1336
1337 return rc;
1338

--- 367 unchanged lines hidden ---