8867 add MAC_CAPAB_TRANSCEIVER support for cxgbe
[unleashed.git] / usr / src / uts / common / io / cxgbe / t4nex / osdep.c
blob8cb38f53eaf73b50603542cda675dad5c02adfa6
1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * This file is part of the Chelsio T4 support code.
15 * Copyright (C) 2010-2013 Chelsio Communications. All rights reserved.
17 * This program is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this
20 * release for licensing terms and conditions.
23 #include "common.h"
24 #include "osdep.h"
26 int
27 ilog2(long x)
29 return (ddi_fls(x) - 1);
32 unsigned char *
33 strstrip(unsigned char *s)
35 unsigned char c, *r, *trim_at;
37 while (isspace(*s))
38 s++;
39 r = trim_at = s;
41 while ((c = *s++) != 0) {
42 if (!isspace(c))
43 trim_at = s;
45 *trim_at = 0;
47 return (r);