1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Copyright 2011 Cisco Systems, Inc. All rights reserved. 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * This program is free software; you may redistribute it and/or modify 5*4882a593Smuzhiyun * it under the terms of the GNU General Public License as published by 6*4882a593Smuzhiyun * the Free Software Foundation; version 2 of the License. 7*4882a593Smuzhiyun * 8*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 9*4882a593Smuzhiyun * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 10*4882a593Smuzhiyun * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 11*4882a593Smuzhiyun * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 12*4882a593Smuzhiyun * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 13*4882a593Smuzhiyun * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14*4882a593Smuzhiyun * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 15*4882a593Smuzhiyun * SOFTWARE. 16*4882a593Smuzhiyun * 17*4882a593Smuzhiyun */ 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun #ifndef _ENIC_PP_H_ 20*4882a593Smuzhiyun #define _ENIC_PP_H_ 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun #define ENIC_PP_BY_INDEX(enic, vf, pp, err) \ 23*4882a593Smuzhiyun do { \ 24*4882a593Smuzhiyun if (enic_is_valid_pp_vf(enic, vf, err)) \ 25*4882a593Smuzhiyun pp = (vf == PORT_SELF_VF) ? enic->pp : enic->pp + vf; \ 26*4882a593Smuzhiyun else \ 27*4882a593Smuzhiyun pp = NULL; \ 28*4882a593Smuzhiyun } while (0) 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun int enic_process_set_pp_request(struct enic *enic, int vf, 31*4882a593Smuzhiyun struct enic_port_profile *prev_pp, int *restore_pp); 32*4882a593Smuzhiyun int enic_process_get_pp_request(struct enic *enic, int vf, 33*4882a593Smuzhiyun int request, u16 *response); 34*4882a593Smuzhiyun int enic_is_valid_pp_vf(struct enic *enic, int vf, int *err); 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun #endif /* _ENIC_PP_H_ */ 37