/* bnx2i_sysfs.c: QLogic NetXtreme II iSCSI driver. * * Copyright (c) 2004 - 2013 Broadcom Corporation * Copyright (c) 2014, QLogic Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * Written by: Anil Veerabhadrappa ([email protected]) * Previously Maintained by: Eddie Wai ([email protected]) * Maintained by: [email protected] */ #include "bnx2i.h" /** * bnx2i_dev_to_hba - maps dev pointer to adapter struct * @dev: device pointer * * Map device to hba structure */ static inline struct bnx2i_hba *bnx2i_dev_to_hba(struct device *dev) { … } /** * bnx2i_show_sq_info - return(s currently configured send queue (SQ) size * @dev: device pointer * @attr: device attribute (unused) * @buf: buffer to return current SQ size parameter * * Returns current SQ size parameter, this paramater determines the number * outstanding iSCSI commands supported on a connection */ static ssize_t bnx2i_show_sq_info(struct device *dev, struct device_attribute *attr, char *buf) { … } /** * bnx2i_set_sq_info - update send queue (SQ) size parameter * @dev: device pointer * @attr: device attribute (unused) * @buf: buffer to return current SQ size parameter * @count: parameter buffer size * * Interface for user to change shared queue size allocated for each conn * Must be within SQ limits and a power of 2. For the latter this is needed * because of how libiscsi preallocates tasks. */ static ssize_t bnx2i_set_sq_info(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { … } /** * bnx2i_show_ccell_info - returns command cell (HQ) size * @dev: device pointer * @attr: device attribute (unused) * @buf: buffer to return current SQ size parameter * * returns per-connection TCP history queue size parameter */ static ssize_t bnx2i_show_ccell_info(struct device *dev, struct device_attribute *attr, char *buf) { … } /** * bnx2i_set_ccell_info - set command cell (HQ) size * @dev: device pointer * @attr: device attribute (unused) * @buf: buffer to return current SQ size parameter * @count: parameter buffer size * * updates per-connection TCP history queue size parameter */ static ssize_t bnx2i_set_ccell_info(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { … } static DEVICE_ATTR(sq_size, S_IRUGO | S_IWUSR, bnx2i_show_sq_info, bnx2i_set_sq_info); static DEVICE_ATTR(num_ccell, S_IRUGO | S_IWUSR, bnx2i_show_ccell_info, bnx2i_set_ccell_info); static struct attribute *bnx2i_dev_attributes[] = …; static const struct attribute_group bnx2i_dev_attr_group = …; const struct attribute_group *bnx2i_dev_groups[] = …;