Print this page
6601 Various GLD drivers return EINVAL instead of ENOTSUP for unused mac_prop_id_t's
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/hxge/hxge_main.c
          +++ new/usr/src/uts/common/io/hxge/hxge_main.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   * Copyright 2012 Milan Jurik. All rights reserved.
       25 + * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
  25   26   */
  26   27  
  27   28  /*
  28   29   * SunOs MT STREAMS Hydra 10Gb Ethernet Device Driver.
  29   30   */
  30   31  #include <hxge_impl.h>
  31   32  #include <hxge_pfc.h>
  32   33  
  33   34  /*
  34   35   * PSARC/2007/453 MSI-X interrupt limit override
↓ open down ↓ 3279 lines elided ↑ open up ↑
3314 3315                  case MAC_PROP_EN_10HDX_CAP:
3315 3316                          err = ENOTSUP;
3316 3317                          break;
3317 3318  
3318 3319                  case MAC_PROP_PRIVATE:
3319 3320                          err = hxge_get_priv_prop(hxgep, pr_name, pr_valsize,
3320 3321                              pr_val);
3321 3322                          break;
3322 3323  
3323 3324                  default:
3324      -                        err = EINVAL;
     3325 +                        err = ENOTSUP;
3325 3326                          break;
3326 3327          }
3327 3328  
3328 3329          HXGE_DEBUG_MSG((hxgep, DLADM_CTL, "<== hxge_m_getprop"));
3329 3330  
3330 3331          return (err);
3331 3332  }
3332 3333  
3333 3334  static void
3334 3335  hxge_m_propinfo(void *arg, const char *pr_name,
↓ open down ↓ 91 lines elided ↑ open up ↑
3426 3427          } else if (strcmp(pr_name, "_class_opt_ipv6_udp") == 0) {
3427 3428                  err = hxge_param_set_ip_opt(hxgep, NULL, NULL, (char *)pr_val,
3428 3429                      (caddr_t)&param_arr[param_class_opt_ipv6_udp]);
3429 3430          } else if (strcmp(pr_name, "_class_opt_ipv6_ah") == 0) {
3430 3431                  err = hxge_param_set_ip_opt(hxgep, NULL, NULL, (char *)pr_val,
3431 3432                      (caddr_t)&param_arr[param_class_opt_ipv6_ah]);
3432 3433          } else if (strcmp(pr_name, "_class_opt_ipv6_sctp") == 0) {
3433 3434                  err = hxge_param_set_ip_opt(hxgep, NULL, NULL, (char *)pr_val,
3434 3435                      (caddr_t)&param_arr[param_class_opt_ipv6_sctp]);
3435 3436          } else {
3436      -                err = EINVAL;
     3437 +                err = ENOTSUP;
3437 3438          }
3438 3439  
3439 3440          HXGE_DEBUG_MSG((hxgep, DLADM_CTL,
3440 3441              "<== hxge_set_priv_prop: err %d", err));
3441 3442  
3442 3443          return (err);
3443 3444  }
3444 3445  
3445 3446  static int
3446 3447  hxge_get_priv_prop(p_hxge_t hxgep, const char *pr_name, uint_t pr_valsize,
↓ open down ↓ 49 lines elided ↑ open up ↑
3496 3497                  err = hxge_param_get_ip_opt(hxgep, NULL, NULL,
3497 3498                      (caddr_t)&param_arr[param_class_opt_ipv6_ah]);
3498 3499  
3499 3500                  value = (int)param_arr[param_class_opt_ipv6_ah].value;
3500 3501          } else if (strcmp(pr_name, "_class_opt_ipv6_sctp") == 0) {
3501 3502                  err = hxge_param_get_ip_opt(hxgep, NULL, NULL,
3502 3503                      (caddr_t)&param_arr[param_class_opt_ipv6_sctp]);
3503 3504  
3504 3505                  value = (int)param_arr[param_class_opt_ipv6_sctp].value;
3505 3506          } else {
3506      -                err = EINVAL;
     3507 +                err = ENOTSUP;
3507 3508          }
3508 3509  
3509 3510          if (err == 0) {
3510 3511                  (void) snprintf(valstr, sizeof (valstr), "0x%x", value);
3511 3512  
3512 3513                  strsize = (uint_t)strlen(valstr);
3513 3514                  if (pr_valsize < strsize) {
3514 3515                          err = ENOBUFS;
3515 3516                  } else {
3516 3517                          (void) strlcpy(pr_val, valstr, pr_valsize);
↓ open down ↓ 1010 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX