/* * Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved. * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include <linux/delay.h> #include <linux/pci.h> #include <linux/vmalloc.h> #include "qib.h" #include "qib_qsfp.h" /* * QSFP support for ib_qib driver, using "Two Wire Serial Interface" driver * in qib_twsi.c */ #define QSFP_MAX_RETRY … static int qsfp_read(struct qib_pportdata *ppd, int addr, void *bp, int len) { … } /* * qsfp_write * We do not ordinarily write the QSFP, but this is needed to select * the page on non-flat QSFPs, and possibly later unusual cases */ static int qib_qsfp_write(struct qib_pportdata *ppd, int addr, void *bp, int len) { … } /* * For validation, we want to check the checksums, even of the * fields we do not otherwise use. This function reads the bytes from * <first> to <next-1> and returns the 8lsbs of the sum, or <0 for errors */ static int qsfp_cks(struct qib_pportdata *ppd, int first, int next) { … } int qib_refresh_qsfp_cache(struct qib_pportdata *ppd, struct qib_qsfp_cache *cp) { … } const char * const qib_qsfp_devtech[16] = …; #define QSFP_DUMP_CHUNK … #define QSFP_DEFAULT_HDR_CNT … static const char *pwr_codes = …; int qib_qsfp_mod_present(struct qib_pportdata *ppd) { … } /* * Initialize structures that control access to QSFP. Called once per port * on cards that support QSFP. */ void qib_qsfp_init(struct qib_qsfp_data *qd, void (*fevent)(struct work_struct *)) { … } int qib_qsfp_dump(struct qib_pportdata *ppd, char *buf, int len) { … }