Print this page
10086 ixgbe_m_propinfo() is missing an 'else'


  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  29  * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
  30  * Copyright (c) 2017, Joyent, Inc.
  31  */
  32 
  33 #include "ixgbe_sw.h"
  34 
  35 /*
  36  * Bring the device out of the reset/quiesced state that it
  37  * was in when the interface was registered.
  38  */
  39 int
  40 ixgbe_m_start(void *arg)
  41 {
  42         ixgbe_t *ixgbe = (ixgbe_t *)arg;
  43 
  44         mutex_enter(&ixgbe->gen_lock);
  45 
  46         if (ixgbe->ixgbe_state & IXGBE_SUSPENDED) {
  47                 mutex_exit(&ixgbe->gen_lock);
  48                 return (ECANCELED);
  49         }
  50 


 804                 bzero(valstr, sizeof (valstr));
 805 
 806                 if (strcmp(pr_name, "_adv_pause_cap") == 0 ||
 807                     strcmp(pr_name, "_adv_asym_pause_cap") == 0) {
 808                         mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
 809                         return;
 810                 }
 811 
 812                 if (strcmp(pr_name, "_tx_copy_thresh") == 0) {
 813                         value = DEFAULT_TX_COPY_THRESHOLD;
 814                 } else if (strcmp(pr_name, "_tx_recycle_thresh") == 0) {
 815                         value = DEFAULT_TX_RECYCLE_THRESHOLD;
 816                 } else if (strcmp(pr_name, "_tx_overload_thresh") == 0) {
 817                         value = DEFAULT_TX_OVERLOAD_THRESHOLD;
 818                 } else if (strcmp(pr_name, "_tx_resched_thresh") == 0) {
 819                         value = DEFAULT_TX_RESCHED_THRESHOLD;
 820                 } else  if (strcmp(pr_name, "_rx_copy_thresh") == 0) {
 821                         value = DEFAULT_RX_COPY_THRESHOLD;
 822                 } else  if (strcmp(pr_name, "_rx_limit_per_intr") == 0) {
 823                         value = DEFAULT_RX_LIMIT_PER_INTR;
 824                 }       if (strcmp(pr_name, "_intr_throttling") == 0) {
 825                         value = ixgbe->capab->def_intr_throttle;
 826                 } else {
 827                         return;
 828                 }
 829 
 830                 (void) snprintf(valstr, sizeof (valstr), "%x", value);
 831         }
 832         }
 833 }
 834 
 835 boolean_t
 836 ixgbe_param_locked(mac_prop_id_t pr_num)
 837 {
 838         /*
 839          * All en_* parameters are locked (read-only) while
 840          * the device is in any sort of loopback mode ...
 841          */
 842         switch (pr_num) {
 843                 case MAC_PROP_EN_10GFDX_CAP:
 844                 case MAC_PROP_EN_5000FDX_CAP:




  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  29  * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
  30  * Copyright (c) 2018, Joyent, Inc.
  31  */
  32 
  33 #include "ixgbe_sw.h"
  34 
  35 /*
  36  * Bring the device out of the reset/quiesced state that it
  37  * was in when the interface was registered.
  38  */
  39 int
  40 ixgbe_m_start(void *arg)
  41 {
  42         ixgbe_t *ixgbe = (ixgbe_t *)arg;
  43 
  44         mutex_enter(&ixgbe->gen_lock);
  45 
  46         if (ixgbe->ixgbe_state & IXGBE_SUSPENDED) {
  47                 mutex_exit(&ixgbe->gen_lock);
  48                 return (ECANCELED);
  49         }
  50 


 804                 bzero(valstr, sizeof (valstr));
 805 
 806                 if (strcmp(pr_name, "_adv_pause_cap") == 0 ||
 807                     strcmp(pr_name, "_adv_asym_pause_cap") == 0) {
 808                         mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
 809                         return;
 810                 }
 811 
 812                 if (strcmp(pr_name, "_tx_copy_thresh") == 0) {
 813                         value = DEFAULT_TX_COPY_THRESHOLD;
 814                 } else if (strcmp(pr_name, "_tx_recycle_thresh") == 0) {
 815                         value = DEFAULT_TX_RECYCLE_THRESHOLD;
 816                 } else if (strcmp(pr_name, "_tx_overload_thresh") == 0) {
 817                         value = DEFAULT_TX_OVERLOAD_THRESHOLD;
 818                 } else if (strcmp(pr_name, "_tx_resched_thresh") == 0) {
 819                         value = DEFAULT_TX_RESCHED_THRESHOLD;
 820                 } else  if (strcmp(pr_name, "_rx_copy_thresh") == 0) {
 821                         value = DEFAULT_RX_COPY_THRESHOLD;
 822                 } else  if (strcmp(pr_name, "_rx_limit_per_intr") == 0) {
 823                         value = DEFAULT_RX_LIMIT_PER_INTR;
 824                 } else if (strcmp(pr_name, "_intr_throttling") == 0) {
 825                         value = ixgbe->capab->def_intr_throttle;
 826                 } else {
 827                         return;
 828                 }
 829 
 830                 (void) snprintf(valstr, sizeof (valstr), "%x", value);
 831         }
 832         }
 833 }
 834 
 835 boolean_t
 836 ixgbe_param_locked(mac_prop_id_t pr_num)
 837 {
 838         /*
 839          * All en_* parameters are locked (read-only) while
 840          * the device is in any sort of loopback mode ...
 841          */
 842         switch (pr_num) {
 843                 case MAC_PROP_EN_10GFDX_CAP:
 844                 case MAC_PROP_EN_5000FDX_CAP: