1/* 2 * Copyright 2004, Broadcom Corporation 3 * All Rights Reserved. 4 * 5 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY 6 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM 7 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 8 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. 9 * 10 * $Id: cablelink.c,v 1.1.1.1 2008/10/15 03:31:34 james26_jang Exp $ 11 */ 12 13#include "upnp_osl.h" 14#include "upnp_dbg.h" 15#include "upnp.h" 16 17 18char *CableLinkConfigState_allowedValueList[] = { "notReady", 19 "dsSyncComplete", "usParamAcquired", "rangingComplete", 20 "ipComplete", "todEstablished", "paramTransferComplete", 21 "registrationComplete", "operational", "accessDenied", 0 }; 22char *LinkType_allowedValueList[] = { "Ethernet", 0 }; 23 24char *Modulation_allowedValueList[] = { "64QAM", "256QAM", 0 }; 25 26 27 28static VarTemplate StateVariables[] = { 29 { "CableLinkConfigState", "operational", VAR_STRING|VAR_LIST, (allowedValue) { CableLinkConfigState_allowedValueList } }, 30 { "LinkType", "Ethernet", VAR_STRING|VAR_LIST, (allowedValue) { LinkType_allowedValueList } }, 31 { "DownstreamFrequency", "", VAR_LONG }, 32 { "DownstreamModulation", "64QAM", VAR_STRING|VAR_LIST, (allowedValue) { Modulation_allowedValueList }}, 33 { "UpstreamFrequency", "", VAR_LONG }, 34 { "UpstreamModulation", "64QAM", VAR_STRING|VAR_LIST, (allowedValue) { Modulation_allowedValueList } }, 35 { "UpstreamChannelID", "", VAR_LONG }, 36 { "UpstreamPowerLevel", "", VAR_LONG }, 37 { "ConfigFile", "", VAR_STRING }, 38 { "TFTPServer", "", VAR_STRING }, 39 { "BPIEncryptionEnabled", "", VAR_BOOL }, 40 { 0 } 41}; 42 43#define VAR_CableLinkConfigState 0 44#define VAR_LinkType 1 45#define VAR_DownstreamFrequency 2 46#define VAR_DownstreamModulation 3 47#define VAR_UpstreamFrequency 4 48#define VAR_UpstreamModulation 5 49#define VAR_UpstreamChannelID 6 50#define VAR_UpstreamPowerLevel 7 51#define VAR_ConfigFile 8 52#define VAR_TFTPServer 9 53#define VAR_BPIEncryptionEnabled 10 54 55#define GetConfigFile DefaultAction 56#define GetUpstreamModulation DefaultAction 57#define GetUpstreamFrequency DefaultAction 58#define GetUpstreamChannelID DefaultAction 59#define GetTFTPServer DefaultAction 60#define GetDownstreamFrequency DefaultAction 61#define GetBPIEncryptionEnabled DefaultAction 62#define GetUpstreamPowerLevel DefaultAction 63#define GetDownstreamModulation DefaultAction 64#define GetCableLinkConfigInfo DefaultAction 65 66 67static Action _GetConfigFile = { 68 "GetConfigFile", GetConfigFile, 69 { 70 {"NewConfigFile", VAR_ConfigFile, VAR_OUT}, 71 { 0 } 72 } 73}; 74 75static Action _GetUpstreamModulation = { 76 "GetUpstreamModulation", GetUpstreamModulation, 77 { 78 {"NewUpstreamModulation", VAR_UpstreamModulation, VAR_OUT}, 79 { 0 } 80 } 81}; 82 83static Action _GetUpstreamFrequency = { 84 "GetUpstreamFrequency", GetUpstreamFrequency, 85 { 86 {"NewUpstreamFrequency", VAR_UpstreamFrequency, VAR_OUT}, 87 { 0 } 88 } 89}; 90 91static Action _GetUpstreamChannelID = { 92 "GetUpstreamChannelID", GetUpstreamChannelID, 93 { 94 {"NewUpstreamChannelID", VAR_UpstreamChannelID, VAR_OUT}, 95 { 0 } 96 } 97}; 98 99static Action _GetTFTPServer = { 100 "GetTFTPServer", GetTFTPServer, 101 { 102 {"NewTFTPServer", VAR_TFTPServer, VAR_OUT}, 103 { 0 } 104 } 105}; 106 107static Action _GetDownstreamFrequency = { 108 "GetDownstreamFrequency", GetDownstreamFrequency, 109 { 110 {"NewDownstreamFrequency", VAR_DownstreamFrequency, VAR_OUT}, 111 { 0 } 112 } 113}; 114 115static Action _GetBPIEncryptionEnabled = { 116 "GetBPIEncryptionEnabled", GetBPIEncryptionEnabled, 117 { 118 {"NewBPIEncryptionEnabled", VAR_BPIEncryptionEnabled, VAR_OUT}, 119 { 0 } 120 } 121}; 122 123static Action _GetUpstreamPowerLevel = { 124 "GetUpstreamPowerLevel", GetUpstreamPowerLevel, 125 { 126 {"NewUpstreamPowerLevel", VAR_UpstreamPowerLevel, VAR_OUT}, 127 { 0 } 128 } 129}; 130 131static Action _GetDownstreamModulation = { 132 "GetDownstreamModulation", GetDownstreamModulation, 133 { 134 {"NewDownstreamModulation", VAR_DownstreamModulation, VAR_OUT}, 135 { 0 } 136 } 137}; 138 139static Action _GetCableLinkConfigInfo = { 140 "GetCableLinkConfigInfo", GetCableLinkConfigInfo, 141 { 142 {"NewCableLinkConfigState", VAR_CableLinkConfigState, VAR_OUT}, 143 {"NewLinkType", VAR_LinkType, VAR_OUT}, 144 { 0 } 145 } 146}; 147 148static PAction Actions[] = { 149 &_GetConfigFile, 150 &_GetUpstreamModulation, 151 &_GetUpstreamFrequency, 152 &_GetUpstreamChannelID, 153 &_GetTFTPServer, 154 &_GetDownstreamFrequency, 155 &_GetBPIEncryptionEnabled, 156 &_GetUpstreamPowerLevel, 157 &_GetDownstreamModulation, 158 &_GetCableLinkConfigInfo, 159 NULL 160}; 161 162 163 164ServiceTemplate Template_WANCableLinkConfig = { 165 "WANCableLinkConfig:1", 166 NULL, /* service initialization */ 167 NULL, /* state variable handler */ 168 NULL, /* xml generator */ 169 ARRAYSIZE(StateVariables)-1, StateVariables, 170 Actions 171}; 172 173 174 175 176 177