summaryrefslogtreecommitdiffstats
path: root/private/ntos/ndis/digi/pcimac/cm_prof.c
blob: be6376c6580a6401052f725d97880be3f4c1409b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * CM_PROF.C - profile related code
 */

#include	<ndis.h>
#include	<ndiswan.h>
#include	<mytypes.h>
#include	<mydefs.h>
#include	<disp.h>
#include	<util.h>
#include	<opcodes.h>
#include	<adapter.h>
#include	<idd.h>
#include    <mtl.h>
#include	<cm.h>

/* set profile in cm */
INT
cm_set_profile(VOID *cm_1, CM_PROF *prof)
{
	CM	*cm = (CM*)cm_1;
    D_LOG(D_ENTRY, ("cm_set_prof: entry, cm: 0x%lx, prof: 0x%lx", cm, prof));

    /* connection must be idle to change profile! */
    if ( cm->state != CM_ST_IDLE )
        return(CM_E_BUSY);

    /* set & return */
    cm->oprof = *prof;

    return(CM_E_SUCC);
}

/* get profile from cm */
INT
cm_get_profile(VOID *cm_1, CM_PROF *prof)
{
	CM	*cm = (CM*)cm_1;
    D_LOG(D_ENTRY, ("cm_get_prof: entry, cm: 0x%lx, prof: 0x%lx", cm, prof));

     /* connection must has a profile */
    if ( !cm->oprof.name[0] )
        return(CM_E_NOSUCH);

    /* set & return */
    *prof = cm->dprof;

    return(CM_E_SUCC);
}