answer stringlengths 15 1.25M |
|---|
module.exports = function (/* grunt, cfg */) {
'use strict';
return {
options: {
compress: true,
dumpLineNumbers: 'all',
sourceMap: true,
relativeUrls: true
},
styles: {
files: {
'src/css/styles.css': 'src/less/styles.less'
}
},
uikit: {
files: {
'src/css/uikit.css': 'src/less/uikit.less'
}
}
};
}; |
<?php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wpforwoocomm');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', '');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
define('AUTH_KEY', '_(oSqU]j[7yM+O[E63Il5<}x*31rkofj+=knmePz$uTi.#Xs8^?R~K&Eq*|a!v*l');
define('SECURE_AUTH_KEY', 'Nlo-`shc%%_Zq7o&.I>7yeDS!V?!YGT%S|kgX iwf=s8>*YKE{e9T.V>7Y-`S2
define('LOGGED_IN_KEY', '.OGQyvP|HaGtAIa8%k)lOv]:oPHS5k<L}l=vO(V@[m0#ELJ9hpaUgV?|!K8b>sJ}');
define('NONCE_KEY', 'G/&&9z*)rC:l/uN10IcIM0n0cxmU:M2WIymbH6/P?wtEq(W9u6]8icPH`CM5/V]*');
define('AUTH_SALT', '1)e-=[OKv_ .2:RM|ou.11*- 9&=Fb5(dwH%F9qcr?T~3^u.KE,B=Be3svD)z=Vn');
define('SECURE_AUTH_SALT', '}E+fS^e_%-(A-Th8[al`sf/SrQD.VxS0&wc#7)v ]9!H>LZ7dD}qG$b&yG6ZHO!=');
define('LOGGED_IN_SALT', 'hF~eO_3)w!j|Qr<:d1y<Za{Y&3]$CaD(RNnS~VR<2uz7nxn($B@KU+)(C}($;jZ[');
define('NONCE_SALT', '/3v12bWN~)a6NwQ:R/XP$s^R-Vqa-ItS%@+WJ9*z0GTo,2 eZ,mBL0nTh=(NRW=b');
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wpcomm_';
/**
* WordPress Localized Language, defaults to English.
*
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to wp-content/languages. For example, install
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
* language support.
*/
define('WPLANG', '');
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', false);
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php'); |
<?php
/**
* Includes all of the WordPress Administration API files.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Bookmark Administration API */
require_once(ABSPATH . 'wp-admin/includes/bookmark.php');
/** WordPress Comment Administration API */
require_once(ABSPATH . 'wp-admin/includes/comment.php');
/** WordPress Administration File API */
require_once(ABSPATH . 'wp-admin/includes/file.php');
/** WordPress Image Administration API */
require_once(ABSPATH . 'wp-admin/includes/image.php');
/** WordPress Media Administration API */
require_once(ABSPATH . 'wp-admin/includes/media.php');
/** WordPress Import Administration API */
require_once(ABSPATH . 'wp-admin/includes/import.php');
/** WordPress Misc Administration API */
require_once(ABSPATH . 'wp-admin/includes/misc.php');
/** WordPress Plugin Administration API */
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
/** WordPress Post Administration API */
require_once(ABSPATH . 'wp-admin/includes/post.php');
/** WordPress Administration Screen API */
require_once(ABSPATH . 'wp-admin/includes/screen.php');
/** WordPress Taxonomy Administration API */
require_once(ABSPATH . 'wp-admin/includes/taxonomy.php');
/** WordPress Template Administration API */
require_once(ABSPATH . 'wp-admin/includes/template.php');
/** WordPress List Table Administration API and base class */
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
require_once(ABSPATH . 'wp-admin/includes/list-table.php');
/** WordPress Theme Administration API */
require_once(ABSPATH . 'wp-admin/includes/theme.php');
/** WordPress User Administration API */
require_once(ABSPATH . 'wp-admin/includes/user.php');
/** WordPress Update Administration API */
require_once(ABSPATH . 'wp-admin/includes/update.php');
/** WordPress Deprecated Administration API */
require_once(ABSPATH . 'wp-admin/includes/deprecated.php');
/** WordPress Multisite support API */
if ( is_multisite() ) {
require_once(ABSPATH . 'wp-admin/includes/ms.php');
require_once(ABSPATH . 'wp-admin/includes/ms-deprecated.php');
}
?> |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"/>
<title>AppletHTML5</title>
</head>
<body>
<object type="application/x-java-applet" height="300" width="400">
<param name="code" value="applet.MiApplet"/>
<param name="archive" value="applet.jar"/>
Fallo en la carga del Applet. No se ha encontrado el plug-in para Java.
</object>
</body>
</html> |
#ifndef <API key>
#define <API key>
#include <string>
#include "base/callback.h"
#include "dbus/message.h"
#include "dbus/object_proxy.h"
#include "dbus/property.h"
namespace chromeos {
class NfcPropertySet : public dbus::PropertySet {
public:
NfcPropertySet(dbus::ObjectProxy* object_proxy,
const std::string& interface,
const <API key>& callback);
virtual ~NfcPropertySet();
void <API key>(const base::Closure& callback);
virtual void ConnectSignals() OVERRIDE;
virtual void Get(dbus::PropertyBase* property,
GetCallback callback) OVERRIDE;
virtual void GetAll() OVERRIDE;
virtual void OnGetAll(dbus::Response* response) OVERRIDE;
virtual void Set(dbus::PropertyBase* property,
SetCallback callback) OVERRIDE;
virtual void ChangedReceived(dbus::Signal* signal) OVERRIDE;
private:
base::Closure <API key>;
<API key>(NfcPropertySet);
};
}
#endif |
#include <WNS/Backtrace.hpp>
#include <WNS/demangle.hpp>
#include <iomanip>
#include <cmath>
// to get the __GLIBC__ macro set (if glibc available)
#include <features.h>
#ifdef __GLIBC__
#include <execinfo.h>
#include <cstdlib>
#endif // __GLIBC__
#include <sstream>
using namespace wns;
Backtrace::Backtrace() :
backtrace_()
{
}
Backtrace::~Backtrace()
{
clear();
}
void
Backtrace::snapshot()
{
clear();
#ifdef __GLIBC__
const int arraySize = 1000;
void* array[arraySize];
size_t size;
char** strings;
size = backtrace (array, arraySize);
strings = backtrace_symbols (array, size);
for (size_t ii = 0; ii < size; ++ii)
{
backtrace_.push_back(strings[ii]);
}
free (strings);
#endif // __GLIBC__
}
void
Backtrace::clear()
{
backtrace_.clear();
}
wns::Backtrace::FunctionCalls
Backtrace::getFunctionCalls() const
{
FunctionCalls functionCalls;
for(Lines::const_iterator itr = backtrace_.begin();
itr != backtrace_.end();
++itr)
{
functionCalls.push_back(FunctionCall(*itr));
}
return functionCalls;
}
std::string
Backtrace::doToString() const
{
// get function calls and stream reverse
FunctionCalls functionCalls = getFunctionCalls();
size_t stackSize = functionCalls.size();
size_t frame = stackSize;
int width = static_cast<int>(std::ceil(std::log10(stackSize)));
std::stringstream tmp;
tmp << "Backtrace (most recent call last, stack size: " << stackSize << "):\n";
if (stackSize == 0)
{
tmp << " No backtrace available.\n"
<< " Backtrace is currently only available on systems with glibc, sorry.\n";
return tmp.str();
}
// Marc Schinnenburg <marc@schinnenburg.com> 10.12.2007
// The itr should be <API key>, but gcc 3.4.4 cannot find the
// operator==() or operator!=() for that :}
for(FunctionCalls::reverse_iterator itr = functionCalls.rbegin();
itr != functionCalls.rend();
++itr)
{
tmp << " " << std::setw(width) << frame << ") " << itr->getName() << "\n";
--frame;
}
return tmp.str();
}
Backtrace::FunctionCall::FunctionCall(std::string line) :
origin_("unknown"),
name_("unknown"),
offset_("unknown"),
returnAddress_("unknown")
{
// the line typically looks like this:
// ./openwns(<API key>+0xfc) [0x8068870]
size_t openBrace = line.find("(");
size_t plus = line.find("+");
size_t closeBrace = line.find(")");
size_t openSquareBrace = line.find("[");
size_t closeSquareBrace = line.find("]");
if (openBrace != std::string::npos)
{
// the stuff in front of "(" is the origin
origin_ = line.substr(0, openBrace);
if (closeBrace != std::string::npos && plus != std::string::npos)
{
// the stuff from "(" to "+" is the function name
{
std::string symbol = line.substr(openBrace+1, plus-openBrace-1);
name_ = wns::demangle(symbol);
}
// the stuff from "+" to ")" is the offset
offset_ = line.substr(plus+1, closeBrace-plus-1);
}
}
if (openSquareBrace != std::string::npos && closeSquareBrace != std::string::npos)
{
// between "[" and "]" we find the return address
returnAddress_ = line.substr(openSquareBrace+1, <API key>);
}
}
std::string
Backtrace::FunctionCall::getOrigin() const
{
return origin_;
}
std::string
Backtrace::FunctionCall::getName() const
{
return name_;
}
std::string
Backtrace::FunctionCall::getOffset() const
{
return offset_;
}
std::string
Backtrace::FunctionCall::getReturnAddress() const
{
return returnAddress_;
} |
#ifndef CFCNFG_H_
#define CFCNFG_H_
#include <linux/spinlock.h>
#include <linux/netdevice.h>
#include <net/caif/caif_layer.h>
#include <net/caif/cfctrl.h>
struct cfcnfg;
/**
* enum cfcnfg_phy_type - Types of physical layers defined in CAIF Stack
*
* @CFPHYTYPE_FRAG: Fragmented frames physical interface.
* @CFPHYTYPE_CAIF: Generic CAIF physical interface
*/
enum cfcnfg_phy_type {
CFPHYTYPE_FRAG = 1,
CFPHYTYPE_CAIF,
CFPHYTYPE_MAX
};
/**
* enum <API key> - Physical preference HW Abstraction
*
* @<API key>: Default physical interface
*
* @CFPHYPREF_LOW_LAT: Default physical interface for low-latency
* traffic
* @CFPHYPREF_HIGH_BW: Default physical interface for high-bandwidth
* traffic
* @CFPHYPREF_LOOP: TEST only Loopback interface simulating modem
* responses.
*
*/
enum <API key> {
<API key>,
CFPHYPREF_LOW_LAT,
CFPHYPREF_HIGH_BW,
CFPHYPREF_LOOP
};
/**
* cfcnfg_create() - Get the CAIF configuration object given network.
* @net: Network for the CAIF configuration object.
*/
struct cfcnfg *get_cfcnfg(struct net *net);
/**
* cfcnfg_create() - Create the CAIF configuration object.
*/
struct cfcnfg *cfcnfg_create(void);
/**
* cfcnfg_remove() - Remove the CFCNFG object
* @cfg: config object
*/
void cfcnfg_remove(struct cfcnfg *cfg);
void
<API key>(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
struct net_device *dev, struct cflayer *phy_layer,
enum <API key> pref,
bool fcs, bool stx);
int <API key>(struct cfcnfg *cnfg, struct cflayer *phy_layer);
/**
* <API key>() - Set the state of the physical interface device.
* @cnfg: Configuration object
* @phy_layer: Physical Layer representation
* @up: State of device
*/
int <API key>(struct cfcnfg *cnfg, struct cflayer *phy_layer,
bool up);
#endif /* CFCNFG_H_ */ |
<?php
// no direct access
defined('_JEXEC') or die('Restircted access');
/*
* Function to convert a system URL to a SEF URL
*/
function <API key>( &$query )
{
static $items;
$app = JFactory::getApplication();
$segments = array();
$itemid = null;
// Break up the poll id into numeric and alias values.
if (isset($query['id']) && strpos($query['id'], ':')) {
list($query['id'], $query['alias']) = explode(':', $query['id'], 2);
}
// Get the menu items for this component.
if (!$items) {
$component = JComponentHelper::getComponent('com_sexycontactform');
$menu = $app->getMenu();
$items = $menu->getItems('componentid', $component->id);
}
// Search for an appropriate menu item.
if (is_array($items))
{
// If only the option and itemid are specified in the query, return that item.
if (!isset($query['view']) && !isset($query['id']) && !isset($query['catid']) && isset($query['Itemid'])) {
$itemid = (int) $query['Itemid'];
}
// Search for a specific link based on the critera given.
if (!$itemid) {
foreach ($items as $item)
{
// Check if this menu item links to this view.
if (isset($item->query['view']) && $item->query['view'] == 'Simplecontactform'
&& isset($query['view']) && $query['view'] != 'category'
&& isset($item->query['id']) && $item->query['id'] == $query['id'])
{
$itemid = $item->id;
}
}
}
// If no specific link has been found, search for a general one.
if (!$itemid) {
foreach ($items as $item)
{
if (isset($query['view']) && $query['view'] == 'sexycontactform' && isset($item->query['view']) && $item->query['view'] == 'sexycontactform')
{
// Check for an undealt with newsfeed id.
if (isset($query['id']))
{
// This menu item links to the newsfeed view but we need to append the newsfeed id to it.
$itemid = $item->id;
$segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id'];
break;
}
}
}
}
}
// Check if the router found an appropriate itemid.
if (!$itemid)
{
// Check if a id was specified.
if (isset($query['id']))
{
if (isset($query['alias'])) {
$query['id'] .= ':'.$query['alias'];
}
// Push the id onto the stack.
$segments[] = $query['id'];
unset($query['id']);
unset($query['alias']);
}
unset($query['view']);
}
else
{
$query['Itemid'] = $itemid;
// Remove the unnecessary URL segments.
unset($query['view']);
unset($query['id']);
unset($query['catid']);
unset($query['alias']);
}
return $segments;
}
/**
* @param array
* @return array
*/
function <API key>( $segments )
{
$vars = array();
//Get the active menu item
$menu =& JSite::getMenu();
$item =& $menu->getActive();
$count = count( $segments );
//Standard routing for articles
if(!isset($item))
{
$vars['id'] = $segments[$count - 1];
return $vars;
}
// Count route segments
$vars['id'] = $segments[$count-1];
$vars['view'] = 'sexycontactform';
return $vars;
} |
#include <cassert>
#include "buffer.h"
#include "objectparamgroup.h"
#include "objectdesc.h"
namespace TPProto{
/*! \brief Default constructor.
*/
ObjectDescription::ObjectDescription(){
}
/*! \brief Destructor.
Deletes the OrderParameters it contains.
*/
ObjectDescription::~ObjectDescription(){
for(std::list<<API key>*>::iterator itcurr = groups.begin(); itcurr != groups.end(); ++itcurr){
delete *itcurr;
}
groups.clear();
}
/*! \brief Pack into a Buffer, assert(0).
This Frame is only received from the server and therefore does not get
packed on the client side. assert(0) is called.
\param buf The Buffer, ignored.
*/
void ObjectDescription::packBuffer(Buffer* buf){
assert(0);
}
/*! \brief Unpack this ObjectDescription from a Buffer.
\param buf The Buffer to unpack out of.
\return True if successful.
*/
bool ObjectDescription::unpackBuffer(Buffer* buf){
otype = buf->unpackInt();
name = buf->unpackString();
desc = buf->unpackString();
modtime = buf->unpackInt64();
//unpack args
int numparams = buf->unpackInt();
for(int i = 0; i < numparams; i++){
<API key> *g = new <API key>();
g->unpackBuffer(buf);
groups.push_back(g);
}
type = ft04_ObjectDesc;
return true;
}
/*! \brief Gets the object type number of this object description.
\return The object type number.
*/
unsigned int ObjectDescription::getObjectType(){
return otype;
}
/*! \brief Gets the name of this object description.
/return The name of the object description.
*/
std::string ObjectDescription::getName(){
return name;
}
/*! \brief Gets the text description of this object description.
/return The text description of the object description.
*/
std::string ObjectDescription::getDescription(){
return desc;
}
/*! \brief Gets a copy of the <API key> in this object description.
\return A copy of the list of <API key>.
*/
std::list<<API key>*> ObjectDescription::getParameterGroups(){
std::list<<API key>*> np;
for(std::list<<API key>*>::iterator itcurr = groups.begin(); itcurr != groups.end(); ++itcurr){
np.push_back(new <API key>(**itcurr));
}
return np;
}
/*! \brief Returns the timestamp of the last time this object description was modified.
\return The timestamp of the modification time.
*/
uint64_t ObjectDescription::getLastModifiedTime(){
return modtime;
}
} |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_20-ea) on Sat Mar 22 13:50:06 CET 2014 -->
<title>OSXAquaPainter.Direction (Quaqua 9.1 2014-03-22)</title>
<meta name="date" content="2014-03-22">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="OSXAquaPainter.Direction (Quaqua 9.1 2014-03-22)";
}
}
catch(err) {
}
var methods = {"i0":10,"i1":9,"i2":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Quaqua 9.1 2014-03-22</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.html" title="class in ch.randelshofer.quaqua.osx"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.HorizontalAlignment.html" title="enum in ch.randelshofer.quaqua.osx"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" target="_top">Frames</a></li>
<li><a href="OSXAquaPainter.Direction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#enum.constant.summary">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#enum.constant.detail">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<div class="subTitle">ch.randelshofer.quaqua.osx</div>
<h2 title="Enum OSXAquaPainter.Direction" class="title">Enum OSXAquaPainter.Direction</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>java.lang.Enum<<a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a>></li>
<li>
<ul class="inheritance">
<li>ch.randelshofer.quaqua.osx.OSXAquaPainter.Direction</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, java.lang.Comparable<<a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a>></dd>
</dl>
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.html" title="class in ch.randelshofer.quaqua.osx">OSXAquaPainter</a></dd>
</dl>
<hr>
<br>
<pre>public static enum <span class="typeNameLabel">OSXAquaPainter.Direction</span>
extends java.lang.Enum<<a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a>></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="enum.constant.summary">
</a>
<h3>Enum Constant Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation">
<caption><span>Enum Constants</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Enum Constant and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#down">down</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#east">east</a></span></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#left">left</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#none">none</a></span></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#north">north</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#right">right</a></span></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#south">south</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#up">up</a></span></code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#west">west</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.summary">
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#getId--">getId</a></span>()</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#valueOf-java.lang.String-">valueOf</a></span>(java.lang.String name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html#values--">values</a></span>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Enum">
</a>
<h3>Methods inherited from class java.lang.Enum</h3>
<code>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>getClass, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="enum.constant.detail">
</a>
<h3>Enum Constant Detail</h3>
<a name="none">
</a>
<ul class="blockList">
<li class="blockList">
<h4>none</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> none</pre>
</li>
</ul>
<a name="up">
</a>
<ul class="blockList">
<li class="blockList">
<h4>up</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> up</pre>
</li>
</ul>
<a name="down">
</a>
<ul class="blockList">
<li class="blockList">
<h4>down</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> down</pre>
</li>
</ul>
<a name="left">
</a>
<ul class="blockList">
<li class="blockList">
<h4>left</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> left</pre>
</li>
</ul>
<a name="right">
</a>
<ul class="blockList">
<li class="blockList">
<h4>right</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> right</pre>
</li>
</ul>
<a name="north">
</a>
<ul class="blockList">
<li class="blockList">
<h4>north</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> north</pre>
</li>
</ul>
<a name="south">
</a>
<ul class="blockList">
<li class="blockList">
<h4>south</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> south</pre>
</li>
</ul>
<a name="east">
</a>
<ul class="blockList">
<li class="blockList">
<h4>east</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> east</pre>
</li>
</ul>
<a name="west">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>west</h4>
<pre>public static final <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> west</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.detail">
</a>
<h3>Method Detail</h3>
<a name="values
</a>
<ul class="blockList">
<li class="blockList">
<h4>values</h4>
<pre>public static <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a>[] values()</pre>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
<pre>
for (OSXAquaPainter.Direction c : OSXAquaPainter.Direction.values())
System.out.println(c);
</pre></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array containing the constants of this enum type, in the order they are declared</dd>
</dl>
</li>
</ul>
<a name="valueOf-java.lang.String-">
</a>
<ul class="blockList">
<li class="blockList">
<h4>valueOf</h4>
<pre>public static <a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" title="enum in ch.randelshofer.quaqua.osx">OSXAquaPainter.Direction</a> valueOf(java.lang.String name)</pre>
<div class="block">Returns the enum constant of this type with the specified name.
The string must match <i>exactly</i> an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the enum constant to be returned.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the enum constant with the specified name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.<API key></code> - if this enum type has no constant with the specified name</dd>
<dd><code>java.lang.<API key></code> - if the argument is null</dd>
</dl>
</li>
</ul>
<a name="getId
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getId</h4>
<pre>public int getId()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><font size=-2>Copyright 2003-2007 (c) Werner Randelshofer.<br>All rights reserved.</font></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.html" title="class in ch.randelshofer.quaqua.osx"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../ch/randelshofer/quaqua/osx/OSXAquaPainter.HorizontalAlignment.html" title="enum in ch.randelshofer.quaqua.osx"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?ch/randelshofer/quaqua/osx/OSXAquaPainter.Direction.html" target="_top">Frames</a></li>
<li><a href="OSXAquaPainter.Direction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#enum.constant.summary">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#enum.constant.detail">Enum Constants</a> | </li>
<li>Field | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
</a></div>
</body>
</html> |
// This program is free software; you can redistribute it and/or
// as published by the Free Software Foundation; either version 2
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/**
* @file TagIdVec.cpp
*/
// Dreams includes.
#include "dDB/trackheap/TagIdVec.h"
#include "dDB/trackheap/TagVecValue64.h"
#include "dDB/trackheap/TagVecValue64NF.h"
#include "dDB/trackheap/TagVecValue31.h"
#include "dDB/trackheap/TagVecValue8.h"
#include "dDB/trackheap/TagVecValue8NF.h"
vector<TagVecValue64 *> TagIdVecNode::listTagVecValue64;
vector<TagVecValue64NF *> TagIdVecNode::listTagVecValue64NF;
vector<TagVecValue31 *> TagIdVecNode::listTagVecValue31;
vector<TagVecValue8 *> TagIdVecNode::listTagVecValue8;
vector<TagVecValue8NF *> TagIdVecNode::listTagVecValue8NF;
/*
* Creator of this class. Gets the static instances and sets the
* default values to the fields of the class.
*
* @return new object.
*/
TagIdVecNode::TagIdVecNode()
{
dict = NULL;
firstCycle = 1048575;
lastCycle = 0;
fwd = false;
size = TAG_SIZE_64_BITS;
cycleVecHigh = NULL;
cycleVecLow = NULL;
lastValueUndefined = true;
lastValue = 0;
lastCompressedChunk = 0;
}
/*
* Destructor of this class. Frees the array if was allocated.
*
* @return destroys the object.
*/
TagIdVecNode::~TagIdVecNode()
{
INT32 lastChunk = lastCycle >> CYCLE_OFFSET_BITS;
if(cycleVecHigh != NULL)
{
for(INT32 i = 0; i <= lastChunk; i++)
{
if(cycleVecHigh->hasElement(i) && ((* cycleVecHigh)[i] != NULL))
{
delete (* cycleVecHigh)[i];
}
}
delete cycleVecHigh;
}
if(cycleVecLow != NULL)
{
for(INT32 i = 0; i <= lastChunk; i++)
{
if(cycleVecLow->hasElement(i) && ((* cycleVecLow)[i] != NULL))
{
delete (* cycleVecLow)[i];
}
}
delete cycleVecLow;
}
}
/*
* Gets the tag value in the cycle cycle.
*
* @return bool if a value is found.
*/
bool
TagIdVecNode::getTagValue(CYCLE cycle, UINT64 * value, CYCLE * atcycle) const
{
INT32 cyc; ///< Cycle when the value is set.
INT8 division; ///< Division where the tag is found.
bool ok; ///< If a value is found.
division = 0;
// If forwarding, then we must look at both vectors.
if(fwd)
{
UINT64 value1, value2; ///< Values returned from the high and low searches.
INT32 cyc1, cyc2; ///< Cycles returned from the high and low searches.
bool ok1, ok2; ///< Something found returned from the high and low searches.
// High phase access.
ok1 = internalGetTagValue(cycleVecHigh, cycle.cycle, &value1, &cyc1);
// Decrements if we are in a high phase, to maintain coherency: the last low value must be searched
// in cycle.cycle - 1.
cycle.cycle += cycle.division - 1;
// Low phase access.
ok2 = internalGetTagValue(cycleVecLow, cycle.cycle, &value2, &cyc2);
// Sets the ok result.
ok = ok1 || ok2;
// Gets the correct value.
if(ok1 && !ok2)
{
// Only have a value in the high phase.
* value = value1;
cyc = cyc1;
division = 0;
}
else if(!ok1 && ok2)
{
// Only have a value in the low phase.
* value = value2;
cyc = cyc2;
division = 1;
}
else if(ok1 && ok2)
{
// A value in both phases, we must get the older one.
// If equal cycles, we get the low phase value.
if(cyc1 > cyc2)
{
* value = value1;
cyc = cyc1;
division = 0;
}
else
{
* value = value2;
cyc = cyc2;
division = 1;
}
}
}
else
{
if(cycle.division == 0)
{
ok = internalGetTagValue(cycleVecHigh, cycle.cycle, value, &cyc);
}
else
{
ok = internalGetTagValue(cycleVecLow, cycle.cycle, value, &cyc);
}
}
// Sets the atcycle if exists.
if(ok && (atcycle != NULL))
{
atcycle->clock = cycle.clock;
atcycle->division = division;
atcycle->cycle = cyc;
}
return ok;
}
/*
* Gets the tag value in the cycle cycle.
*
* @return bool if a value is found.
*/
bool
TagIdVecNode::getTagValue(CYCLE cycle, SOVList ** value, CYCLE * atcycle) const
{
@todo implement this
return false;
}
/*
* Gets the tag value in the cycle cycle.
*
* @return bool if a value is found.
*/
bool
TagIdVecNode::getTagValuePhase(CYCLE cycle, UINT64 * value, CYCLE * atcycle) const
{
INT32 cyc; ///< Cycle when the value is set.
bool ok; ///< If a value is found.
if(cycle.division == 0)
{
ok = internalGetTagValue(cycleVecHigh, cycle.cycle, value, &cyc);
}
else
{
ok = internalGetTagValue(cycleVecLow, cycle.cycle, value, &cyc);
}
// Sets the atcycle if exists.
if(ok && (atcycle != NULL))
{
atcycle->clock = cycle.clock;
atcycle->division = cycle.division;
atcycle->cycle = cyc;
}
return ok;
}
/*
* Gets the tag value in the cycle cycle.
*
* @return bool if a value is found.
*/
bool
TagIdVecNode::getTagValuePhase(CYCLE cycle, SOVList ** value, CYCLE * atcycle) const
{
@todo implement this
return false;
}
/*
* Gets the tag value in the cycle cycle.
*
* @return bool if a value is found.
*/
bool
TagIdVecNode::internalGetTagValue(const TagCycleVector * cycleVec, INT32 cycle, UINT64 * value, INT32 * atcycle) const
{
TagReturn hit; ///< Stores when we've found a value.
INT32 cycleChunk; ///< Stores the actual chunk.
INT32 minChunk; ///< Stores the threshold chunk.
hit = TAG_NOT_FOUND;
if(cycleVec == NULL)
{
return false;
}
if(cycle < (INT32) firstCycle)
{
return false;
}
if(cycle > (INT32) lastCycle)
{
if(!fwd)
{
return false;
}
else
{
cycle = lastCycle;
}
}
cycleChunk = cycle >> CYCLE_OFFSET_BITS;
if(cycleVec->hasElement(cycleChunk) && ((* cycleVec)[cycleChunk] != NULL))
{
hit = (* cycleVec)[cycleChunk]->getTagValue(cycle, value, atcycle);
if(hit == TAG_FOUND)
{
return true;
}
else if((hit == TAG_UNDEFINED) || !fwd)
{
return false;
}
}
else if(!fwd)
{
return false;
}
cycleChunk = cycle >> CYCLE_OFFSET_BITS;
// If the value was not fnd in the "natural" chunk look back.
minChunk = firstCycle >> CYCLE_OFFSET_BITS;
cycleChunk
while((hit == TAG_NOT_FOUND) && (cycleChunk >= minChunk))
{
if(cycleVec->hasElement(cycleChunk) && ((* cycleVec)[cycleChunk] != NULL))
{
hit = (* cycleVec)[cycleChunk]->getTagValue(cycle, value, atcycle);
}
cycleChunk
}
return (hit == TAG_FOUND);
}
/**
* Dumps the content of the vector.
*
* @return void.
*/
void
TagIdVecNode::dumpTagIdVector()
{
if(!hasData())
{
return;
}
INT32 firstChunk = firstCycle >> CYCLE_OFFSET_BITS;
INT32 lastChunk = lastCycle >> CYCLE_OFFSET_BITS;
if(cycleVecHigh != NULL)
{
for(INT32 i = firstChunk; i <= lastChunk; i++)
{
if(cycleVecHigh->hasElement(i) && ((*cycleVecHigh)[i] != NULL))
{
(*cycleVecHigh)[i]->dumpCycleVector();
}
}
}
if(cycleVecLow != NULL)
{
for(INT32 i = firstChunk; i <= lastChunk; i++)
{
if(cycleVecLow->hasElement(i) && ((*cycleVecLow)[i] != NULL))
{
(*cycleVecLow)[i]->dumpCycleVector();
}
}
}
}
/*
* Gets the occupancy for the given tag.
*
* @return the occupancy.
*/
UINT32
TagIdVecNode::getOccupancy() const
{
UINT32 occ = 0;
if(cycleVecHigh != NULL)
{
occ += <API key>(cycleVecHigh);
}
if(cycleVecLow != NULL)
{
occ += <API key>(cycleVecLow);
}
return occ;
}
UINT32
TagIdVecNode::<API key>(const TagCycleVector * cycleVec) const
{
UINT32 occ = 0;
INT32 currEndCycle = 4095;
INT32 lastChunk = lastCycle >> CYCLE_OFFSET_BITS;
UINT64 dummyValue;
INT32 dummyAtCycle;
bool defined = false;
for(INT32 i = 0; i <= lastChunk; i++)
{
if(cycleVec->hasElement(i) && ((* cycleVec)[i] != NULL))
{
if(i != lastChunk)
{
occ += (* cycleVec)[i]->getOccupancy(defined, CYCLE_CHUNK_SIZE);
}
else
{
occ += (* cycleVec)[i]->getOccupancy(defined, lastCycle & CYCLE_OFFSET_MASK);
}
TagReturn ret = (* cycleVec)[i]->getTagValue(currEndCycle, &dummyValue, &dummyAtCycle);
if(ret == TAG_FOUND)
{
defined = true;
}
else if(ret == TAG_UNDEFINED)
{
defined = false;
}
}
currEndCycle += CYCLE_CHUNK_SIZE;
}
return occ;
}
/*
* Compresses the vector.
*
* @return the compressed vector.
*/
ZipObject *
TagIdVecNode::compressYourSelf(CYCLE cycle, bool last)
{
if(!hasData())
{
return this;
}
INT32 lastChunk = cycle.cycle >> CYCLE_OFFSET_BITS;
if(lastChunk >= <API key>)
{
lastChunk = <API key> - 1;
}
if(cycleVecHigh != NULL)
{
for(INT32 i = lastCompressedChunk; i <= lastChunk; i++)
{
if(cycleVecHigh->hasElement(i) && ((* cycleVecHigh)[i] != NULL))
{
TagVec * newvec = (TagVec *) ((* cycleVecHigh)[i]->compressYourSelf(cycle, last));
if((* cycleVecHigh)[i] != newvec)
{
switch(size)
{
case TAG_SIZE_64_BITS:
if(fwd)
{
listTagVecValue64.push_back((TagVecValue64 *) (* cycleVecHigh)[i]);
}
else
{
listTagVecValue64NF.push_back((TagVecValue64NF *) (* cycleVecHigh)[i]);
}
break;
case TAG_SIZE_31_BITS:
if(fwd)
{
listTagVecValue31.push_back((TagVecValue31 *) (* cycleVecHigh)[i]);
}
else
{
Q_ASSERT(false);
}
break;
case TAG_SIZE_8_BITS:
if(fwd)
{
listTagVecValue8.push_back((TagVecValue8 *) (* cycleVecHigh)[i]);
}
else
{
listTagVecValue8NF.push_back((TagVecValue8NF *) (* cycleVecHigh)[i]);
}
break;
default:
// Sanity check.
Q_ASSERT(false);
break;
}
(* cycleVecHigh)[i] = newvec;
}
}
}
}
if(cycleVecLow != NULL)
{
for(INT32 i = lastCompressedChunk; i <= lastChunk; i++)
{
if(cycleVecLow->hasElement(i) && ((* cycleVecLow)[i] != NULL))
{
TagVec * newvec = (TagVec *) ((* cycleVecLow)[i]->compressYourSelf(cycle, last));
if((* cycleVecLow)[i] != newvec)
{
switch(size)
{
case TAG_SIZE_64_BITS:
if(fwd)
{
listTagVecValue64.push_back((TagVecValue64 *) (* cycleVecLow)[i]);
}
else
{
listTagVecValue64NF.push_back((TagVecValue64NF *) (* cycleVecLow)[i]);
}
break;
case TAG_SIZE_31_BITS:
if(fwd)
{
listTagVecValue31.push_back((TagVecValue31 *) (* cycleVecLow)[i]);
}
else
{
Q_ASSERT(false);
}
break;
case TAG_SIZE_8_BITS:
if(fwd)
{
listTagVecValue8.push_back((TagVecValue8 *) (* cycleVecLow)[i]);
}
else
{
listTagVecValue8NF.push_back((TagVecValue8NF *) (* cycleVecLow)[i]);
}
break;
default:
// Sanity check.
Q_ASSERT(false);
break;
}
(* cycleVecLow)[i] = newvec;
}
}
}
}
lastCompressedChunk = lastChunk + 1;
return this;
}
/**
* Checks that a cycle chunk is allocated. First looks if the
* array has been allocated. Then looks if the chunk is allocated.
* In negative case is allocated and all the pointers are set to
* NULL. Finally allocates the correct type of tag vector.
*
* @return void.
*/
void
TagIdVecNode::checkCycleChunk(INT32 cycleChunk, CLOCK_ID clock_id, TagCycleVector ** cycleVecParam)
{
bool defined;
UINT64 value;
TagCycleVector * cycleVec;
// first time we use this tagId?
if((* cycleVecParam) == NULL)
{
* cycleVecParam = new TagCycleVector();
}
cycleVec = * cycleVecParam;
// since TagCycleVector is a vector of pointers I need to
// make sure I initialize it with NULLs but, at the same time
// I'd like to avoid initialize (and therefore allocate)
// uneeded pages on the AEVector so:
// No allocated page?
if(!(cycleVec->hasElement(cycleChunk)))
{
// Allocate it.
cycleVec->allocateElement(cycleChunk);
// Clear the AE page to avoid dangling/trash pointers.
INT32 aepage = cycleChunk / <API key>;
INT32 aepageElem0 = aepage * <API key>; // improve this with a mask
for(UINT32 i = 0; i < <API key>; i++)
{
(* cycleVec)[aepageElem0 + i] = NULL;
}
}
if((* cycleVec)[cycleChunk] == NULL)
{
// Get some TagVec implementation.
switch(size)
{
case TAG_SIZE_64_BITS:
if(fwd)
{
if(!listTagVecValue64.empty())
{
TagVecValue64 * tag = listTagVecValue64.back();
listTagVecValue64.pop_back();
tag->reset(cycleChunk * CYCLE_CHUNK_SIZE);
tag->setNewDict(dict);
(* cycleVec)[cycleChunk] = tag;
}
else
{
(* cycleVec)[cycleChunk] = new TagVecValue64(cycleChunk * CYCLE_CHUNK_SIZE, dict, clock_id);
}
}
else
{
if(!listTagVecValue64NF.empty())
{
TagVecValue64NF * tag = listTagVecValue64NF.back();
listTagVecValue64NF.pop_back();
tag->reset(cycleChunk * CYCLE_CHUNK_SIZE);
tag->setNewDict(dict);
(* cycleVec)[cycleChunk] = tag;
}
else
{
(* cycleVec)[cycleChunk] = new TagVecValue64NF(cycleChunk * CYCLE_CHUNK_SIZE, dict, clock_id);
}
}
break;
case TAG_SIZE_31_BITS:
if(fwd)
{
if(!listTagVecValue31.empty())
{
TagVecValue31 * tag = listTagVecValue31.back();
listTagVecValue31.pop_back();
tag->reset(cycleChunk * CYCLE_CHUNK_SIZE);
(* cycleVec)[cycleChunk] = tag;
}
else
{
(* cycleVec)[cycleChunk] = new TagVecValue31(cycleChunk * CYCLE_CHUNK_SIZE);
}
}
else
{
// TODO: implement this class.
Q_ASSERT(false);
//(*cycleVec)[cycleChunk] = new TagVecValue31NF(cycleChunk * CYCLE_CHUNK_SIZE);
}
break;
case TAG_SIZE_8_BITS:
if(fwd)
{
if(!listTagVecValue8.empty())
{
TagVecValue8 * tag = listTagVecValue8.back();
listTagVecValue8.pop_back();
tag->reset(cycleChunk * CYCLE_CHUNK_SIZE);
(* cycleVec)[cycleChunk] = tag;
}
else
{
(* cycleVec)[cycleChunk] = new TagVecValue8(cycleChunk * CYCLE_CHUNK_SIZE);
}
}
else
{
if(!listTagVecValue8NF.empty())
{
TagVecValue8NF * tag = listTagVecValue8NF.back();
listTagVecValue8NF.pop_back();
tag->reset(cycleChunk * CYCLE_CHUNK_SIZE);
(* cycleVec)[cycleChunk] = tag;
}
else
{
(* cycleVec)[cycleChunk] = new TagVecValue8NF(cycleChunk * CYCLE_CHUNK_SIZE);
}
}
break;
default:
// Sanity check.
Q_ASSERT(false);
break;
}
}
}
/*
* Purges all the allocated vectors that hasn't yet been deleted.
*
* @return void.
*/
void
TagIdVecNode::<API key>()
{
{
vector<TagVecValue64 *>::iterator it;
it = listTagVecValue64.begin();
while(it != listTagVecValue64.end())
{
delete (* it);
++it;
}
listTagVecValue64.clear();
}
{
vector<TagVecValue64NF *>::iterator it;
it = listTagVecValue64NF.begin();
while(it != listTagVecValue64NF.end())
{
delete (* it);
++it;
}
listTagVecValue64NF.clear();
}
{
vector<TagVecValue31 *>::iterator it;
it = listTagVecValue31.begin();
while(it != listTagVecValue31.end())
{
delete (* it);
++it;
}
listTagVecValue31.clear();
}
{
vector<TagVecValue8 *>::iterator it;
it = listTagVecValue8.begin();
while(it != listTagVecValue8.end())
{
delete (* it);
++it;
}
listTagVecValue8.clear();
}
{
vector<TagVecValue8NF *>::iterator it;
it = listTagVecValue8NF.begin();
while(it != listTagVecValue8NF.end())
{
delete (* it);
++it;
}
listTagVecValue8NF.clear();
}
}
INT64
TagIdVecNode::getObjSize() const
{
INT64 size;
size = sizeof(TagIdVecNode);
// Adds all the tag vectors.
if(cycleVecHigh != NULL)
{
size += cycleVecHigh->getObjSize() - sizeof(cycleVecHigh);
INT32 firstChunk = firstCycle >> CYCLE_OFFSET_BITS;
INT32 lastChunk = lastCycle >> CYCLE_OFFSET_BITS;
// check incoherence conditions (typically produced by corrupted drl files)
if(lastChunk >= <API key>)
{
lastChunk = <API key> - 1;
}
INT32 lim = (lastChunk / <API key>) + 1;
lim = lim * <API key>;
for(INT32 i = 0; i < lim; i++)
{
if(cycleVecHigh->hasElement(i))
{
if((* cycleVecHigh)[i] != NULL)
{
size += (* cycleVecHigh)[i]->getObjSize();
}
}
}
}
// Adds all the tag vectors.
if(cycleVecLow != NULL)
{
size += cycleVecLow->getObjSize() - sizeof(cycleVecLow);
INT32 firstChunk = firstCycle >> CYCLE_OFFSET_BITS;
INT32 lastChunk = lastCycle >> CYCLE_OFFSET_BITS;
// check incoherence conditions (typically produced by corrupted drl files)
if(lastChunk >= <API key>)
{
lastChunk = <API key> - 1;
}
INT32 lim = (lastChunk / <API key>) + 1;
lim = lim * <API key>;
for(INT32 i = 0; i < lim; i++)
{
if(cycleVecLow->hasElement(i))
{
if((* cycleVecLow)[i] != NULL)
{
size += (* cycleVecLow)[i]->getObjSize();
}
}
}
}
return size;
}
QString
TagIdVecNode::getUsageDescription() const
{
QString ret;
INT64 size;
ret += QString("\t\t\tThis TagIdVecNode object occupies ") + QString::number(getObjSize()) + QString(" bytes.\n");
if(cycleVecHigh != NULL)
{
ret += QString("\t\t\tDescription of the different tagvec high elements (") + QString::number(cycleVecHigh->getNumSegments() * cycleVecHigh->getSegmentSize()) + QString(" elements allocated with a total size of ") + QString::number(cycleVecHigh->getObjSize()) + QString(" bytes).\n");
}
if(cycleVecLow != NULL)
{
ret += QString("\t\t\tDescription of the different tagvec high elements (") + QString::number(cycleVecLow->getNumSegments() * cycleVecLow->getSegmentSize()) + QString(" elements allocated with a total size of ") + QString::number(cycleVecLow->getObjSize()) + QString(" bytes).\n");
}
return ret;
} |
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
using namespace cv;
/** @function main */
int main( int argc, char** argv )
{
Mat src, src_gray;
Mat grad;
char* window_name = "Sobel Demo - Simple Edge Detector";
int scale = 1;
int delta = 0;
int ddepth = CV_16S;
int c;
Load an image
src = imread( argv[1] );
if( !src.data )
{ return -1; }
GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT );
Convert it to gray
cvtColor( src, src_gray, CV_RGB2GRAY );
Create window
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
Generate grad_x and grad_y
Mat grad_x, grad_y;
Mat abs_grad_x, abs_grad_y;
Gradient X
//Scharr( src_gray, grad_x, ddepth, 1, 0, scale, delta, BORDER_DEFAULT );
Sobel( src_gray, grad_x, ddepth, 1, 0, 3, scale, delta, BORDER_DEFAULT );
convertScaleAbs( grad_x, abs_grad_x );
Gradient Y
//Scharr( src_gray, grad_y, ddepth, 0, 1, scale, delta, BORDER_DEFAULT );
Sobel( src_gray, grad_y, ddepth, 0, 1, 3, scale, delta, BORDER_DEFAULT );
convertScaleAbs( grad_y, abs_grad_y );
Total Gradient (approximate)
addWeighted( abs_grad_x, 0.5, abs_grad_y, 0.5, 0, grad );
imshow( window_name, grad );
waitKey(0);
return 0;
} |
package org.owasp.benchmark.testcode;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/BenchmarkTest01222")
public class BenchmarkTest01222 extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
String param = "";
java.util.Enumeration<String> headers = request.getHeaders("vector");
if (headers.hasMoreElements()) {
param = headers.nextElement(); // just grab first element
}
String bar = new Test().doSomething(param);
String sql = "INSERT INTO users (username, password) VALUES ('foo','"+ bar + "')";
try {
java.sql.Statement statement = org.owasp.benchmark.helpers.DatabaseHelper.getSqlStatement();
int count = statement.executeUpdate( sql, java.sql.Statement.<API key> );
org.owasp.benchmark.helpers.DatabaseHelper.<API key>(sql, response);
} catch (java.sql.SQLException e) {
if (org.owasp.benchmark.helpers.DatabaseHelper.hideSQLErrors) {
response.getWriter().println("Error processing request.");
return;
}
else throw new ServletException(e);
}
} // end doPost
private class Test {
public String doSomething(String param) throws ServletException, IOException {
String bar = "safe!";
java.util.HashMap<String,Object> map5885 = new java.util.HashMap<String,Object>();
map5885.put("keyA-5885", "a Value"); // put some stuff in the collection
map5885.put("keyB-5885", param); // put it in a collection
map5885.put("keyC", "another Value"); // put some stuff in the collection
bar = (String)map5885.get("keyB-5885"); // get it back out
return bar;
}
} // end innerclass Test
} // end <API key> |
#include <mmc.h>
#ifdef CONFIG_JZ_MMC
#define MMC_BYTE_PER_BLOCK 512
static int mmc_erase(struct cloner *cloner)
{
int curr_device = 0;
struct mmc *mmc = find_mmc_device(0);
uint32_t blk, blk_end, blk_cnt;
uint32_t erase_cnt = 0;
int timeout = 30000;
int i;
int ret;
if (!mmc) {
printf("no mmc device at slot %x\n", curr_device);
return -ENODEV;
}
ret = mmc_init(mmc);
if (ret) {
printf("ERROR: MMC Init error\n");
return -EPERM;
}
if (mmc_getwp(mmc) == 1) {
printf("Error: card is write protected!\n");
return -EPERM;
}
if (cloner->args->mmc_erase == MMC_ERASE_ALL) {
blk = 0;
blk_cnt = mmc->capacity / MMC_BYTE_PER_BLOCK;
printf("MMC erase: dev # %d, start block # %d, count %u ... \n",
curr_device, blk, blk_cnt);
ret = mmc->block_dev.block_erase(curr_device, blk, blk_cnt);
if (!ret) {
printf("Error: mmc erase error\n");
return -EIO;
}
printf("mmc all erase ok, blocks %d\n", blk_cnt);
return 0;
} else if (cloner->args->mmc_erase != MMC_ERASE_PART) {
return -EINVAL;
}
/*mmc part erase */
erase_cnt = (cloner->args-><API key> >MMC_ERASE_CNT_MAX) ?
MMC_ERASE_CNT_MAX : cloner->args-><API key>;
for (i = 0; erase_cnt > 0; i++, erase_cnt
blk = cloner->args->mmc_erase_range[i].start / MMC_BYTE_PER_BLOCK;
if(cloner->args->mmc_erase_range[i].end == -1){
blk_cnt = mmc->capacity / MMC_BYTE_PER_BLOCK - blk ;
}else{
blk_end = cloner->args->mmc_erase_range[i].end / MMC_BYTE_PER_BLOCK;
blk_cnt = blk_end - blk ;
}
printf("MMC erase: dev # %d, start block # 0x%x, count 0x%x ... \n",
curr_device, blk, blk_cnt);
ret = mmc->block_dev.block_erase(curr_device, blk, blk_cnt);
if (!ret) {
printf("Error: mmc erase error\n");
return -EIO;
}
printf("mmc part erase, part %d ok\n", i);
}
printf("mmc erase ok\n");
return 0;
}
int mmc_program(struct cloner *cloner,int mmc_index)
{
#define MMC_BYTE_PER_BLOCK 512
int curr_device = mmc_index;
struct mmc *mmc = find_mmc_device(mmc_index);
u32 blk = (cloner->cmd->write.partation + cloner->cmd->write.offset)/MMC_BYTE_PER_BLOCK;
u32 cnt = (cloner->cmd->write.length + MMC_BYTE_PER_BLOCK - 1)/MMC_BYTE_PER_BLOCK;
void *addr = (void *)cloner->write_req->buf;
u32 n;
if (!mmc) {
printf("no mmc device at slot %x\n", curr_device);
return -ENODEV;
}
//debug_cond(BURNNER_DEBUG,"\nMMC write: dev # %d, block # %d, count %d ... ",
printf("MMC write: dev # %d, block # %d, count %d ... ",
curr_device, blk, cnt);
mmc_init(mmc);
if (mmc_getwp(mmc) == 1) {
printf("Error: card is write protected!\n");
return -EPERM;
}
n = mmc->block_dev.block_write(curr_device, blk,
cnt, addr);
//debug_cond(BURNNER_DEBUG,"%d blocks write: %s\n",n, (n == cnt) ? "OK" : "ERROR");
printf("%d blocks write: %s\n",n, (n == cnt) ? "OK" : "ERROR");
if (n != cnt)
return -EIO;
if (cloner->args->write_back_chk) {
mmc->block_dev.block_read(curr_device, blk,
cnt, addr);
debug_cond(BURNNER_DEBUG,"%d blocks read: %s\n",n, (n == cnt) ? "OK" : "ERROR");
if (n != cnt)
return -EIO;
uint32_t tmp_crc = local_crc32(0xffffffff,addr,cloner->cmd->write.length);
debug_cond(BURNNER_DEBUG,"%d blocks check: %s\n",n,(cloner->cmd->write.crc == tmp_crc) ? "OK" : "ERROR");
if (cloner->cmd->write.crc != tmp_crc) {
printf("src_crc32 = %08x , dst_crc32 = %08x\n",cloner->cmd->write.crc,tmp_crc);
return -EIO;
}
}
return 0;
}
int mmc_read_x(int dev, void *buf, loff_t offset ,size_t length)
{
char command[128];
loff_t blk = offset/MMC_BYTE_PER_BLOCK;
size_t cnt = (length + MMC_BYTE_PER_BLOCK -1)/MMC_BYTE_PER_BLOCK;
int ret = 0;
memset(command, 0, 128);
sprintf(command, "mmc dev %d", dev);
printf("%s\n",command);
ret = run_command(command, 0);
if (ret)
return ret;
memset(command, 0, 128);
sprintf(command, "mmc read %p 0x%llx 0x%lx", buf, blk, cnt);
printf("%s\n", command);
ret = run_command(command, 0);
return ret;
}
#endif |
<?php
namespace Drupal\typepermis\Form;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
/**
* Form controller for Typepermis edit forms.
*
* @ingroup typepermis
*/
class TypepermisForm extends ContentEntityForm {
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
/* @var $entity \Drupal\typepermis\Entity\Typepermis */
$form = parent::buildForm($form, $form_state);
$entity = $this->entity;
return $form;
}
/**
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state) {
$entity = &$this->entity;
$status = parent::save($form, $form_state);
switch ($status) {
case SAVED_NEW:
drupal_set_message($this->t('Created the %label Typepermis.', [
'%label' => $entity->label(),
]));
break;
default:
drupal_set_message($this->t('Saved the %label Typepermis.', [
'%label' => $entity->label(),
]));
}
$form_state->setRedirect('entity.typepermis.canonical', ['typepermis' => $entity->id()]);
}
} |
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/miscdevice.h>
#include <linux/uaccess.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/wakelock.h>
#include <linux/android_pmem.h>
#include <linux/gpio.h>
#include <linux/mutex.h>
#include <linux/mfd/msm-adie-codec.h>
#include <linux/msm_audio.h>
#include <mach/qdsp6v2/snddev_wm8993.h>
#include <mach/qdsp6v2/audio_dev_ctl.h>
#ifdef <API key>
#include "wm8993.h"
#endif
static AMP_PATH_TYPE_E m_curr_path = AMP_PATH_NONE;
static AMP_PATH_TYPE_E m_prev_path = AMP_PATH_NONE;
static AMP_CAL_TYPE_E m_curr_cal = AMP_CAL_NORMAL;
static AMP_CAL_TYPE_E m_prev_cal = AMP_CAL_NORMAL;
#ifndef WM8993_SINGLE_PATH
static AMP_PATH_TYPE_E cur_tx = AMP_PATH_NONE;
static AMP_PATH_TYPE_E cur_rx = AMP_PATH_NONE;
#endif /*WM8993_SINGLE_PATH*/
struct snddev_wm8993 wm8993_modules;
REG_MEMORY <API key> amp_none_path[REG_COUNT] = {
#ifdef <API key>
#ifndef <API key>
{ 0x01, 0x0000 },
{ 0x02, 0x6000 },
#endif
{ 0x03, 0x0000 },
{ 0x04, 0x4050 },
{ 0x05, 0x4000 },
{ 0x06, 0x01C8 },
{ 0x07, 0x0000 },
{ 0x08, 0x0000 },
{ 0x09, 0x0040 },
{ 0x0A, 0x0004 },
{ 0x0B, 0x00C0 },
{ 0x0C, 0x00C0 },
{ 0x0D, 0x0000 },
{ 0x0E, 0x0300 },
{ 0x0F, 0x00C0 },
{ 0x10, 0x00C0 },
{ 0x12, 0x0000 },
{ 0x13, 0x0010 },
{ 0x14, 0x0000 },
{ 0x15, 0x0000 },
{ 0x16, 0x8000 },
{ 0x17, 0x0800 },
{ 0x18, 0x008B },
{ 0x19, 0x008B },
{ 0x1A, 0x008B },
{ 0x1B, 0x008B },
{ 0x1C, 0x006D },
{ 0x1D, 0x006D },
{ 0x1E, 0x0066 },
{ 0x1F, 0x0020 },
{ 0x20, 0x0079 },
{ 0x21, 0x0079 },
{ 0x22, 0x0003 },
{ 0x23, 0x0003 },
{ 0x24, 0x0011 },
{ 0x25, 0x0100 },
{ 0x26, 0x0079 },
{ 0x27, 0x0079 },
{ 0x28, 0x0000 },
{ 0x29, 0x0000 },
{ 0x2A, 0x0000 },
{ 0x2B, 0x0000 },
{ 0x2C, 0x0000 },
{ 0x2D, 0x0000 },
{ 0x2E, 0x0000 },
{ 0x2F, 0x0000 },
{ 0x30, 0x0000 },
{ 0x31, 0x0000 },
{ 0x32, 0x0000 },
{ 0x33, 0x0000 },
{ 0x34, 0x0000 },
{ 0x35, 0x0000 },
{ 0x36, 0x0000 },
{ 0x37, 0x0000 },
{ 0x38, 0x0000 },
#ifndef <API key>
{ 0x39, 0x0000 },
#endif
{ 0x3A, 0x0000 },
{ 0x3C, 0x0000 },
{ 0x3D, 0x0000 },
{ 0x3E, 0x0000 },
{ 0x3F, 0x2EE0 },
{ 0x40, 0x0002 },
{ 0x41, 0x2287 },
{ 0x42, 0x025F },
{ 0x43, 0x0000 },
#ifndef <API key>
{ 0x44, 0x0000 },
#endif
{ 0x45, 0x0002 },
{ 0x46, 0x0000 },
{ 0x47, 0x0000 },
{ 0x48, 0x0000 },
{ 0x49, 0x0000 },
{ 0x4A, 0x0000 },
{ 0x4B, 0x0000 },
{ 0x4C, 0x1F25 },
{ 0x51, 0x0000 },
{ 0x54, 0x0000 },
{ 0x55, 0x054A },
{ 0x57, 0x0000 },
{ 0x58, 0x0000 },
{ 0x59, 0x0000 },
{ 0x5A, 0x0000 },
{ 0x60, 0x0100 },
{ 0x62, 0x0000 },
{ 0x63, 0x000C },
{ 0x64, 0x000C },
{ 0x65, 0x000C },
{ 0x66, 0x000C },
{ 0x67, 0x000C },
{ 0x68, 0x0FCA },
{ 0x69, 0x0400 },
{ 0x6A, 0x00D8 },
{ 0x6B, 0x1EB5 },
{ 0x6C, 0xF145 },
{ 0x6D, 0x0B75 },
{ 0x6E, 0x01C5 },
{ 0x6F, 0x1C58 },
{ 0x70, 0xF373 },
{ 0x71, 0x0A54 },
{ 0x72, 0x0558 },
{ 0x73, 0x168E },
{ 0x74, 0xF829 },
{ 0x75, 0x07AD },
{ 0x76, 0x1103 },
{ 0x77, 0x0564 },
{ 0x78, 0x0559 },
{ 0x79, 0x4000 },
{ 0x7A, 0x0000 },
{ 0x7B, 0x0F08 },
{ 0x7C, 0x0000 },
{ 0x7D, 0x0080 },
{ 0x7E, 0x0000 },
{ 0xC1, 0x0181 },
#else
{ 0x00 , 0x8993 },
#endif
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> amp_handset_path[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0004 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x03 , 0x00f3 },
{ 0x2d , 0x0001 },
{ 0x2e , 0x0001 },
{ 0x33 , 0x0018 },
{ 0x33 , 0x0010 },
{ 0x33 , 0x0008 },
{ 0x1f , 0x0030 },
{ 0x46 , 0x0100 },
{ 0x49 , 0x0110 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x39 , 0x004e },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x38 , 0x0040 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x01 , 0x0800 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0803 },
{ AMP_REGISTER_DELAY , 267 }, // delay = 256.5ms
{ 0x39 , 0x004c },
#endif
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x1f , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ 0x05 , 0x4000 },
{ AMP_REGISTER_DELAY , 260 },
#else
{ 0x1f , 0x0000 },
{ 0x33 , 0x0011 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ 0x2d , 0x0001 },
{ 0x2e , 0x0001 },
#ifndef <API key>
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 50 },
#endif
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
#ifndef <API key>
{ 0x01 , 0x0803 },
#endif
{ 0x03 , 0x00f3 },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0040 },
#else
{ 0x0a , 0x0000 },
#endif /*<API key>*/
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> amp_headset_path[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0004 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x03 , 0x00f3 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x46 , 0x0100 },
{ 0x49 , 0x0108 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x39 , 0x006c },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 33 }, // delay = 32.5ms
#endif
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 }, // delay = 4.5ms
#ifndef <API key>
{ 0x01 , 0x0303 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x60 , 0x0122 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x54 , 0x0033 },
{ AMP_REGISTER_DELAY , 257 }, // delay = 256.5ms
{ 0x60 , 0x01ee },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x1c , 0x0176 },
{ 0x1d , 0x0176 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
#ifndef <API key>
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
#endif
{ 0x55 , 0x03e0 },
{ 0x57 , 0x00fd },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x05 , 0xc000 }, // L,R Switching
#else
{ 0x1c , 0x0176 },
{ 0x1d , 0x0176 },
{ 0x60 , 0x0000 },
#ifndef <API key>
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 33 },
#endif
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ AMP_REGISTER_DELAY , 10 },
#ifndef <API key>
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
#endif
{ 0x55 , 0x03e0 },
#ifndef <API key>
{ 0x01 , 0x0303 },
#endif
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x05 , 0x8000 }, // L,R Switching
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x60 , 0x00ee },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0040 },
#else
{ 0x0a , 0x0000 },
#endif /*<API key>*/
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> amp_speaker_path[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0004 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x03 , 0x0333 },
{ 0x36 , 0x1003 },
{ 0x22 , 0x0000 },
{ 0x23 , 0x0100 },
{ 0x46 , 0x0100 },
{ 0x49 , 0x0110 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x39 , 0x006C },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 33 }, // delay = 32.5ms
{ 0x01 , 0x3003 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0173 },
{ 0x27 , 0x0173 },
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ 0x05 , 0x4000 },
{ AMP_REGISTER_DELAY , 15 },
#else
{ 0x22 , 0x0000 },
{ 0x23 , 0x0000 },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0173 },
{ 0x27 , 0x0173 },
{ 0x36 , 0x0003 },
#ifndef <API key>
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
#endif
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
#ifndef <API key>
{ 0x01 , 0x3003 },
#endif
{ 0x03 , 0x0333 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0040 },
#else
{ 0x0a , 0x0000 },
#endif /*<API key>*/
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0004 },
#endif /*<API key>*/
#ifdef <API key>
{ 0x03 , 0x03f3 },
{ 0x36 , 0x1003 },
{ 0x22 , 0x0000 },
{ 0x23 , 0x0100 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x46 , 0x0100 },
{ 0x49 , 0x0108 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x39 , 0x006c },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 33 }, // delay = 32.5ms
#endif
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 }, // delay = 4.5ms
#ifndef <API key>
{ 0x01 , 0x3303 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x60 , 0x0122 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x54 , 0x0033 },
{ AMP_REGISTER_DELAY , 257 }, // delay = 256.5ms
{ 0x60 , 0x01ee },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x1c , 0x0176 },
{ 0x1d , 0x0176 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
#ifndef <API key>
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
#endif
{ 0x55 , 0x03e0 },
{ 0x57 , 0x00fd },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0173 },
{ 0x27 , 0x0173 },
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ 0x05 , 0xc000 }, // L,R Switching
#else
{ 0x05 , 0x4000 },
{ 0x1c , 0x0176 },
{ 0x1d , 0x0176 },
{ 0x60 , 0x0000 },
#ifndef <API key>
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 33 },
#endif
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ AMP_REGISTER_DELAY , 10 },
#ifndef <API key>
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
#endif
{ 0x55 , 0x03e0 },
#ifndef <API key>
{ 0x01 , 0x0303 },
#endif
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x05 , 0x8000 }, // L,R Switching
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x60 , 0x00ee },
{ 0x22 , 0x0000 },
{ 0x23 , 0x0000 },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0173 },
{ 0x27 , 0x0173 },
{ 0x36 , 0x0003 },
#ifndef <API key>
{ 0x39 , 0x0068 },
{ 0x01 , 0x3303 },
#endif
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x03 , 0x03f3 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
#endif /*<API key>*/
#ifdef <API key>
{ 0x0a , 0x0040 },
#else
{ 0x0a , 0x0000 },
#endif /*<API key>*/
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> amp_mainmic_path[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x07 , 0x8000 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x01 , 0x0003 },
{ 0x04 , 0x0010 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x0f , 0x01c0 },
{ 0x18 , 0x010b },
{ AMP_REGISTER_DELAY , 15 },
{ 0x02 , 0x6243 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> amp_earmic_path[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x07 , 0x8000 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x01 , 0x0023 },
{ 0x04 , 0xc010 },
{ 0x10 , 0x01c0 },
{ 0x1a , 0x010b },
{ 0x28 , 0x0001 },
{ 0x2a , 0x0030 },
{ AMP_REGISTER_DELAY , 15 },
{ 0x02 , 0x6113 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0173 }, // 20110317 by ssgun - volume up : 0x0176 -> 0x016d
{ 0x1d , 0x0176 }, // 20110317 by ssgun - volume up : 0x0176 -> 0x016d
{ 0x1a , 0x010f },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x07 , 0x0000 },
#if 0 // 20110322 by ssgun - enable earmic
{ 0x04 , 0x4010 },
#else
{ 0x04 , 0xc010 },
#endif
{ AMP_REGISTER_DELAY , 10 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0323 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0001 },
{ 0x2a , 0x0020 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x10 , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x60 , 0x00ee },
{ 0x05 , 0x4001 },
{ 0x02 , 0x6111 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x22 , 0x0000},
{ 0x23 , 0x0000},
{ 0x24 , 0x0018},
{ 0x25 , 0x0138},
{ 0x26 , 0x0171},
{ 0x27 , 0x0171},
{ 0x36 , 0x0003},
{ 0x39 , 0x0068},
{ 0x01 , 0x0003},
{ 0x0f , 0x01d0},
{ 0x20 , 0x0179},
{ 0x21 , 0x0179},
{ 0x7b , 0xc718},
{ 0x7c , 0x1124},
{ 0x7d , 0x2c80},
{ 0x7e , 0x4600},
{ AMP_REGISTER_DELAY , 50 },
{ 0x07 , 0x0000},
{ 0x04 , 0x0010},
{ 0x01 , 0x3003},
{ 0x03 , 0x0333},
{ 0x01 , 0x3013},
{ 0x18 , 0x010b},
{ 0x28 , 0x0010},
{ 0x29 , 0x0020},
{ 0x62 , 0x0001},
{ 0x63 , 0x0001},
{ 0x64 , 0x000b},
{ 0x65 , 0x000f},
{ 0x66 , 0x000d},
{ 0x6f , 0x1b18},
{ 0x70 , 0xf48a},
{ 0x71 , 0x040a},
{ 0x72 , 0x11fa},
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4001},
{ 0x02 , 0x6243},
{ 0x0a , 0x0130},
{ AMP_REGISTER_END , 0 },
};
// VOICE CALL
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x07 , 0x0000 },
{ 0x1f , 0x0000 },
{ 0x33 , 0x0018 },
{ 0x20 , 0x017f },
{ 0x21 , 0x017f },
{ 0x2d , 0x0001 },
{ 0x2e , 0x0001 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x0f , 0x01c0 },
{ 0x10 , 0x01c0 },
{ 0x18 , 0x0106 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x0813 },
{ 0x03 , 0x00f3 },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x0a , 0x0130 },
{ 0x02 , 0x6342 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x22 , 0x0000 },
{ 0x23 , 0x0000 },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0174 },
{ 0x27 , 0x0174 },
{ 0x36 , 0x0003 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x0f , 0x01c0 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x3003 },
{ 0x03 , 0x0333 },
{ 0x01 , 0x3013 },
{ 0x18 , 0x010b },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x18 , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ AMP_REGISTER_DELAY , 10 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0313 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x0f , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x1a , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x04 , 0xc010 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0323 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0001 },
{ 0x2a , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x10 , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6111 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
// VOIP CALL
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x07 , 0x0000 },
{ 0x1f , 0x0000 },
{ 0x33 , 0x0018 },
{ 0x20 , 0x017f }, // 17f -> 179 (6db -> 0 db) -> 17f
{ 0x21 , 0x017f }, // 17f -> 179 (6db -> 0 db) -> 17f
{ 0x2d , 0x0001 },
{ 0x2e , 0x0001 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x0f , 0x01c0 },
{ 0x10 , 0x01c0 },
{ 0x18 , 0x010b }, // 0x0106 -> 0x010b
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x0803 }, // 0x0813 -> 0x0803
{ 0x03 , 0x00f3 },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x0a , 0x2000 }, // 0x0000 -> 0x2000
{ 0x02 , 0x6342 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x1a , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x04 , 0xc010 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0323 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0001 },
{ 0x2a , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x10 , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6111 },
{ 0x0a , 0x0130 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x18 , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ AMP_REGISTER_DELAY , 10 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0313 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x0f , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x22 , 0x0000 },
{ 0x23 , 0x0000 },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0174 },
{ 0x27 , 0x0174 },
{ 0x36 , 0x0003 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x0f , 0x01c0 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x3003 },
{ 0x03 , 0x0333 },
{ 0x01 , 0x3013 },
{ 0x18 , 0x010b },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
// VIDEO CALL
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x22 , 0x0000 },
{ 0x23 , 0x0000 },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0174 },
{ 0x27 , 0x0174 },
{ 0x36 , 0x0003 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x0f , 0x01c0 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x3003 },
{ 0x03 , 0x0333 },
{ 0x01 , 0x3013 },
{ 0x18 , 0x010b },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x1a , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x04 , 0xc010 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0323 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0001 },
{ 0x2a , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x10 , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6111 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x18 , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ AMP_REGISTER_DELAY , 10 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0313 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x0f , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x22 , 0x0000 },
{ 0x23 , 0x0000 },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0174 },
{ 0x27 , 0x0174 },
{ 0x36 , 0x0003 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x0f , 0x01c0 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x3003 },
{ 0x03 , 0x0333 },
{ 0x01 , 0x3013 },
{ 0x18 , 0x010b },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
// MEDIA RX+TX
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x07 , 0x0000 },
{ 0x1f , 0x0000 },
{ 0x33 , 0x0018 },
{ 0x20 , 0x017f },
{ 0x21 , 0x017f },
{ 0x2d , 0x0001 },
{ 0x2e , 0x0001 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x0f , 0x01c0 },
{ 0x10 , 0x01c0 },
{ 0x18 , 0x0106 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x0813 },
{ 0x03 , 0x00f3 },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x0a , 0x0130 },
{ 0x02 , 0x6342 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x1a , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x04 , 0xc010 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0323 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0001 },
{ 0x2a , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x10 , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6111 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x1c , 0x0179 },
{ 0x1d , 0x0179 },
{ 0x18 , 0x010b },
{ 0x60 , 0x0000 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ AMP_REGISTER_DELAY , 33 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ AMP_REGISTER_DELAY , 10 },
{ 0x44 , 0x0003 },
{ 0x56 , 0x0003 },
{ 0x44 , 0x0000 },
{ 0x55 , 0x03e0 },
{ 0x01 , 0x0313 },
{ 0x60 , 0x0022 },
{ 0x4c , 0x9f25 },
{ AMP_REGISTER_DELAY , 5 },
{ 0x03 , 0x00f3 },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x2d , 0x0100 },
{ 0x2e , 0x0100 },
{ 0x0f , 0x01c0 },
{ 0x54 , 0x0303 },
{ AMP_REGISTER_DELAY , 160 },
{ 0x57 , 0x00fd },
{ 0x54 , 0x000f },
{ AMP_REGISTER_DELAY , 15 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x000c },
{ 0x64 , 0x000c },
{ 0x65 , 0x000c },
{ 0x66 , 0x000c },
{ 0x67 , 0x000c },
{ 0x68 , 0x0fca },
{ 0x69 , 0x0400 },
{ 0x6a , 0x00d8 },
{ 0x6b , 0x1eb5 },
{ 0x6c , 0xf145 },
{ 0x6d , 0x0b75 },
{ 0x6e , 0x01c5 },
{ 0x6f , 0x1c58 },
{ 0x70 , 0xf373 },
{ 0x71 , 0x0a54 },
{ 0x72 , 0x0558 },
{ 0x73 , 0x168e },
{ 0x74 , 0xf829 },
{ 0x75 , 0x07ad },
{ 0x76 , 0x1103 },
{ 0x77 , 0x0564 },
{ 0x78 , 0x0559 },
{ 0x79 , 0x4000 },
{ 0x60 , 0x00ee },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key> // 20110210 by ssgun - slave mode
{ 0x08 , 0x8000 },
#endif /*<API key>*/
{ 0x22 , 0x0000 },
{ 0x23 , 0x0000 },
{ 0x24 , 0x0018 },
{ 0x25 , 0x0138 },
{ 0x26 , 0x0174 },
{ 0x27 , 0x0174 },
{ 0x36 , 0x0003 },
{ 0x39 , 0x0068 },
{ 0x01 , 0x0003 },
{ 0x0f , 0x01c0 },
{ 0x20 , 0x0179 },
{ 0x21 , 0x0179 },
{ 0x7b , 0xc718 },
{ 0x7c , 0x1124 },
{ 0x7d , 0x2c80 },
{ 0x7e , 0x4600 },
{ AMP_REGISTER_DELAY , 50 },
{ 0x07 , 0x0000 },
{ 0x04 , 0x4010 },
{ 0x01 , 0x3003 },
{ 0x03 , 0x0333 },
{ 0x01 , 0x3013 },
{ 0x18 , 0x010b },
{ 0x28 , 0x0010 },
{ 0x29 , 0x0030 },
{ 0x62 , 0x0001 },
{ 0x63 , 0x0001 },
{ 0x64 , 0x000b },
{ 0x65 , 0x000f },
{ 0x66 , 0x000d },
{ 0x6f , 0x1b18 },
{ 0x70 , 0xf48a },
{ 0x71 , 0x040a },
{ 0x72 , 0x11fa },
{ AMP_REGISTER_DELAY , 15 },
{ 0x05 , 0x4000 },
{ 0x02 , 0x6242 },
{ 0x0a , 0x0000 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
{ 0x00 , 0x8993 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
{ 0x00 , 0x8993 },
{ AMP_REGISTER_END , 0 },
};
static const <API key> *amp_sequence_path[AMP_PATH_MAX] [AMP_CAL_MAX]= {
// AMP_PATH_NONE
{
amp_none_path, // AMP_CAL_NORMAL
amp_none_path, // AMP_CAL_VOICECALL
amp_none_path, // AMP_CAL_VIDEOCALL
amp_none_path, // AMP_CAL_VOIPCALL
amp_none_path // AMP_CAL_LOOPBACK
},
// AMP_PATH_HANDSET
{
amp_handset_path,
<API key>,
<API key>,
<API key>,
amp_none_path
},
// AMP_PATH_HEADSET
{
amp_headset_path,
<API key>,
<API key>,
<API key>,
<API key>
},
// AMP_PATH_SPEAKER
{
amp_speaker_path,
<API key>,
<API key>,
<API key>,
<API key>
},
// <API key>
{
<API key>,
<API key>,
<API key>,
<API key>,
amp_none_path
},
// <API key>
{
amp_headset_path,
<API key>,
<API key>,
<API key>,
<API key>
},
// AMP_PATH_MAINMIC
{
amp_mainmic_path,
<API key>,
<API key>,
<API key>,
<API key>
},
// AMP_PATH_EARMIC
{
amp_earmic_path,
<API key>,
<API key>,
<API key>,
<API key>
},
};
#ifdef <API key>
#ifndef <API key>
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key>
{ 0x0a , 0x0004 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x46 , 0x0100 },
{ 0x49 , 0x012a },
{ 0x00 , 0x1000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x54 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x01 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x4c , 0x1f25 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x39 , 0x006e },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0000 },
{ AMP_REGISTER_DELAY , 33 }, // delay = 32.5ms
#endif
{ 0x37 , 0x0001 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x38 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x37 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x39 , 0x0000 },
{ AMP_REGISTER_DELAY , 200 }, // delay = 512.5ms too long -> 200ms
#endif
{ 0x2d , 0x0000 },
{ 0x2e , 0x0000 },
{ 0x33 , 0x0000 },
{ 0x1f , 0x0020 },
{ 0x03 , 0x0000 },
//{ 0x00 , 0x8993 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key>
{ 0x0a , 0x0004 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x46 , 0x0100 },
{ 0x49 , 0x0122 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x60 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x54 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x01 , 0x3003 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x4c , 0x1f25 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x39 , 0x006e },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0000 },
{ AMP_REGISTER_DELAY , 33 }, // delay = 32.5ms
{ 0x39 , 0x0000 },
{ AMP_REGISTER_DELAY , 200 }, // delay = 512.5ms too long -> 200ms
#endif
{ 0x2d , 0x0000 },
{ 0x2e , 0x0000 },
{ 0x03 , 0x0000 },
//{ 0x00 , 0x8993 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key>
{ 0x0a , 0x0004 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x46 , 0x0100 },
{ 0x49 , 0x0122 },
{ 0x54 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x4c , 0x1f25 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x39 , 0x006e },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0000 },
{ AMP_REGISTER_DELAY , 33 }, // delay = 32.5ms
{ 0x39 , 0x0000 },
{ AMP_REGISTER_DELAY , 200 }, // delay = 512.5ms too long -> 200ms
#endif
{ 0x22 , 0x0003 },
{ 0x23 , 0x0103 },
{ 0x36 , 0x0000 },
{ 0x03 , 0x0000 },
//{ 0x00 , 0x8993 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
#ifdef <API key>
{ 0x0a , 0x0004 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x46 , 0x0100 },
{ 0x49 , 0x0122 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x60 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x54 , 0x0000 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x01 , 0x3003 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#endif
{ 0x4c , 0x1f25 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
#ifndef <API key>
{ 0x01 , 0x0003 },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x39 , 0x006e },
{ AMP_REGISTER_DELAY , 1 }, // delay = 0.5625ms
{ 0x01 , 0x0000 },
{ AMP_REGISTER_DELAY , 33 }, // delay = 32.5ms
{ 0x39 , 0x0000 },
{ AMP_REGISTER_DELAY , 200 }, // delay = 512.5ms too long -> 200ms
#endif
{ 0x22 , 0x0003 },
{ 0x23 , 0x0103 },
{ 0x2d , 0x0000 },
{ 0x2e , 0x0000 },
{ 0x36 , 0x0000 },
{ 0x03 , 0x0000 },
//{ 0x00 , 0x8993 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
{ 0x00 , 0x8993 },
{ AMP_REGISTER_END , 0 },
};
REG_MEMORY <API key> <API key>[REG_COUNT] = {
{ 0x00 , 0x8993 },
{ AMP_REGISTER_END , 0 },
};
static const <API key> *<API key>[AMP_PATH_MAX]= {
amp_none_path, // AMP_PATH_NONE
<API key>, // AMP_PATH_HANDSET
<API key>, // AMP_PATH_HEADSET
<API key>, // AMP_PATH_SPEAKER
<API key>, // <API key>
<API key>, // <API key>
<API key>, // AMP_PATH_MAINMIC
<API key>, // AMP_PATH_EARMIC
};
#endif
#endif /* <API key> */
void wm8993_init(void)
{
pr_debug("%s\n", __func__);
}
EXPORT_SYMBOL(wm8993_init);
void wm8993_exit(void)
{
pr_debug("%s\n", __func__);
}
EXPORT_SYMBOL(wm8993_exit);
#ifdef <API key>
static void <API key>(<API key> *amp_regs)
{
int i;
struct snddev_wm8993 *wm8993 = &wm8993_modules;
const <API key> *wm8993_reg_defaults = amp_sequence_path[0][0];
if(amp_regs == NULL || wm8993_reg_defaults == NULL)
{
APM_INFO("Failed to resotre wm8993 default register\n");
return;
}
mutex_lock(&wm8993->path_lock);
/* Restore the register settings */
for (i = 0; (i < AMP_REGISTER_MAX) && (amp_regs[i].reg == wm8993_reg_defaults[i].reg); i++)
{
wm8993_write(i, wm8993_reg_defaults[i].value);
}
mutex_unlock(&wm8993->path_lock);
APM_INFO("Completed to resotre wm8993 default register\n");
return;
}
#endif
#ifdef <API key>
static void <API key> (void *data, size_t size)
{
#ifdef WM8993_DEGUB_MSG
int i = 0;
int nCMDCount = 0;
AMP_PATH_TYPE_E path = (AMP_PATH_TYPE_E)pFirstData->reg;
AMP_CAL_TYPE_E cal = (AMP_PATH_TYPE_E)pFirstData->value;
#endif
<API key> *pFirstData = (<API key>*)data;
<API key> *pCurData = (<API key>*)data;
<API key> *amp_regs;
#ifdef WM8993_DEGUB_MSG
nCMDCount = size / sizeof(<API key>);
APM_INFO("CODEC_TUNING PATH = %d, CAL = %d COUNT =%d \n", path, cal, nCMDCount);
for ( i = 0 ; i < nCMDCount ; i ++ )
{
APM_INFO("CMD = [0X%.2x] , [0X%.4x] \n" , pCurData->reg , pCurData->value);
pCurData = pCurData + 1;
}
#endif
pCurData = pFirstData + 1;
amp_regs = pCurData;
wm8993_set_register((<API key> *)amp_regs);
}
void wm8993_tuning(void *data, size_t size)
{
if (data == NULL || size == 0 || size > (sizeof(<API key>) * AMP_REGISTER_MAX))
{
APM_INFO("invalid prarameters data = %d, size = %d \n", (int)data, size);
return;
}
<API key>(data, size);
}
EXPORT_SYMBOL(wm8993_tuning);
#endif /*<API key>*/
/**
* wm8993_set
* @param cal: kind of cal type
*
* @returns void
*/
void wm8993_set(int type, int value)
{
if(type == AMP_TYPE_CAL)
{
wm8993_set_caltype(value);
}
else
{
wm8993_set_pathtype(value);
}
}
EXPORT_SYMBOL(wm8993_set);
/**
* wm8993_get
* @param cal: kind of cal type
*
* @returns void
*/
void wm8993_get(int type, int * value)
{
if(type == AMP_TYPE_CAL)
{
*value = wm8993_get_caltype();
}
else
{
*value = wm8993_get_pathtype();
}
}
EXPORT_SYMBOL(wm8993_get);
/**
* wm8993_set_caltype - Set calibration kind in WM8993
* @param cal: kind of cal type
*
* @returns void
*/
void wm8993_set_caltype(AMP_CAL_TYPE_E cal)
{
if (cal < AMP_CAL_NORMAL || cal >= AMP_CAL_MAX)
{
APM_INFO("not support calibration type on wm8993 cal = %d\n", cal);
return;
}
m_curr_cal = cal;
APM_INFO("Set calibration type on wm8993 cal = %d\n", m_curr_cal);
}
EXPORT_SYMBOL(wm8993_set_caltype);
/**
* wm8993_get_caltype - get calibration kind in WM8993
*
* @returns AMP_CAL_TYPE_E
*/
AMP_CAL_TYPE_E wm8993_get_caltype(void)
{
APM_INFO("Get calibration type on wm8993 cal = %d\n", m_curr_cal);
return m_curr_cal;
}
EXPORT_SYMBOL(wm8993_get_caltype);
/**
* wm8993_set_caltype - Set path kind in WM8993
* @param cal: kind of cal type
*
* @returns void
*/
void wm8993_set_pathtype(AMP_PATH_TYPE_E path)
{
if (path < AMP_PATH_NONE || path >= AMP_PATH_MAX)
{
APM_INFO("not support path type on wm8993 path = %d\n", path);
return;
}
m_curr_path = path;
APM_INFO("Set path type on wm8993 path = %d\n", m_curr_cal);
}
EXPORT_SYMBOL(wm8993_set_pathtype);
/**
* wm8993_get_pathtype - get path kind in WM8993
*
* @returns AMP_PATH_TYPE_E
*/
AMP_PATH_TYPE_E wm8993_get_pathtype(void)
{
APM_INFO("Get path type on wm8993 path = %d\n", m_curr_path);
return m_curr_path;
}
EXPORT_SYMBOL(wm8993_get_pathtype);
void wm8993_set_register(<API key> *amp_regs)
{
uint32_t loop = 0;
struct snddev_wm8993 *wm8993 = &wm8993_modules;
#ifdef WM8993_CHECK_RESET
if (atomic_read(&wm8993->isreset) == 1)
atomic_set(&wm8993->isreset, 0);
#endif /*WM8993_CHECK_RESET*/
while (amp_regs[loop].reg != AMP_REGISTER_END)
{
if (amp_regs[loop].reg == AMP_REGISTER_DELAY)
{
msleep(amp_regs[loop].value);
}
else if (amp_regs[loop].reg == WM8993_IDAC_REG)
{
// read R59h & R5Ah and apply -2 code offset to left and right iDAC values
unsigned short r59 = 0, r5a = 0, r57 = 0;
wm8993_read(0x59, &r59);
wm8993_read(0x5a, &r5a);
r59 -= 2;
r5a -= 2;
r57 = (r5a & 0x00FF) | ((r59 & 0x00FF)<<8);
wm8993_write(amp_regs[loop].reg, r57);
}
else
{
wm8993_write(amp_regs[loop].reg, amp_regs[loop].value);
#ifdef WM8993_DEGUB_MSG
APM_INFO("reg 0x%x , value 0x%x",amp_regs[loop].reg, amp_regs[loop].value);
#endif
}
loop++;
}
return;
}
EXPORT_SYMBOL(wm8993_set_register);
#ifdef <API key>
void <API key>(void)
{
u8 addr;
unsigned short value;
struct snddev_wm8993 *wm8993 = &wm8993_modules;
if(atomic_read(&wm8993->amp_enabled) == 1)
{
APM_INFO("The device(%d) is already open\n", cur_rx);
return;
}
addr = 0x01;
if (cur_rx == AMP_PATH_HEADSET || cur_rx == <API key>)
{
if(cur_tx == AMP_PATH_MAINMIC)
value = 0x0317; //0x0303;
else if(cur_tx == AMP_PATH_EARMIC)
value = 0x0327; //0x0303;
else
value = 0x0307; //0x0303;
}
else if (cur_rx == AMP_PATH_SPEAKER)
{
if(cur_tx == AMP_PATH_MAINMIC)
value = 0x3017; //0x3003;
else if(cur_tx == AMP_PATH_EARMIC)
value = 0x3027; //0x3003;
else
value = 0x3007; //0x3003;
}
else if (cur_rx == <API key>)
{
if(cur_tx == AMP_PATH_MAINMIC)
value = 0x3317; //0x3303;
else if(cur_tx == AMP_PATH_EARMIC)
value = 0x3327; //0x3303;
else
value = 0x3307; //0x3303;
}
else
{
APM_INFO("Enable Amplifier - Unsupported Device\n");
return;
}
wm8993_write(addr, value);
APM_INFO("Enable Amplifier - Register(0x01,0x%x)\n", value);
atomic_set(&wm8993->amp_enabled, 1);
return;
}
EXPORT_SYMBOL(<API key>);
void <API key>(void)
{
u8 addr;
unsigned short value;
struct snddev_wm8993 *wm8993 = &wm8993_modules;
if(atomic_read(&wm8993->amp_enabled) == 0)
{
APM_INFO("The device(%d) is already closed\n", cur_rx);
return;
}
if(cur_rx == AMP_PATH_NONE)
{
APM_INFO("Disable Amplifier - Unsupported Device\n");
return;
}
addr = 0x01;
if(cur_tx == AMP_PATH_MAINMIC)
value = 0x0013;
else if(cur_tx == AMP_PATH_EARMIC)
value = 0x0023;
else
value = 0x0003;
wm8993_write(addr, value);
APM_INFO("Disable Amplifier - Register(0x0x,0x0003)\n");
atomic_set(&wm8993->amp_enabled, 0);
return;
}
EXPORT_SYMBOL(<API key>);
#endif /*<API key>*/
#ifdef <API key>
static int <API key>(enum <API key> level)
{
int ret = 0;
struct snddev_wm8993 *wm8993 = &wm8993_modules;
switch (level)
{
case <API key>:
if (wm8993->master_bias_level == <API key>)
{
/* VMID=2*40k */
wm8993_update(<API key>,
<API key>, 0x2);
wm8993_update(<API key>,
WM8993_TSHUT_ENA, WM8993_TSHUT_ENA);
}
break;
case <API key>:
if (wm8993->master_bias_level == <API key>)
{
wm8993_reset(AMP_PATH_NONE);
/* Tune DC servo configuration */
wm8993_write(0x44, 0x0003);
wm8993_write(0x56, 0x0003);
wm8993_write(0x44, 0x0000);
/* Bring up VMID with fast soft start */
wm8993_update(WM8993_ANTIPOP2,
<API key> |
WM8993_VMID_BUF_ENA |
<API key> |
WM8993_BIAS_SRC,
<API key> |
WM8993_VMID_BUF_ENA |
<API key> |
WM8993_BIAS_SRC);
/* VMID=2*40k */
wm8993_update(<API key>,
<API key> |
WM8993_BIAS_ENA,
WM8993_BIAS_ENA | 0x2);
msleep(32);
/* Switch to normal bias */
wm8993_update(WM8993_ANTIPOP2,
WM8993_BIAS_SRC |
<API key>, 0);
}
/* VMID=2*240k */
wm8993_update(<API key>,
<API key>, 0x4);
wm8993_update(<API key>,
WM8993_TSHUT_ENA, 0);
break;
case <API key>:
if (wm8993->master_bias_level == <API key>)
{
wm8993_write(0x39, 0x0068);
wm8993_write(0x01, 0x3003);
}
break;
case <API key>:
wm8993_update(<API key>,
<API key> | WM8993_BIAS_ENA,
0);
wm8993_update(WM8993_ANTIPOP2,
<API key> |
WM8993_VMID_BUF_ENA |
<API key> |
WM8993_BIAS_SRC, 0);
break;
}
wm8993->master_bias_level = level;
return ret;
}
#endif
/**
* wm8993_enable - Enable path in WM8993
* @param path: amp path
*
* @returns void
*/
void wm8993_enable(AMP_PATH_TYPE_E path)
{
struct snddev_wm8993 *wm8993 = &wm8993_modules;
#ifdef WM8993_SINGLE_PATH // 20110510 by ssgun
const <API key> *amp_regs = amp_sequence_path[path][m_curr_cal];
int isvoice = <API key>();
APM_INFO("path = new[%d] vs old[%d:%d], cal_type = %d\n",
path, m_curr_path, m_prev_path, m_curr_cal);
if(amp_regs == NULL || path <= AMP_PATH_NONE || path >= AMP_PATH_MAX)
{
APM_INFO("not support path on wm8993 path = %d\n", path);
return;
}
mutex_lock(&wm8993->path_lock);
if(path == m_curr_path)
{
mutex_unlock(&wm8993->path_lock);
APM_INFO("same previous path on wm8993 path = %d\n", path);
return;
}
if(isvoice == 1) // <API key>
{
if((m_curr_path != AMP_PATH_NONE) && (m_curr_path != path))
{
m_prev_path = m_curr_path;
m_curr_path = path;
mutex_unlock(&wm8993->path_lock);
APM_INFO("========== RETURN ==========\n");
return;
}
if(m_curr_cal == AMP_CAL_NORMAL) // if it is'nt call
{
APM_INFO("[CALL] OLD : path = %d, old reg = %p, cal_type = %d\n",
m_curr_path, amp_regs, m_curr_cal);
m_curr_cal = AMP_CAL_VOICECALL;
amp_regs = amp_sequence_path[path][m_curr_cal];
APM_INFO("[CALL] NEW : path = %d, new reg = %p, cal_type = %d\n",
path, amp_regs, m_curr_cal);
}
}
else // MEDIA
{
bool bTxRxOpen = false;
unsigned short newpath = 0;
unsigned short newcaltype = 0;
if(m_curr_path != AMP_PATH_NONE && m_curr_path != path)
{
if(m_curr_path == AMP_PATH_HANDSET && path == AMP_PATH_MAINMIC)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VOICECALL;
newpath = path;
}
else if(m_curr_path == AMP_PATH_HEADSET && path == AMP_PATH_MAINMIC)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VIDEOCALL;
newpath = path;
}
else if(m_curr_path == AMP_PATH_SPEAKER && path == AMP_PATH_MAINMIC)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VOIPCALL;
newpath = path;
}
else if(m_curr_path == AMP_PATH_HEADSET && path == AMP_PATH_EARMIC)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VIDEOCALL;
newpath = path;
}
else if(m_curr_path == AMP_PATH_MAINMIC && path == AMP_PATH_HANDSET)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VOICECALL;
newpath = AMP_PATH_MAINMIC;
}
else if(m_curr_path == AMP_PATH_MAINMIC && path == AMP_PATH_HEADSET)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VIDEOCALL;
newpath = AMP_PATH_MAINMIC;
}
else if(m_curr_path == AMP_PATH_EARMIC && path == AMP_PATH_HEADSET)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VIDEOCALL;
newpath = AMP_PATH_EARMIC;
}
else if(m_curr_path == AMP_PATH_MAINMIC && path == AMP_PATH_SPEAKER)
{
bTxRxOpen = true;
newcaltype = AMP_CAL_VOIPCALL;
newpath = AMP_PATH_MAINMIC;
}
else
{
}
if(bTxRxOpen)
{
wm8993_reset(m_curr_path);
APM_INFO("[MEDIA] OLD : path = %d, cal_type = %d => reg = %p\n",
path, m_curr_cal, amp_regs);
if(m_curr_cal == AMP_CAL_LOOPBACK) newcaltype = AMP_CAL_LOOPBACK;
amp_regs = amp_sequence_path[newpath][newcaltype];
APM_INFO("[MEDIA] NEW : path = %d, cal_type = %d => reg = %p\n",
newpath, newcaltype, amp_regs);
}
}
}
m_prev_path = m_curr_path;
m_curr_path = path;
mutex_unlock(&wm8993->path_lock);
#else
int tx = 0, rx = 0;
int new_cal = 0, new_path = 0;
int new_rx = 0, new_tx = 0;
int isvoice = 0;
bool reset = false;
const <API key> *amp_regs;
if(path <= AMP_PATH_NONE || path >= AMP_PATH_MAX)
{
APM_INFO("not support path on wm8993 path = %d\n", path);
return;
}
if(path == AMP_PATH_MAINMIC || path == AMP_PATH_EARMIC)
{
new_tx = path;
}
else
{
new_rx = path;
#ifdef <API key>
atomic_set(&wm8993->amp_enabled, 1);
#endif /*<API key>*/
}
isvoice = <API key>();
APM_INFO("Input Path [%d], CAL[%d] - NEW R:Tx[%d:%d] vs Cur R:Tx[%d:%d]\n",
path, new_rx, new_tx, cur_rx, cur_tx, m_curr_cal);
mutex_lock(&wm8993->path_lock);
#ifdef <API key>
if(isvoice == 1)
{
bool bSetReg = false;
bool bReset = false;
if(new_tx)
{
cur_tx = m_curr_path = new_path = new_tx;
}
if(new_rx)
{
bSetReg = true;
if(new_rx != cur_rx) bReset = true;
else if(new_rx == cur_rx) bSetReg = false;
cur_rx = m_curr_path = new_path = new_rx;
}
// Exception Case: HEADSET_NOMIC
if(cur_tx == AMP_PATH_MAINMIC && cur_rx == AMP_PATH_HEADSET)
{
new_path = <API key>;
bSetReg = true;
bReset = true;
}
if(bSetReg)
{
if(m_curr_cal == AMP_CAL_NORMAL) m_curr_cal = AMP_CAL_VOICECALL;
new_cal = m_curr_cal;
if(bReset) wm8993_reset(m_curr_path);
amp_regs = amp_sequence_path[new_path][new_cal];
if(amp_regs == NULL)
{
APM_INFO("WM8993 Path:Cal [%d:%d] is empty value\n", new_path, new_cal);
mutex_unlock(&wm8993->path_lock);
return;
}
mutex_unlock(&wm8993->path_lock);
goto set_register;
}
else
{
APM_INFO("WM8993 Path:Cal [%d:%d] Call State\n", new_path, new_cal);
mutex_unlock(&wm8993->path_lock);
return;
}
}
#endif /*<API key>*/
if(new_rx != 0 && cur_rx != 0)
{
cur_rx = rx = new_rx;
reset = true;
}
else if(new_rx)
{
cur_rx = rx = new_rx;
}
else if(cur_rx)
{
rx = cur_rx;
}
if(new_tx != 0 && cur_tx != 0)
{
cur_tx = tx = new_tx;
reset = true;
}
else if(new_tx)
{
cur_tx = tx = new_tx;
}
else if(cur_tx)
{
tx = cur_tx;
}
if(isvoice == 1)
{
if(m_curr_cal == AMP_CAL_NORMAL) m_curr_cal = AMP_CAL_VOICECALL;
}
else
{
if(m_curr_cal == AMP_CAL_VOICECALL) m_curr_cal = AMP_CAL_NORMAL;
}
mutex_unlock(&wm8993->path_lock);
if(rx != 0 && tx != 0)
{
reset = true;
if(isvoice == 1)
{
APM_INFO("WM8993 Call State - New R:Tx [%d:%d] Cur R:Tx[%d:%d]\n",
new_rx, new_tx, rx, tx);
if(rx == AMP_PATH_HANDSET)
{
new_cal = m_curr_cal;
new_path = rx;
}
else if(rx == AMP_PATH_HEADSET)
{
new_cal = m_curr_cal;
if(tx == AMP_PATH_MAINMIC)
new_path = <API key>;
else
new_path = rx;
}
else if(rx == AMP_PATH_SPEAKER)
{
new_cal = m_curr_cal;
new_path = rx;
}
else if(rx == <API key>)
{
new_cal = AMP_CAL_NORMAL; // Exception Case
new_path = rx;
}
else if(rx == <API key>)
{
new_cal = m_curr_cal;
if(tx == AMP_PATH_MAINMIC)
new_path = rx;
else // Exception Case
new_path = AMP_PATH_HEADSET;
}
else
{
APM_INFO("WM8993 Unknown Path - New R:Tx [%d:%d] Cal[%d]\n",
new_rx, new_tx, m_curr_cal);
return;
}
}
else
{
APM_INFO("WM8993 Media State - New R:Tx [%d:%d] Cur R:Tx[%d:%d]\n",
new_rx, new_tx, rx, tx);
if(rx == AMP_PATH_HANDSET)
{
if(m_curr_cal == AMP_CAL_VOICECALL)
{
new_cal = m_curr_cal;
new_path = rx;
}
else
{
new_cal = AMP_CAL_VOICECALL;
new_path = tx;
}
}
else if(rx == AMP_PATH_HEADSET)
{
if(m_curr_cal == AMP_CAL_VOICECALL)
{
new_cal = m_curr_cal;
new_path = rx;
}
else
{
new_cal = AMP_CAL_VIDEOCALL;
new_path = tx;
}
}
else if(rx == AMP_PATH_SPEAKER)
{
if(m_curr_cal == AMP_CAL_VOICECALL)
{
new_cal = m_curr_cal;
new_path = rx;
}
else
{
new_cal = AMP_CAL_VOIPCALL;
new_path = tx;
}
}
else if(rx == <API key>)
{
if(m_curr_cal == AMP_CAL_VOICECALL)
{
new_cal = m_curr_cal;
new_path = rx;
}
else
{
new_cal = AMP_CAL_NORMAL; // Exception Case
new_path = rx;
}
}
else if(rx == <API key>)
{
if(m_curr_cal == AMP_CAL_VOICECALL)
{
new_cal = m_curr_cal;
new_path = rx;
}
else
{
new_cal = AMP_CAL_VIDEOCALL;
new_path = rx;
}
}
else
{
APM_INFO("WM8993 Unknown Path - New R:Tx [%d:%d] Cal[%d]\n",
new_rx, new_tx, m_curr_cal);
return;
}
}
}
else if(rx)
{
new_path = rx;
new_cal = m_curr_cal; // 20110516 by ssgun
}
else if(tx)
{
new_path = tx;
new_cal = m_curr_cal; // 20110516 by ssgun
}
else
{
APM_INFO("WM8993 Unknown Path [%d] Cal[%d]\n", new_path, new_cal);
return;
}
m_curr_path = new_path;
m_prev_cal = new_cal;
APM_INFO("WM8993 Set Path - New R:Tx [%d:%d] Current R:Tx [%d:%d]\n",
new_path, new_cal, cur_rx, cur_tx);
if(reset)
{
if(path == cur_rx)
wm8993_reset(cur_tx);
else if(path == cur_tx)
wm8993_reset(cur_rx);
else
wm8993_reset(AMP_PATH_NONE);
}
amp_regs = amp_sequence_path[new_path][new_cal];
if(amp_regs == NULL)
{
APM_INFO("WM8993 Path[%d:%d] is empty value\n", new_path, new_cal);
return;
}
#endif /*WM8993_SINGLE_PATH*/
#ifdef <API key>
set_register:
#endif /*<API key>*/
#if 0 // default Speaker Switch Status : Enable -> Disable
#ifdef <API key>
if((path == AMP_PATH_HANDSET) && (atomic_read(&wm8993->isspksw) == 0))
{
APM_INFO("HANDSET[%d]-Disable SpeakerSwitch\n", path);
gpio_set_value(WM8993_SPK_SW_GPIO, 1);
atomic_set(&wm8993->isspksw, 1);
}
#else
if((path == AMP_PATH_HANDSET) && (gpio_get_value(WM8993_SPK_SW_GPIO) == 0))
{
APM_INFO("HANDSET[%d]-Disable SpeakerSwitch\n", path);
gpio_set_value(WM8993_SPK_SW_GPIO, 1);
}
#endif /*<API key>*/
#else
if(path == AMP_PATH_SPEAKER || path == <API key>)
{
if (gpio_get_value(WM8993_SPK_SW_GPIO) != 0) {
gpio_set_value(WM8993_SPK_SW_GPIO, 0);
APM_INFO("Enable Speaker Switch : %d\n", path);
usleep(100);
}
}
else
{
if (gpio_get_value(WM8993_SPK_SW_GPIO) != 1) {
gpio_set_value(WM8993_SPK_SW_GPIO, 1);
APM_INFO("Disable Speaker Switch : %d\n", path);
usleep(100);
}
}
#endif
#ifdef <API key>
<API key>(<API key>);
//msleep(1);
<API key>(<API key>);
//msleep(1);
#endif
mutex_lock(&wm8993->path_lock);
wm8993_set_register((<API key> *)amp_regs);
mutex_unlock(&wm8993->path_lock);
APM_INFO("WM8993 Apply to register is completed - Path [%d:%d] Cal[%d]\n",
path, new_path, new_cal);
return;
}
EXPORT_SYMBOL(wm8993_enable);
/**
* wm8993_disable - Disable path in WM8993
* @param path: amp path
*
* @returns void
*/
void wm8993_disable(AMP_PATH_TYPE_E path)
{
struct snddev_wm8993 *wm8993 = &wm8993_modules;
#ifdef WM8993_SINGLE_PATH // 20110510 by ssgun
int isvoice = <API key>();
APM_INFO("path = new[%d] vs old[%d:%d], cal_type = %d\n",
path, m_curr_path, m_prev_path, m_curr_cal);
mutex_lock(&wm8993->path_lock);
if(path == m_prev_path)
{
m_prev_path = AMP_PATH_NONE;
APM_INFO("disable path = %d vs enable path = %d\n", path, m_curr_path);
goto noreset;
}
else if(path == m_curr_path)
{
if(m_prev_path != AMP_PATH_NONE)
{
m_curr_path = m_prev_path;
m_prev_path = AMP_PATH_NONE;
APM_INFO("disable path = %d vs enable path = %d\n", path, m_curr_path);
goto noreset;
}
}
m_curr_path = AMP_PATH_NONE;
m_prev_path = AMP_PATH_NONE;
wm8993_reset(path);
noreset:
mutex_unlock(&wm8993->path_lock);
#ifdef <API key>
if((path == AMP_PATH_HANDSET) && (atomic_read(&wm8993->isspksw) == 1))
{
APM_INFO("HANDSET[%d]-Enable SpeakerSwitch\n", path);
gpio_set_value(WM8993_SPK_SW_GPIO, 0);
atomic_set(&wm8993->isspksw, 0);
}
#else
if((path == AMP_PATH_HANDSET) && (gpio_get_value(WM8993_SPK_SW_GPIO) == 1))
{
APM_INFO("HANDSET[%d]-SPK_SW_GPIO:LOW\n", path);
gpio_set_value(WM8993_SPK_SW_GPIO, 0);
}
#endif /*<API key>*/
if((m_curr_path != AMP_PATH_NONE) && (isvoice != 1))
{
const <API key> *amp_regs = NULL;
APM_INFO("new apply path = %d -> %d, caltype = %d\n", path, m_curr_path, m_curr_cal);
m_curr_cal = AMP_CAL_NORMAL;
amp_regs = amp_sequence_path[m_curr_path][m_curr_cal];
if(amp_regs == NULL)
{
APM_INFO("not support path on wm8993 path = %d, cal = %d\n", m_curr_path, m_curr_cal);
return;
}
wm8993_reset(path);
wm8993_set_register((<API key> *)amp_regs);
}
#else
int new_rx = 0, new_tx = 0;
int new_cal = 0, new_path = 0;
int isvoice = 0;
bool reset = true;
if(path <= AMP_PATH_NONE || path >= AMP_PATH_MAX)
{
APM_INFO("not support path on wm8993 path = %d\n", path);
return;
}
if(path == AMP_PATH_MAINMIC || path == AMP_PATH_EARMIC)
{
new_tx = path;
}
else
{
new_rx = path;
#ifdef <API key>
atomic_set(&wm8993->amp_enabled, 0);
#endif /*<API key>*/
}
isvoice = <API key>();
APM_INFO("[%d] NEW R:Tx[%d:%d] vs CUR R:Tx[%d:%d], CAL[%d]\n",
path, new_rx, new_tx, cur_rx, cur_tx, m_curr_cal);
mutex_lock(&wm8993->path_lock);
if(new_tx != AMP_PATH_NONE)
{
if(cur_tx != new_tx)
{
// Exception Case
}
m_prev_path = cur_tx;
cur_tx = AMP_PATH_NONE;
if(cur_rx != AMP_PATH_NONE)
{
new_path = cur_rx;
}
}
if(new_rx != AMP_PATH_NONE)
{
if(cur_rx != new_rx)
{
// Exception Case
}
m_prev_path = cur_rx;
cur_rx = AMP_PATH_NONE;
if(cur_tx != AMP_PATH_NONE)
{
new_path = cur_tx;
}
}
m_curr_path = new_path;
#if 0 // default Speaker Switch Status : Enable -> Disable
#ifdef <API key>
if((path == AMP_PATH_HANDSET) && (atomic_read(&wm8993->isspksw) == 1))
{
APM_INFO("HANDSET[%d]-Enable SpeakerSwitch\n", path);
gpio_set_value(WM8993_SPK_SW_GPIO, 0);
atomic_set(&wm8993->isspksw, 0);
}
#else
if((path == AMP_PATH_HANDSET) && (gpio_get_value(WM8993_SPK_SW_GPIO) == 1))
{
APM_INFO("HANDSET[%d]-SPK_SW_GPIO:LOW\n", path);
gpio_set_value(WM8993_SPK_SW_GPIO, 0);
}
#endif /*<API key>*/
#else
if (gpio_get_value(WM8993_SPK_SW_GPIO) != 1)
{
APM_INFO("Disable Speaker Switch : %d\n", path);
gpio_set_value(WM8993_SPK_SW_GPIO, 1);
usleep(100);
}
#endif
if(new_path != AMP_PATH_NONE && (isvoice != 1))
{
const <API key> *amp_regs = NULL;
m_curr_cal = AMP_CAL_NORMAL;
new_cal = m_curr_cal;
APM_INFO("new apply path = %d -> %d, caltype = %d\n", path, new_path, new_cal);
amp_regs = amp_sequence_path[new_path][new_cal];
if(amp_regs == NULL)
{
mutex_unlock(&wm8993->path_lock);
APM_INFO("not support path on wm8993 path = %d, cal = %d\n", new_path, new_cal);
return;
}
if(reset) wm8993_reset(path);
wm8993_set_register((<API key> *)amp_regs);
}
else
{
APM_INFO("Calling : apply path = %d -> %d, caltype = %d\n", path, new_path, new_cal);
#ifdef <API key>
#ifdef <API key>
if(new_path == AMP_PATH_NONE) wm8993_reset(path);
#else
wm8993_set_register((<API key> *)<API key>[path]);
#endif
#else
#ifdef <API key> // DAC SOFT MUTE AND SOFT UN-MUTE
if((path != AMP_PATH_MAINMIC) && (path != AMP_PATH_EARMIC)) // only rx devices
{
u8 dacctrl_addr = 0x0a;
unsigned short dacctrl_value = 0x0004;
wm8993_write(dacctrl_addr, dacctrl_value);
msleep(1); // delay = 0.5625ms
} while(0);
#endif /* <API key> */
if(new_path == AMP_PATH_NONE) wm8993_reset(path);
#endif
}
mutex_unlock(&wm8993->path_lock);
#endif /*WM8993_SINGLE_PATH*/
}
EXPORT_SYMBOL(wm8993_disable);
void wm8993_reset(AMP_PATH_TYPE_E path)
{
#ifdef <API key>
const <API key> *amp_regs = amp_sequence_path[path][m_prev_cal];
APM_INFO("setting register path = %d cal = %d\n", path, m_prev_cal);
<API key>((<API key> *)amp_regs);
#else
struct snddev_wm8993 *wm8993 = &wm8993_modules;
#ifdef WM8993_CHECK_RESET
if (atomic_read(&wm8993->isreset) == 0)
{
atomic_set(&wm8993->isreset, 1);
wm8993_write(WM8993_RESET_REG, WM8993_RESET_VALUE);
msleep(1);
}
#else
wm8993_write(WM8993_RESET_REG, WM8993_RESET_VALUE);
msleep(1);
#endif /*WM8993_CHECK_RESET*/
APM_INFO("========== WM8993 RESET ==========\n");
#endif
}
EXPORT_SYMBOL(wm8993_reset);
/* WM8993 I2C Driver */
/**
* wm8993_write - Sets register in WM8993
* @param wm8993: wm8993 structure pointer passed by client
* @param reg: register address
* @param value: buffer values to be written
* @param num_bytes: n bytes to write
*
* @returns result of the operation.
*/
int wm8993_write(u8 reg, unsigned short value)
{
int rc, retry;
unsigned char buf[3];
struct i2c_msg msg[2];
struct snddev_wm8993 *wm8993;
wm8993 = &wm8993_modules;
mutex_lock(&wm8993->xfer_lock);
memset(buf, 0x00, sizeof(buf));
buf[0] = (reg & 0x00FF);
buf[1] = (value & 0xFF00)>>8;
buf[2] = (value & 0x00FF);
msg[0].addr = wm8993->client->addr;
msg[0].flags = 0;
msg[0].len = 3;
msg[0].buf = buf;
for (retry = 0; retry <= 2; retry++)
{
rc = i2c_transfer(wm8993->client->adapter, msg, 1);
if(rc > 0)
{
break;
}
else
{
pr_err("wm8993 i2c write failed. [%d], addr = 0x%x, val = 0x%x\n", retry, reg, value);
msleep(10);
}
}
mutex_unlock(&wm8993->xfer_lock);
return rc;
}
/**
* wm8993_read - Reads registers in WM8993
* @param wm8993: wm8993 structure pointer passed by client
* @param reg: register address
* @param value: i2c read of the register to be stored
* @param num_bytes: n bytes to read.
* @param mask: bit mask concerning its register
*
* @returns result of the operation.
*/
int wm8993_read(u8 reg, unsigned short *value)
{
int rc, retry;
struct i2c_msg msg[2];
struct snddev_wm8993 *wm8993;
wm8993 = &wm8993_modules;
mutex_lock(&wm8993->xfer_lock);
value[0] = (reg & 0x00FF);
msg[0].addr = wm8993->client->addr;
msg[0].flags = 0;
msg[0].len = 1;
msg[0].buf = (u8*)value;
msg[1].addr = wm8993->client->addr;
msg[1].flags = I2C_M_RD;
msg[1].len = 2;
msg[1].buf = (u8*)value;
for (retry = 0; retry <= 2; retry++)
{
rc = i2c_transfer(wm8993->client->adapter, msg, 2);
if(rc > 0)
{
break;
}
else
{
pr_err("wm8993 i2c read failed. [%d], addr=0x%x, val=0x%x\n", retry, reg, *value);
msleep(10);
}
}
*value = ((*value) >> 8 ) | (((*value) & 0x00FF) << 8); // switch MSB , LSB
mutex_unlock(&wm8993->xfer_lock);
return rc;
}
int wm8993_update(unsigned short reg, unsigned short mask, unsigned short value)
{
short change;
unsigned short old, new;
int ret;
ret = wm8993_read(reg, & old);
if (ret < 0)
return ret;
new = (old & ~mask) | value;
change = old != new;
if (change) {
ret = wm8993_write(reg, new);
if (ret < 0)
return ret;
}
return change;
}
static long wm8993_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct snddev_wm8993 *wm8993 = file->private_data;
int rc = 0;
pr_debug("%s\n", __func__);
switch (cmd) {
case AUDIO_START:
{
APM_INFO("AUDIO_START\n");
<API key>();
}
break;
case AUDIO_STOP:
{
APM_INFO("AUDIO_STOP\n");
<API key>();
}
break;
case AUDIO_SET_CONFIG:
{
struct msm_audio_config config;
if (copy_from_user(&config, (void *) arg, sizeof(config))) {
rc = -EFAULT;
break;
}
APM_INFO("AUDIO_SET_CONFIG : Type %d\n", config.type);
mutex_lock(&wm8993->lock);
if (config.type == 0) {
wm8993->noisegate_enabled = config.channel_count;
APM_INFO("Unsupporte Type. Set Noisegate %s\n",
wm8993->noisegate_enabled ? "ON" : "OFF");
} else if (config.type == 1) {
wm8993->cal_type = config.channel_count;;
APM_INFO("Set Calibration type = %d\n", wm8993->cal_type);
if(wm8993->cal_type == 0) {
wm8993_set_caltype(AMP_CAL_NORMAL);
} else if(wm8993->cal_type == 1) {
wm8993_set_caltype(AMP_CAL_VOICECALL);
} else if(wm8993->cal_type == 2) {
wm8993_set_caltype(AMP_CAL_VIDEOCALL);
} else if(wm8993->cal_type == 3) {
wm8993_set_caltype(AMP_CAL_VOIPCALL);
} else if(wm8993->cal_type == 4) {
wm8993_set_caltype(AMP_CAL_LOOPBACK);
} else {
wm8993_set_caltype(AMP_CAL_NORMAL);
}
} else if (config.type == 2) {
wm8993->spksw_enabled = config.channel_count;
APM_INFO("Set Speaker Switch %s\n",
wm8993->spksw_enabled ? "ON" : "OFF");
APM_INFO("Current Device = %d, Speaker Switch State = %d\n",
m_curr_path, gpio_get_value(WM8993_SPK_SW_GPIO));
if (m_curr_path > AMP_PATH_NONE && m_curr_path < AMP_PATH_MAINMIC) // RX Devices
{
if (wm8993->spksw_enabled == 1)
{
if (m_curr_path == AMP_PATH_HANDSET)
{
if (gpio_get_value(WM8993_SPK_SW_GPIO) != 1)
{
APM_INFO("Current Path = %d -> Disable Speaker Switch\n",
m_curr_path);
gpio_set_value(WM8993_SPK_SW_GPIO, 1);
}
}
else
{
if (gpio_get_value(WM8993_SPK_SW_GPIO) != 0)
{
APM_INFO("Current Path = %d -> Enable Speaker Switch\n",
m_curr_path);
gpio_set_value(WM8993_SPK_SW_GPIO, 0);
}
}
}
else
{
if (m_curr_path != AMP_PATH_HANDSET)
{
if (gpio_get_value(WM8993_SPK_SW_GPIO) != 1)
{
APM_INFO("Current Path = %d -> Disable Speaker Switch\n",
m_curr_path);
gpio_set_value(WM8993_SPK_SW_GPIO, 1);
}
}
}
}
}
mutex_unlock(&wm8993->lock);
}
break;
case AUDIO_GET_CONFIG:
{
struct msm_audio_config config;
pr_debug("%s: AUDIO_GET_CONFIG\n", __func__);
memset(&config, 0x00, sizeof(struct msm_audio_config));
config.buffer_size = wm8993->noisegate_enabled; // Noisegate
config.buffer_count = wm8993->cal_type; // Cal Type
config.channel_count = wm8993->spksw_enabled; // Speaker Switch
config.sample_rate = (uint32_t)atomic_read(&wm8993->amp_enabled); // Amp State
config.type = (uint32_t)atomic_read(&wm8993->isreset); // Reset State
if (copy_to_user((void *) arg, &config, sizeof(config)))
rc = -EFAULT;
}
break;
case AUDIO_SET_EQ:
{
struct msm_audio_config config;
pr_debug("%s: AUDIO_SET_CONFIG\n", __func__);
if (copy_from_user(&config, (void *) arg, sizeof(config))) {
rc = -EFAULT;
break;
}
mutex_lock(&wm8993->lock);
wm8993->eq_type = config.type;
mutex_unlock(&wm8993->lock);
APM_INFO("Set EQ type = %d\n", wm8993->eq_type);
}
break;
case AUDIO_SET_MUTE:
{
struct msm_audio_config config;
pr_debug("%s: AUDIO_SET_MUTE\n", __func__);
if (copy_from_user(&config, (void *) arg, sizeof(config))) {
rc = -EFAULT;
break;
}
mutex_lock(&wm8993->lock);
wm8993->mute_enabled = config.type;
mutex_unlock(&wm8993->lock);
APM_INFO("Set Mute type = %d\n", wm8993->mute_enabled);
#if 0 // alsa api
if(wm8993->mute_enabled == 1)
<API key>(1);
else
<API key>(0);
#else
// TODO: Set WM8993 Mute Register
#endif
}
break;
case AUDIO_SET_VOLUME:
{
struct msm_audio_config config;
APM_INFO("AUDIO_SET_VOLUME\n");
if (copy_from_user(&config, (void *) arg, sizeof(config))) {
rc = -EFAULT;
break;
}
mutex_lock(&wm8993->lock);
wm8993->voip_micgain = config.type;
mutex_unlock(&wm8993->lock);
APM_INFO("Set Voip Mic Gain type = %d\n", wm8993->voip_micgain);
#if 0 // alsa api
if(wm8993->voip_micgain > 0)
<API key>(wm8993->voip_micgain);
#else
// TODO: Set WM8993 Volume Register
#endif
}
break;
default:
rc = -EINVAL;
break;
}
return rc;
}
static int wm8993_open(struct inode *inode, struct file *file)
{
pr_debug("%s\n", __func__);
file->private_data = &wm8993_modules;
return 0;
}
static int wm8993_release(struct inode *inode, struct file *file)
{
pr_debug("%s\n", __func__);
return 0;
}
static struct file_operations wm8993_dev_fops = {
.owner = THIS_MODULE,
.open = wm8993_open,
.release = wm8993_release,
.unlocked_ioctl = wm8993_ioctl,
};
struct miscdevice <API key> = {
.minor = MISC_DYNAMIC_MINOR,
.name = "snddev_wm8993",
.fops = &wm8993_dev_fops,
};
static int wm8993_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct <API key> *pdata = client->dev.platform_data;
struct snddev_wm8993 *wm8993;
int status;
pr_debug("%s\n", __func__);
if (<API key>(client->adapter, I2C_FUNC_I2C) == 0)
{
dev_err(&client->dev, "can't talk I2C?\n");
return -ENODEV;
}
if (pdata->wm8993_setup != NULL)
{
status = pdata->wm8993_setup(&client->dev);
if (status < 0)
{
pr_err("wm8993_probe: wm8993 setup power failed\n");
return status;
}
}
wm8993 = &wm8993_modules;
wm8993->client = client;
strlcpy(wm8993->client->name, id->name, sizeof(wm8993->client->name));
mutex_init(&wm8993->xfer_lock);
mutex_init(&wm8993->path_lock);
mutex_init(&wm8993->lock);
wm8993->cal_type = 0;
wm8993->eq_type = 0;
wm8993->mute_enabled = 0;
wm8993->voip_micgain = 0;
wm8993->noisegate_enabled = 1; // Only YDA165
wm8993->spksw_enabled = 0;
#ifdef WM8993_CHECK_RESET
atomic_set(&wm8993->isreset, 0);
#endif /*WM8993_CHECK_RESET*/
#ifdef <API key>
atomic_set(&wm8993->amp_enabled, 0);
#endif /*<API key>*/
wm8993->suspend_poweroff = 0;
#ifndef WM8993_SINGLE_PATH // 20110510 by ssgun
cur_tx = 0;
cur_rx = 0;
#endif /*WM8993_SINGLE_PATH*/
status = misc_register(&<API key>);
if (status)
{
pr_err("wm8993_probe: <API key> register failed\n");
return status;
}
#if 0 // 20110305 by ssgun - test code
add_child(0x1A, "wm8993_codec", id->driver_data, NULL, 0);
#endif
#ifdef <API key>
<API key>(<API key>);
#endif
return 0;
}
#ifdef CONFIG_PM
static int wm8993_suspend(struct i2c_client *client, pm_message_t mesg)
{
if (m_curr_path == AMP_PATH_NONE)
{
struct <API key> *pdata;
struct snddev_wm8993 *wm8993;
pdata = client->dev.platform_data;
wm8993 = &wm8993_modules;
if (pdata->wm8993_shutdown != NULL)
{
#ifdef <API key>
<API key>(<API key>);
#endif
pdata->wm8993_shutdown(&client->dev);
wm8993->suspend_poweroff = 1;
APM_INFO("Current Path : %d\n", m_curr_path);
}
}
return 0;
}
static int wm8993_resume(struct i2c_client *client)
{
struct <API key> *pdata;
struct snddev_wm8993 *wm8993;
int status;
wm8993 = &wm8993_modules;
if (wm8993->suspend_poweroff == 1)
{
pdata = client->dev.platform_data;
if (pdata->wm8993_setup != NULL)
{
status = pdata->wm8993_setup(&client->dev);
if (status < 0)
{
pr_err("%s : %d, fail PowerOn = %d\n", __func__, m_curr_path, status);
return status;
}
wm8993->suspend_poweroff = 0;
APM_INFO("Current Path : %d\n", m_curr_path);
#ifdef <API key>
<API key>(<API key>);
#endif
}
}
return 0;
}
#endif
static int __devexit wm8993_remove(struct i2c_client *client)
{
struct <API key> *pdata;
pr_debug("%s\n", __func__);
pdata = client->dev.platform_data;
<API key>(wm8993_modules.client);
wm8993_modules.client = NULL;
if (pdata->wm8993_shutdown != NULL)
pdata->wm8993_shutdown(&client->dev);
misc_deregister(&<API key>);
return 0;
}
static struct i2c_device_id wm8993_id_table[] = {
{"wm8993", 0x0},
{}
};
MODULE_DEVICE_TABLE(i2c, wm8993_id_table);
static struct i2c_driver wm8993_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "wm8993",
},
.id_table = wm8993_id_table,
.probe = wm8993_probe,
#ifdef CONFIG_PM
.suspend = wm8993_suspend,
.resume = wm8993_resume,
#endif
.remove = __devexit_p(wm8993_remove),
};
#if 0 // 20110416 by ssgun - GPIO_CFG_NO_PULL -> GPIO_CFG_PULL_DOWN
#define SPK_SW_CTRL_0 \
GPIO_CFG(WM8993_SPK_SW_GPIO, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA)
#else
#define SPK_SW_CTRL_0 \
GPIO_CFG(WM8993_SPK_SW_GPIO, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
#endif
static int __init wm8993_codec_init(void)
{
int rc;
pr_debug("%s\n", __func__);
rc = gpio_tlmm_config(SPK_SW_CTRL_0, GPIO_CFG_ENABLE);
if (rc)
{
pr_err("%s] gpio config failed: %d\n", __func__, rc);
goto fail;
}
rc = i2c_add_driver(&wm8993_driver);
return rc;
fail:
return -ENODEV;
}
module_init(wm8993_codec_init);
static void __exit wm8993_codec_exit(void)
{
pr_debug("%s\n", __func__);
i2c_del_driver(&wm8993_driver);
}
module_exit(wm8993_codec_exit);
MODULE_DESCRIPTION("KTTECH's WM8993 Codec Sound Device driver");
MODULE_VERSION("1.0");
MODULE_AUTHOR("Gun Song <ssgun@kttech.co.kr>"); |
#ifndef <API key>
#define <API key>
#ifndef __ASM__
#include <sys/types.h>
/* For a.out kernel boot images, the following header must appear
somewhere in the first 8192 bytes of the kernel image file. */
struct multiboot_header
{
/* Must be MULTIBOOT_MAGIC */
uint magic;
/* Feature flags - see below. */
uint flags;
/*
* Checksum
*
* The above fields plus this one must equal 0 mod 2^32.
*/
uint checksum;
/* These are only valid if <API key> is set. */
ulong header_addr;
ulong load_addr;
ulong load_end_addr;
ulong bss_end_addr;
ulong entry;
};
#endif /* !__ASM__ */
/* The entire multiboot_header must be contained
within the first MULTIBOOT_SEARCH bytes of the kernel image. */
#define MULTIBOOT_SEARCH 8192
/* Magic value identifying the multiboot_header. */
#define MULTIBOOT_MAGIC 0x1badb002
/* Features flags for 'flags'.
If a boot loader sees a flag in MULTIBOOT_MUSTKNOW set
and it doesn't understand it, it must fail. */
#define MULTIBOOT_MUSTKNOW 0x0000ffff
/* Align all boot modules on page (4KB) boundaries. */
#define <API key> 0x00000001
/* Must be provided memory information in multiboot_info structure */
#define <API key> 0x00000002
/* Use the load address fields above instead of the ones in the a.out header
to figure out what to load where, and what to do afterwards.
This should only be needed for a.out kernel images
(ELF and other formats can generally provide the needed information). */
#define <API key> 0x00010000
/* The boot loader passes this value in register EAX to signal the kernel
that the multiboot method is being used */
#define MULTIBOOT_VALID 0x2badb002
#ifndef __ASM__
/* The boot loader passes this data structure to the kernel in
register EBX on entry. */
struct multiboot_info
{
/* These flags indicate which parts of the multiboot_info are valid;
see below for the actual flag bit definitions. */
unsigned flags;
/* Lower/Upper memory installed in the machine.
Valid only if MULTIBOOT_MEMORY is set in flags word above. */
ulong mem_lower;
ulong mem_upper;
/* BIOS disk device the kernel was loaded from.
Valid only if <API key> is set in flags word above. */
uchar boot_device[4];
/* Command-line for the OS kernel: a null-terminated ASCII string.
Valid only if MULTIBOOT_CMDLINE is set in flags word above. */
ulong cmdline;
/* List of boot modules loaded with the kernel.
Valid only if MULTIBOOT_MODS is set in flags word above. */
uint mods_count;
ulong mods_addr;
/* Symbol information for a.out or ELF executables. */
union
{
struct
{
/* a.out symbol information valid only if MULTIBOOT_AOUT_SYMS
is set in flags word above. */
ulong tabsize;
ulong strsize;
ulong addr;
uint reserved;
} a;
struct
{
/* ELF section header information valid only if
MULTIBOOT_ELF_SHDR is set in flags word above. */
uint num;
ulong size;
ulong addr;
uint shndx;
} e;
} syms;
/* Memory map buffer.
Valid only if MULTIBOOT_MEM_MAP is set in flags word above. */
ulong mmap_count;
ulong mmap_addr;
};
#endif /* !__ASM__ */
#define MULTIBOOT_MEMORY 0x00000001
#define <API key> 0x00000002
#define MULTIBOOT_CMDLINE 0x00000004
#define MULTIBOOT_MODS 0x00000008
#define MULTIBOOT_AOUT_SYMS 0x00000010
#define MULTIBOOT_ELF_SHDR 0x00000020
#define MULTIBOOT_MEM_MAP 0x00000040
#ifndef __ASM__
/* The mods_addr field above contains the physical address of the first
of 'mods_count' multiboot_module structures. */
struct multiboot_module
{
/* Physical start and end addresses of the module data itself. */
ulong mod_start;
ulong mod_end;
/* Arbitrary ASCII string associated with the module. */
ulong string;
/* Boot loader must set to 0; OS must ignore. */
uint reserved;
};
/* The mmap_addr field above contains the physical address of the first
of the AddrRangeDesc structure. "size" represents the size of the
rest of the structure and optional padding. The offset to the beginning
of the next structure is therefore "size + 4". */
struct AddrRangeDesc
{
ulong size;
ulong BaseAddrLow;
ulong BaseAddrHigh;
ulong LengthLow;
ulong LengthHigh;
ulong Type;
/* unspecified optional padding... */
};
#endif /* !__ASM__ */
/* usable memory "Type", all others are reserved. */
#define MB_ARD_MEMORY 1
#endif <API key> |
<!doctype html>
<html>
<head>
<title>iOS7</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<!--democss begin
<link rel="stylesheet" type="text/css" href="../../../assets/reset.css" />
<!--democss end
<!--css begin
<link rel="stylesheet" type="text/css" href="../../../assets/widget/progressbar/progressbar.css" />
<link rel="stylesheet" type="text/css" href="../../../assets/widget/progressbar/progressbar.iOS7.css" />
<!--css end
<!--js begin
<script type="text/javascript" src="../../../dist/zepto.js"></script>
<script type="text/javascript" src="../../../src/extend/touch.js"></script>
<script type="text/javascript" src="../../../src/core/gmu.js"></script>
<script type="text/javascript" src="../../../src/core/event.js"></script>
<script type="text/javascript" src="../../../src/core/widget.js"></script>
<script type="text/javascript" src="../../../src/widget/progressbar/progressbar.js"></script>
<!--js end
<style type="text/css">
body {
padding: 10px;
background-color: #F9F9F9;
}
#progressbar-1 {
width:250px;
margin:30px 10px;
}
#progressbar-2 {
height: 200px;
margin: 40px;
}
input {
line-height: 30px;
color: #0079FF;
border: 1px solid #E1E1E1;
border-radius: 5px;
padding: 0 3px;
}
#set_val-1,
#set_val-2 {
background-color: #0079FF;
border: none;
color: #FFF;
width: 100px;
height: 30px;
border-radius: 5px;
}
</style>
</head>
<body>
<h3></h3>
<div id="progressbar-1"></div>
<input id="cur_val-1"/>
<button id="set_val-1">Set</button>
<br /><br />
<h3></h3>
<div id="progressbar-2"></div>
<input id="cur_val-2"/>
<button id="set_val-2">Set</button>
<script>
$('#progressbar-1').progressbar({
valueChange: function() {
$('#cur_val-1').val(this.value());
}
});
$('#set_val-1').click(function() {
$('#progressbar-1').progressbar('value', $('#cur_val-1').val());
});
$('#progressbar-2').progressbar({
horizontal: false,
valueChange: function() {
$('#cur_val-2').val(this.value());
}
});
$('#set_val-2').click(function() {
$('#progressbar-2').progressbar('value', $('#cur_val-2').val());
});
</script>
</body>
</html> |
#include "KoTextDrag.h"
#include <QBuffer>
#include <QByteArray>
#include <QMimeData>
#include <QString>
#include <KoStore.h>
#include <KoGenStyles.h>
#include <KoGenChanges.h>
#include <KoOdfWriteStore.h>
#include <KoXmlWriter.h>
#include <KoDocumentBase.h>
#include <<API key>.h>
#include "<API key>.h"
#include "KoStyleManager.h"
#include <opendocument/<API key>.h>
#include "KoTextOdfSaveHelper.h"
#ifdef SHOULD_BUILD_RDF
#include "KoTextRdfCore.h"
#endif
#include "TextDebug.h"
KoTextDrag::KoTextDrag()
: m_mimeData(0)
{
}
KoTextDrag::~KoTextDrag()
{
if (m_mimeData == 0) {
delete m_mimeData;
}
}
bool KoTextDrag::setOdf(const char * mimeType, KoTextOdfSaveHelper &helper)
{
QBuffer buffer;
QScopedPointer<KoStore> store(KoStore::createStore(&buffer, KoStore::Write, mimeType));
Q_ASSERT(store);
Q_ASSERT(!store->bad());
KoOdfWriteStore odfStore(store.data());
<API key> embeddedSaver;
KoXmlWriter* manifestWriter = odfStore.manifestWriter(mimeType);
KoXmlWriter* contentWriter = odfStore.contentWriter();
if (!contentWriter) {
return false;
}
KoGenStyles mainStyles;
KoXmlWriter *bodyWriter = odfStore.bodyWriter();
<API key> * context = helper.context(bodyWriter, mainStyles, embeddedSaver);
KoGenChanges changes;
KoSharedSavingData *sharedData = context->sharedData(<API key>);
<API key> *textSharedData = 0;
if (sharedData) {
textSharedData = dynamic_cast<<API key> *>(sharedData);
}
if (!textSharedData) {
textSharedData = new <API key>();
textSharedData->setGenChanges(changes);
if (!sharedData) {
context->addSharedData(<API key>, textSharedData);
} else {
warnText << "A different type of sharedData was found under the" << <API key>;
Q_ASSERT(false);
}
}
#ifdef SHOULD_BUILD_RDF
debugText << "helper.model:" << helper.rdfModel();
textSharedData->setRdfModel(helper.rdfModel());
#endif
if (!helper.writeBody()) {
return false;
}
// Save the named styles that was referred to by the copied text
if (KoStyleManager *styleManager = helper.styleManager()) {
styleManager-><API key>(*context);
}
mainStyles.saveOdfStyles(KoGenStyles::<API key>, contentWriter);
changes.saveOdfChanges(contentWriter, false);
odfStore.closeContentWriter();
//add manifest line for content.xml
manifestWriter->addManifestEntry("content.xml", "text/xml");
debugText << "testing to see if we should add rdf to odf file?";
#ifdef SHOULD_BUILD_RDF
debugText << "helper has model" << ( helper.rdfModel() != 0 );
// RDF: Copy relevant RDF to output ODF
if (QSharedPointer<Soprano::Model> m = helper.rdfModel()) {
debugText << "rdf model size:" << m->statementCount();
KoTextRdfCore::<API key>(m, textSharedData->getRdfIdMapping(),
store.data(), manifestWriter);
}
#endif
if (!mainStyles.saveOdfStylesDotXml(store.data(), manifestWriter)) {
return false;
}
if (!context->saveDataCenter(store.data(), manifestWriter)) {
debugText << "save data centers failed";
return false;
}
// Save embedded objects
KoDocumentBase::SavingContext documentContext(odfStore, embeddedSaver);
if (!embeddedSaver.<API key>(documentContext)) {
debugText << "save embedded documents failed";
return false;
}
// Write out manifest file
if (!odfStore.closeManifestWriter()) {
return false;
}
store.reset();
setData(mimeType, buffer.buffer());
return true;
}
void KoTextDrag::setData(const QString & mimeType, const QByteArray & data)
{
if (m_mimeData == 0) {
m_mimeData = new QMimeData();
}
m_mimeData->setData(mimeType, data);
}
QMimeData * KoTextDrag::takeMimeData()
{
QMimeData * mimeData = m_mimeData;
m_mimeData = 0;
return mimeData;
} |
<?php
// no direct access
defined('_JEXEC') or die;
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
// Define
define('AKQUICKICONS_SITE' , <API key> );
define('AKQUICKICONS_ADMIN', <API key>);
define('AKQUICKICONS_SELF' , JPATH_COMPONENT);
// Include Helpers
// Core init, it can use by module, plugin or other component.
include_once JPath::clean( JPATH_ADMINISTRATOR . "/components/com_akquickicons/includes/core.php" ) ;
// Set default option to path helper, then AKHelperPath will helpe us get admin path.
AKHelper::_('path.setOption', 'com_akquickicons') ;
// Some useful settings
if( $app->isSite() ){
// Include Admin language as global language.
$lang->load('', JPATH_ADMINISTRATOR);
$lang->load('com_akquickicons', <API key> );
AkquickiconsHelper::_('lang.loadAll', $lang->getTag());
// Include Joomla! admin css
AkquickiconsHelper::_('include.sortedStyle', 'includes/css');
// set Base to fix toolbar anchor bug
$doc->setBase( JFactory::getURI()->toString() );
}else{
AkquickiconsHelper::_('lang.loadAll', $lang->getTag());
AkquickiconsHelper::_('include.sortedStyle', 'includes/css');
}
// Detect version
AkquickiconsHelper::_('plugin.attachPlugins');
// Debug
define('AKDEBUG', AkquickiconsHelper::_('system.getConfig', 'system.debug')) ;
// Panel
AkquickiconsHelper::_('panel.setLegacy', true) ; |
<?php
global $<API key>;
global $<API key>;
global $<API key>;
global $<API key>;
global $<API key>;
?>
<?php if ( have_posts( ) ) : while ( have_posts( ) ) : the_post( ); ?>
<div <?php post_class( $<API key> );?>>
<p class="post-date">
<a class="date-permalink" href="<?php the_permalink( ); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute( ); ?>">
<span class="post-month"><?php the_time( 'M' );?></span>
<span class="post-day"><?php the_time( 'j' );?></span>
<span class="post-year"><?php the_time( 'Y' );?></span>
</a>
</p>
<h1 class="post-title index"><?php the_title_attribute( );?></h1>
<p class="post-info-top">
<span class="by">By</span> <span class="post-author"><?php the_author( );?></span>
<?php
$comment_count = get_comment_count( $post->ID );
if ( ! <API key>() ) {
echo '<span class="meta-info">';
// If there are no comments and comments are closed then display 0 comments (unlinked)
if ( ( ! comments_open( ) ) && ( $comment_count['approved'] == 0 ) ) echo '<span class="number-of-comments">0 comments</span>';
// If there are no comments and comments are open then display 0 comments (linked)
if ( ( comments_open( ) ) && ( $comment_count['approved'] == 0 ) ) { ?>
<span class="number-of-comments">
<a href="<?php the_permalink( ); ?>#respond" class="comment-link" title="Permanent Link to <?php the_title_attribute( ); ?>">0 comments</a>
</span>
<?php }
// If there are comments then show the number of comments (linked)
comments_popup_link( ' ', '1 Comment ', '% Comments ', 'comment-link', ' ' );
// If comments are closed then link to the closed comments
if ( ! comments_open( ) ) { ?>
<span class="comments-closed">
<a href="<?php the_permalink( ); ?>#comments" class="comments-closed" title="Permanent Link to <?php the_title_attribute( ); ?>">(comments closed)</a>
</span>
<?php }
echo ' </span><!--Close meta-info
} // End if ( ! <API key>() )
?>
</p>
<div class="entry chat">
<?php the_content( ); ?>
</div> <!--Close entry
<?php if (has_category()) { ?>
<p class="<API key>">Categories: <span class="categories"> <?php the_category( ', ' ) ?> </span></p>
<?php } // Displays the above if there are taxonomies. There is no has_tax ?>
<?php if (has_tag()) { ?>
<p class="<API key>">Tags: <span class="tags"> <?php the_tags( '',', ', '' ) ?> </span></p>
<?php }
<?php get_template_part( '<API key>' ); ?>
<?php
$<API key> = array(
'before' => '<div class="post-links"><p class="post-links">',
'after' => '</p></div>',
'link_before' => '<span class="post-links">',
'link_after' => '</span>',
'next_or_number' => 'number',
'nextpagelink' => 'Next page',
'previouspagelink' => 'Previous page',
'pagelink' => '%',
'more_file' => '' ,
'echo' => 1 );
wp_link_pages( $<API key> );
?>
<?php edit_post_link( 'Edit this post', '<p class="edit-post">', '</p>' ); ?>
</div><!--Close post htentry etc.
<?php endwhile; ?>
<div class="<API key>">
<p class="single-left"> <?php previous_post_link( '« %link' ); ?></p><!--Close single-left
<p class="single-right"><?php next_post_link( ' %link »' ); ?></p><!--Close single-right
</div><!--Close <API key>
<?php comments_template( '', true ); ?>
<?php else : ?>
<?php get_search_form( ); ?>
<?php endif; ?>
<?php wp_reset_query( );?> |
<?php
require_once(APPPATH.'hooks/cloudflare/ip_in_range.php');
function fix_cf_ip()
{
if ( ! isset($_SERVER['<API key>']))
return;
if (strpos($_SERVER['REMOTE_ADDR'], ':') === FALSE)
{
$cf_ip_ranges = array("204.93.240.0/24","204.93.177.0/24","199.27.128.0/21","173.245.48.0/20","103.21.244.0/22","103.22.200.0/22","103.31.4.0/22","141.101.64.0/18","108.162.192.0/18","190.93.240.0/20","188.114.96.0/20","197.234.240.0/22","198.41.128.0/17","162.158.0.0/15");
foreach ($cf_ip_ranges as $range) {
if (ipv4_in_range($_SERVER['REMOTE_ADDR'], $range)) {
$_SERVER['REMOTE_ADDR_CF'] = $_SERVER['REMOTE_ADDR'];
$_SERVER['REMOTE_ADDR'] = $_SERVER['<API key>'];
break;
}
}
}
else
{
$cf_ip_ranges = array("2400:cb00::/32","2606:4700::/32","2803:f800::/32","2405:b500::/32","2405:8100::/32");
$ipv6 = get_ipv6_full($_SERVER['REMOTE_ADDR']);
foreach ($cf_ip_ranges as $range) {
if (ipv6_in_range($ipv6, $range)) {
$_SERVER['REMOTE_ADDR_CF'] = $_SERVER['REMOTE_ADDR'];
$_SERVER['REMOTE_ADDR'] = $_SERVER['<API key>'];
break;
}
}
}
} |
using System;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Security;
using System.Windows.Forms;
using Rapr.Lang;
namespace Rapr
{
public static class Program
{
private static Assembly ResolveEventHandler(object sender, ResolveEventArgs args)
{
Assembly assembly = Assembly.GetEntryAssembly();
string resourceName = $"{assembly.EntryPoint.DeclaringType.Namespace}.{new AssemblyName(args.Name).Name}.dll";
using (var stream = assembly.<API key>(resourceName))
{
if (stream == null)
{
return null;
}
byte[] assemblyData = new byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
return Assembly.Load(assemblyData);
}
}
private static void AddEnvironmentPaths(string path)
{
var paths = new[] { Environment.<API key>("PATH") ?? string.Empty, path };
string newPath = string.Join(Path.PathSeparator.ToString(), paths);
Environment.<API key>("PATH", newPath);
}
private static void CleanUpOldConfig()
{
FileInfo fileInfo = new FileInfo(<API key>.<API key>(<API key>.<API key>).FilePath);
DirectoryInfo <API key> = fileInfo.Directory.Parent;
// Remove old version of config.
foreach (var dir in <API key>.<API key>("*", SearchOption.TopDirectoryOnly))
{
if (Version.TryParse(dir.Name, out Version version) && version < Assembly.<API key>().GetName().Version)
{
dir.Delete(recursive: true);
}
}
DirectoryInfo configDirectory = <API key>.Parent;
foreach (var dir in configDirectory.<API key>(Assembly.GetEntryAssembly().ManifestModule.Name + "_Url_*", SearchOption.TopDirectoryOnly))
{
dir.Delete(recursive: true);
}
}
<summary>
The main entry point for the application.
</summary>
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.<API key>(false);
Trace.AutoFlush = true;
Trace.IndentSize = 4;
Trace.Listeners.Add(new <API key>());
AddEnvironmentPaths(@"C:\Windows\System32\CompatTel");
AppDomain.CurrentDomain.AssemblyResolve += ResolveEventHandler;
try
{
if (Properties.Settings.Default.UpgradeRequired)
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.UpgradeRequired = false;
Properties.Settings.Default.Save();
try
{
CleanUpOldConfig();
}
catch (Exception e) when (
e is SecurityException
|| e is IOException)
{
Trace.TraceError(e.ToString());
}
}
using (DSEForm mainForm = new DSEForm())
{
Application.Run(mainForm);
}
}
catch (<API key> e)
{
Trace.TraceError(e.ToString());
MessageBox.Show(
e.Message,
Language.Product_Name,
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
}
} |
<?php
defined ('_JEXEC') or die ('Restricted access');
class modSimCateHelper
{
var $_pagination = null;
var $_limit = null;
var $_limitstart = null;
function __construct(){
//$pageNum = JRequest::getInt("page");
//$this->_limitstart = ($pageNum) ? ($pageNum - 1)*18 : 0;
$this->_limitstart = JRequest::getInt("limitstart");
$this->_limit = 18;
$mainframe = &JFactory::getApplication();
$context = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
}
function getSim()
{
$db= &JFactory::getDBO();
$_limitstart = $this->_limitstart;
$_limit = $this->_limit;
$query ="SELECT a.*,b.provider_name
FROM #__sim a,#__sim_provider b
WHERE a.provider_id = b.provider_id
ORDER BY a.price desc LIMIT $_limitstart,$_limit";
$db->setQuery($query);
$rows = $db->LoadObjectList();
return $rows;
}
function getTotalSim()
{
$db= &JFactory::getDBO();
$query ="SELECT count(*) as total
FROM #__sim a,#__sim_provider b
WHERE a.provider_id = b.provider_id";
$db->setQuery($query);
$row = $db->LoadObject();
return $row;
}
public function getPagination(){
$_limitstart = $this->_limitstart;
$_limit = $this->_limit;
if (empty($this->_pagination))
{
jimport('joomla.html.pagination');
$this->_pagination = new JPagination( $this->getTotalSim()->total, $_limitstart, $_limit );
}
return $this->_pagination;
}
function getCategoryName(&$params)
{
$db= &JFactory::getDBO();
$query ="select a.categori_name from #__sim_categories a where a.del_flag=0 and a.categori_id =".$params->get('id');
$db->setQuery($query);
$categoriname = $db->loadResult();
if ($db->getErrorNum())
{
echo $db->stderr();
return false;
}
return $categoriname;
}
function thousandseperate($value)
{
$thausandSepCh = ".";
$realValue = $value."";
$result = "";
$len = strlen($realValue);
while($len>3){
$result = $thausandSepCh.substr($realValue,$len-3,3).$result;
$len=$len-3;
}
$result=substr($realValue,0,$len).$result;
return $result;
}
}
?> |
<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
?>
<?php
//s:foreach
$i = 0;
foreach( $friends as $id )
{
$user = CFactory::getUser( $id );
$invited = in_array( $user->id , $selected );
?>
<li id="invitation-friend-<?php echo $user->id;?>">
<div class="invitation-wrap clrfix">
<img class="invitation-avatar" src="<?php echo addslashes($user->getThumbAvatar());?>">
<div class="invitation-detail">
<div class="invitation-name"><?php echo $user->getDisplayName();?></div>
<?php
if(!$invited){
?>
<div class="invitation-check">
<input type="checkbox" onclick="joms.invitation.selectMember('#invitation-friend-<?php echo $user->id;?>');" value="<?php echo $user->id;?>" name="friends[]" id="friend-<?php echo $user->id;?>">
<label for="friend-<?php echo $user->id;?>"><?php echo JText::_('<API key>');?></label>
</div>
<?php
} else {
?>
<div><?php echo JText::_('<API key>');?></div>
<?php
}
?>
</div>
</div>
</li>
<?php
}
?> |
/* ScriptData
SDName: Boss_Kaelthas
SD%Complete: 60
SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse
SDCategory: Tempest Keep, The Eye
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "the_eye.h"
#include "WorldPacket.h"
#include "Opcodes.h"
enum eEnums
{
//kael'thas Speech
SAY_INTRO = 0,
SAY_INTRO_CAPERNIAN = 1,
SAY_INTRO_TELONICUS = 2,
SAY_INTRO_THALADRED = 3,
SAY_INTRO_SANGUINAR = 4,
SAY_PHASE2_WEAPON = 5,
SAY_PHASE3_ADVANCE = 6,
SAY_PHASE4_INTRO2 = 7,
SAY_PHASE5_NUTS = 8,
SAY_SLAY = 9,
SAY_MINDCONTROL = 10,
SAY_GRAVITYLAPSE = 11,
SAY_SUMMON_PHOENIX = 12,
SAY_DEATH = 13,
//Thaladred the Darkener speech
SAY_THALADRED_AGGRO = 0,
SAY_THALADRED_DEATH = 1,
<API key> = 2,
//Lord Sanguinar speech
SAY_SANGUINAR_AGGRO = 0,
SAY_SANGUINAR_DEATH = 1,
//Grand Astromancer Capernian speech
SAY_CAPERNIAN_AGGRO = 0,
SAY_CAPERNIAN_DEATH = 1,
//Master Engineer Telonicus speech
SAY_TELONICUS_AGGRO = 0,
SAY_TELONICUS_DEATH = 1,
//Phase 2 spells
<API key> = 36976,
<API key> = 36958,
<API key> = 36959,
<API key> = 36960,
<API key> = 36961,
<API key> = 36962,
<API key> = 36963,
<API key> = 36964,
SPELL_RES_VISUAL = 24171,
//Phase 4 spells
SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell
SPELL_PYROBLAST = 36819,
SPELL_FLAME_STRIKE = 36735,
<API key> = 36730,
<API key> = 36731,
<API key> = 36834,
SPELL_SHOCK_BARRIER = 36815,
<API key> = 36723,
SPELL_MIND_CONTROL = 32830,
//Phase 5 spells
SPELL_EXPLODE = 36092,
SPELL_FULLPOWER = 36187,
SPELL_KNOCKBACK = 11027,
SPELL_GRAVITY_LAPSE = 34480,
<API key> = 39432,
SPELL_NETHER_BEAM = 35873,
//Thaladred the Darkener spells
SPELL_PSYCHIC_BLOW = 10689,
SPELL_SILENCE = 30225,
//Lord Sanguinar spells
<API key> = 40636,
//Grand Astromancer Capernian spells
<API key> = 36971,
SPELL_CONFLAGRATION = 37018,
<API key> = 36970,
//Master Engineer Telonicus spells
SPELL_BOMB = 37036,
SPELL_REMOTE_TOY = 37027,
//Nether Vapor spell
SPELL_NETHER_VAPOR = 35859,
//Phoenix spell
SPELL_BURN = 36720,
SPELL_EMBER_BLAST = 34341,
SPELL_REBIRTH = 41587,
//Creature IDs
NPC_PHOENIX = 21362,
NPC_PHOENIX_EGG = 21364,
//Phoenix egg and phoenix model
MODEL_ID_PHOENIX = 19682,
<API key> = 20245,
MAX_ADVISORS = 4
};
uint32 <API key>[]=
{
<API key>, <API key>, <API key>, <API key>,
<API key>, <API key>, <API key>
};
const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target
const float KAEL_VISIBLE_RANGE = 50.0f;
const float afGravityPos[3] = {795.0f, 0.0f, 70.0f};
#define TIME_PHASE_2_3 120000
#define TIME_PHASE_3_4 180000
//Base AI for Advisors
struct advisorbase_ai : public ScriptedAI
{
advisorbase_ai(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
m_bDoubled_Health = false;
}
InstanceScript* instance;
bool FakeDeath;
bool m_bDoubled_Health;
uint32 DelayRes_Timer;
uint64 DelayRes_Target;
void Reset()
{
if (m_bDoubled_Health)
{
me->SetMaxHealth(me->GetMaxHealth() / 2);
m_bDoubled_Health = false;
}
FakeDeath = false;
DelayRes_Timer = 0;
DelayRes_Target = 0;
me->SetStandState(<API key>);
me->SetFlag(UNIT_FIELD_FLAGS, <API key>);
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
//reset encounter
if (instance && (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3))
if (Creature* Kaelthas = Unit::GetCreature(*me, instance->GetData64(DATA_KAELTHAS)))
Kaelthas->AI()->EnterEvadeMode();
}
void MoveInLineOfSight(Unit* who)
{
if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, <API key>))
return;
ScriptedAI::MoveInLineOfSight(who);
}
void AttackStart(Unit* who)
{
if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, <API key>))
return;
ScriptedAI::AttackStart(who);
}
void Revive(Unit* /*Target*/)
{
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
// double health for phase 3
me->SetMaxHealth(me->GetMaxHealth() * 2);
m_bDoubled_Health = true;
me->SetFullHealth();
me->SetStandState(<API key>);
DoCast(me, SPELL_RES_VISUAL, false);
DelayRes_Timer = 2000;
}
void DamageTaken(Unit* killer, uint32 &damage)
{
if (damage < me->GetHealth())
return;
//Prevent glitch if in fake death
if (FakeDeath && instance && instance->GetData(DATA_KAELTHASEVENT) != 0)
{
damage = 0;
return;
}
//Don't really die in phase 1 & 3, only die after that
if (instance && instance->GetData(DATA_KAELTHASEVENT) != 0)
{
//prevent death
damage = 0;
FakeDeath = true;
me-><API key>(false);
me->SetHealth(0);
me->StopMoving();
me-><API key>();
me-><API key>();
me->ModifyAuraState(<API key>, false);
me->ModifyAuraState(<API key>, false);
me->SetFlag(UNIT_FIELD_FLAGS, <API key>);
me->ClearAllReactives();
me->SetTarget(0);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetStandState(<API key>);
JustDied(killer);
}
}
void UpdateAI(uint32 diff)
{
if (DelayRes_Timer)
{
if (DelayRes_Timer <= diff)
{
DelayRes_Timer = 0;
FakeDeath = false;
Unit* Target = Unit::GetUnit(*me, DelayRes_Target);
if (!Target)
Target = me->getVictim();
DoResetThreat();
AttackStart(Target);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveChase(Target);
me->AddThreat(Target, 0.0f);
} else DelayRes_Timer -= diff;
}
}
};
class boss_kaelthas : public CreatureScript
{
public:
boss_kaelthas()
: CreatureScript("boss_kaelthas")
{
}
//Kael'thas AI
struct boss_kaelthasAI : public ScriptedAI
{
boss_kaelthasAI(Creature* creature) : ScriptedAI(creature), summons(me)
{
instance = creature->GetInstanceScript();
memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid));
}
InstanceScript* instance;
uint32 Fireball_Timer;
uint32 <API key>;
uint32 Phoenix_Timer;
uint32 ShockBarrier_Timer;
uint32 GravityLapse_Timer;
uint32 GravityLapse_Phase;
uint32 NetherBeam_Timer;
uint32 NetherVapor_Timer;
uint32 FlameStrike_Timer;
uint32 MindControl_Timer;
uint32 Phase;
uint32 PhaseSubphase; //generic
uint32 Phase_Timer; //generic timer
uint32 PyrosCasted;
bool InGravityLapse;
bool IsCastingFireball;
bool ChainPyros;
SummonList summons;
uint64 m_auiAdvisorGuid[MAX_ADVISORS];
void Reset()
{
Fireball_Timer = 5000+rand()%10000;
<API key> = 45000;
MindControl_Timer = 40000;
Phoenix_Timer = 50000;
ShockBarrier_Timer = 60000;
FlameStrike_Timer = 30000;
GravityLapse_Timer = 20000;
GravityLapse_Phase = 0;
NetherBeam_Timer = 8000;
NetherVapor_Timer = 10000;
PyrosCasted = 0;
Phase = 0;
InGravityLapse = false;
IsCastingFireball = false;
ChainPyros = false;
if (me->isInCombat())
PrepareAdvisors();
summons.DespawnAll();
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
me->SetFlag(UNIT_FIELD_FLAGS, <API key>);
if (instance)
instance->SetData(DATA_KAELTHASEVENT, 0);
}
void PrepareAdvisors()
{
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
if (Creature* creature = Unit::GetCreature(*me, m_auiAdvisorGuid[i]))
{
creature->Respawn();
creature->SetFlag(UNIT_FIELD_FLAGS, <API key>);
creature->setFaction(me->getFaction());
creature->AI()->EnterEvadeMode();
}
}
}
void StartEvent()
{
if (!instance)
return;
m_auiAdvisorGuid[0] = instance->GetData64(<API key>);
m_auiAdvisorGuid[1] = instance->GetData64(DATA_LORDSANGUINAR);
m_auiAdvisorGuid[2] = instance->GetData64(<API key>);
m_auiAdvisorGuid[3] = instance->GetData64(<API key>);
if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3])
{
TC_LOG_ERROR(LOG_FILTER_TSCR, "Kael'Thas One or more advisors missing, Skipping Phases 1-3");
Talk(SAY_PHASE4_INTRO2);
Phase = 4;
instance->SetData(DATA_KAELTHASEVENT, 4);
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
me->SetFlag(UNIT_FIELD_FLAGS, <API key>);
if (Unit* target = SelectTarget(<API key>, 0))
AttackStart(target);
}
else
{
PrepareAdvisors();
Talk(SAY_INTRO);
instance->SetData(DATA_KAELTHASEVENT, 1);
me->SetFlag(UNIT_FIELD_FLAGS, <API key>);
PhaseSubphase = 0;
Phase_Timer = 23000;
Phase = 1;
}
}
void MoveInLineOfSight(Unit* who)
{
if (!me->HasUnitState(UNIT_STATE_STUNNED) && me->canCreatureAttack(who))
{
if (!me->CanFly() && me->GetDistanceZ(who) > <API key>)
return;
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
if (!me->getVictim() && Phase >= 4)
{
who->RemoveAurasByType(<API key>);
AttackStart(who);
}
else if (me->GetMap()->IsDungeon())
{
if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase)
StartEvent();
who->SetInCombatWith(me);
me->AddThreat(who, 0.0f);
}
}
}
}
void EnterCombat(Unit* /*who*/)
{
if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase)
StartEvent();
}
void KilledUnit(Unit* /*victim*/)
{
Talk(SAY_SLAY);
}
void JustSummoned(Creature* summoned)
{
// if not phoenix, then it's one of the 7 weapons
if (summoned->GetEntry() != NPC_PHOENIX)
{
if (Unit* target = SelectTarget(<API key>, 0))
summoned->AI()->AttackStart(target);
summons.Summon(summoned);
}
}
void <API key>(Creature* summon)
{
summons.Despawn(summon);
}
void JustDied(Unit* /*killer*/)
{
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
Talk(SAY_DEATH);
summons.DespawnAll();
if (instance)
instance->SetData(DATA_KAELTHASEVENT, 0);
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
if (Unit* pAdvisor = Unit::GetUnit(*me, m_auiAdvisorGuid[i]))
pAdvisor->Kill(pAdvisor);
}
}
void UpdateAI(uint32 diff)
{
//Phase 1
switch (Phase)
{
case 1:
{
Unit* target = NULL;
Creature* Advisor = NULL;
//Subphase switch
switch (PhaseSubphase)
{
//Subphase 1 - Start
case 0:
if (Phase_Timer <= diff)
{
Talk(SAY_INTRO_THALADRED);
//start advisor within 7 seconds
Phase_Timer = 7000;
++PhaseSubphase;
} else Phase_Timer -= diff;
break;
//Subphase 1 - Unlock advisor
case 1:
if (Phase_Timer <= diff)
{
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[0]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
Advisor->setFaction(me->getFaction());
target = SelectTarget(<API key>, 0);
if (target)
Advisor->AI()->AttackStart(target);
}
++PhaseSubphase;
} else Phase_Timer -= diff;
break;
//Subphase 2 - Start
case 2:
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[0]));
if (Advisor && (Advisor->getStandState() == <API key>))
{
Talk(SAY_INTRO_SANGUINAR);
//start advisor within 12.5 seconds
Phase_Timer = 12500;
++PhaseSubphase;
}
break;
//Subphase 2 - Unlock advisor
case 3:
if (Phase_Timer <= diff)
{
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[1]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
Advisor->setFaction(me->getFaction());
target = SelectTarget(<API key>, 0);
if (target)
Advisor->AI()->AttackStart(target);
}
++PhaseSubphase;
} else Phase_Timer -= diff;
break;
//Subphase 3 - Start
case 4:
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[1]));
if (Advisor && (Advisor->getStandState() == <API key>))
{
Talk(SAY_INTRO_CAPERNIAN);
//start advisor within 7 seconds
Phase_Timer = 7000;
++PhaseSubphase;
}
break;
//Subphase 3 - Unlock advisor
case 5:
if (Phase_Timer <= diff)
{
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[2]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
Advisor->setFaction(me->getFaction());
target = SelectTarget(<API key>, 0);
if (target)
Advisor->AI()->AttackStart(target);
}
++PhaseSubphase;
} else Phase_Timer -= diff;
break;
//Subphase 4 - Start
case 6:
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[2]));
if (Advisor && (Advisor->getStandState() == <API key>))
{
Talk(SAY_INTRO_TELONICUS);
//start advisor within 8.4 seconds
Phase_Timer = 8400;
++PhaseSubphase;
}
break;
//Subphase 4 - Unlock advisor
case 7:
if (Phase_Timer <= diff)
{
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[3]));
if (Advisor)
{
Advisor->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
Advisor->setFaction(me->getFaction());
target = SelectTarget(<API key>, 0);
if (target)
Advisor->AI()->AttackStart(target);
}
Phase_Timer = 3000;
++PhaseSubphase;
} else Phase_Timer -= diff;
break;
//End of phase 1
case 8:
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[3]));
if (Advisor && (Advisor->getStandState() == <API key>))
{
Phase = 2;
if (instance)
instance->SetData(DATA_KAELTHASEVENT, 2);
Talk(SAY_PHASE2_WEAPON);
PhaseSubphase = 0;
Phase_Timer = 3500;
DoCast(me, <API key>);
}
break;
}
}
break;
case 2:
{
if (PhaseSubphase == 0)
{
if (Phase_Timer <= diff)
{
PhaseSubphase = 1;
}
else
Phase_Timer -= diff;
}
//Spawn weapons
if (PhaseSubphase == 1)
{
DoCast(me, <API key>, false);
uint8 uiMaxWeapon = sizeof(<API key>)/sizeof(uint32);
for (uint32 i = 0; i < uiMaxWeapon; ++i)
DoCast(me, <API key>[i], true);
PhaseSubphase = 2;
Phase_Timer = TIME_PHASE_2_3;
}
if (PhaseSubphase == 2)
{
if (Phase_Timer <= diff)
{
Talk(SAY_PHASE3_ADVANCE);
if (instance)
instance->SetData(DATA_KAELTHASEVENT, 3);
Phase = 3;
PhaseSubphase = 0;
}
else
Phase_Timer -= diff;
}
}
break;
case 3:
{
if (PhaseSubphase == 0)
{
//Respawn advisors
Unit* target = SelectTarget(<API key>, 0);
Creature* Advisor;
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
{
Advisor = Unit::GetCreature(*me, m_auiAdvisorGuid[i]);
if (!Advisor)
TC_LOG_ERROR(LOG_FILTER_TSCR, "SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
else
CAST_AI(advisorbase_ai, Advisor->AI())->Revive(target);
}
PhaseSubphase = 1;
Phase_Timer = TIME_PHASE_3_4;
}
if (Phase_Timer <= diff)
{
Talk(SAY_PHASE4_INTRO2);
Phase = 4;
if (instance)
instance->SetData(DATA_KAELTHASEVENT, 4);
// Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael.
DoResetThreat();
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
if (Unit* target = SelectTarget(<API key>, 0))
AttackStart(target);
Phase_Timer = 30000;
}
else
Phase_Timer -= diff;
}
break;
case 4:
case 5:
case 6:
{
//Return since we have no target
if (!UpdateVictim())
return;
//Fireball_Timer
if (!InGravityLapse && !ChainPyros && Phase != 5)
{
if (Fireball_Timer <= diff)
{
if (!IsCastingFireball)
{
if (!me-><API key>(false))
{
//interruptable
me->ApplySpellImmune(0, IMMUNITY_EFFECT, <API key>, false);
int32 dmg = 20000+rand()%5000;
me->CastCustomSpell(me->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false);
IsCastingFireball = true;
Fireball_Timer = 2500;
}
}
else
{
//apply resistance
me->ApplySpellImmune(0, IMMUNITY_EFFECT, <API key>, true);
IsCastingFireball = false;
Fireball_Timer = 5000+rand()%10000;
}
}
else
Fireball_Timer -= diff;
//<API key>
if (<API key> <= diff)
{
DoCast(me->getVictim(), <API key>, true);
<API key> = 60000;
}
else
<API key> -= diff;
if (FlameStrike_Timer <= diff)
{
if (Unit* unit = SelectTarget(<API key>, 0))
DoCast(unit, SPELL_FLAME_STRIKE);
FlameStrike_Timer = 30000;
}
else
FlameStrike_Timer -= diff;
if (MindControl_Timer <= diff)
{
if (me->getThreatManager().getThreatList().size() >= 2)
for (uint32 i = 0; i < 3; ++i)
{
TC_LOG_DEBUG(LOG_FILTER_TSCR, "Kael'Thas mind control not supported.");
//DoCast(unit, SPELL_MIND_CONTROL);
}
MindControl_Timer = 60000;
}
else
MindControl_Timer -= diff;
}
//Phoenix_Timer
if (Phoenix_Timer <= diff)
{
DoCast(me, <API key>);
Talk(SAY_SUMMON_PHOENIX);
Phoenix_Timer = 60000;
}
else
Phoenix_Timer -= diff;
//Phase 4 specific spells
if (Phase == 4)
{
if (HealthBelowPct(50))
{
if (instance)
instance->SetData(DATA_KAELTHASEVENT, 4);
Phase = 5;
Phase_Timer = 10000;
Talk(SAY_PHASE5_NUTS);
me->StopMoving();
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me-><API key>(afGravityPos[0], afGravityPos[1], afGravityPos[2], 1);
me-><API key>(false);
DoCast(me, SPELL_FULLPOWER);
me->SetFlag(UNIT_FIELD_FLAGS, <API key>);
}
//ShockBarrier_Timer
if (ShockBarrier_Timer <= diff)
{
DoCast(me, SPELL_SHOCK_BARRIER);
ChainPyros = true;
PyrosCasted = 0;
ShockBarrier_Timer = 60000;
}
else
ShockBarrier_Timer -= diff;
//Chain Pyros (3 of them max)
if (ChainPyros && !me-><API key>(false))
{
if (PyrosCasted < 3)
{
DoCast(me->getVictim(), SPELL_PYROBLAST);
++PyrosCasted;
}
else
{
ChainPyros = false;
Fireball_Timer = 2500;
<API key> = 60000;
}
}
}
if (Phase == 5)
{
if (Phase_Timer <= diff)
{
me-><API key>(false);
me-><API key>(SPELL_FULLPOWER);
DoCast(me, SPELL_EXPLODE);
me->RemoveFlag(UNIT_FIELD_FLAGS, <API key>);
Phase = 6;
AttackStart(me->getVictim());
}
else
Phase_Timer -= diff;
}
//Phase 5
if (Phase == 6)
{
//GravityLapse_Timer
if (GravityLapse_Timer <= diff)
{
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
switch (GravityLapse_Phase)
{
case 0:
me->StopMoving();
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetPosition(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
me-><API key>(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
// 1) Kael'thas will portal the whole raid right into his body
for (i = threatlist.begin(); i != threatlist.end(); ++i)
{
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
{
//Use work around packet to prevent player from being dropped from combat
DoTeleportPlayer(unit, afGravityPos[0], afGravityPos[1], afGravityPos[2], unit->GetOrientation());
}
}
GravityLapse_Timer = 500;
++GravityLapse_Phase;
InGravityLapse = true;
ShockBarrier_Timer = 1000;
NetherBeam_Timer = 5000;
break;
case 1:
Talk(SAY_GRAVITYLAPSE);
// 2) At that point he will put a Gravity Lapse debuff on everyone
for (i = threatlist.begin(); i != threatlist.end(); ++i)
{
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
{
DoCast(unit, SPELL_KNOCKBACK, true);
//Gravity lapse - needs an exception in Spell system to work
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE, true, 0, 0, me->GetGUID());
unit->CastSpell(unit, <API key>, true, 0, 0, me->GetGUID());
//Using packet workaround
WorldPacket data(<API key>, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
}
}
GravityLapse_Timer = 10000;
++GravityLapse_Phase;
break;
case 2:
//Cast nether vapor aura on self
me-><API key>(false);
DoCast(me, SPELL_NETHER_VAPOR);
GravityLapse_Timer = 20000;
++GravityLapse_Phase;
break;
case 3:
//Remove flight
for (i = threatlist.begin(); i != threatlist.end(); ++i)
{
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
{
//Using packet workaround
WorldPacket data(<API key>, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
}
}
me-><API key>(SPELL_NETHER_VAPOR);
InGravityLapse = false;
GravityLapse_Timer = 60000;
GravityLapse_Phase = 0;
AttackStart(me->getVictim());
break;
}
}
else
GravityLapse_Timer -= diff;
if (InGravityLapse)
{
//ShockBarrier_Timer
if (ShockBarrier_Timer <= diff)
{
DoCast(me, SPELL_SHOCK_BARRIER);
ShockBarrier_Timer = 20000;
}
else
ShockBarrier_Timer -= diff;
//NetherBeam_Timer
if (NetherBeam_Timer <= diff)
{
if (Unit* unit = SelectTarget(<API key>, 0))
DoCast(unit, SPELL_NETHER_BEAM);
NetherBeam_Timer = 4000;
}
else
NetherBeam_Timer -= diff;
}
}
if (!InGravityLapse)
<API key>();
}
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_kaelthasAI(creature);
}
};
//Thaladred the Darkener AI
class <API key> : public CreatureScript
{
public:
<API key>()
: CreatureScript("<API key>")
{
}
struct <API key> : public advisorbase_ai
{
<API key>(Creature* creature) : advisorbase_ai(creature) {}
uint32 Gaze_Timer;
uint32 Silence_Timer;
uint32 PsychicBlow_Timer;
void Reset()
{
Gaze_Timer = 100;
Silence_Timer = 20000;
PsychicBlow_Timer = 10000;
advisorbase_ai::Reset();
}
void EnterCombat(Unit* who)
{
if (me->HasFlag(UNIT_FIELD_FLAGS, <API key>))
return;
if (!who || FakeDeath)
return;
Talk(SAY_THALADRED_AGGRO);
me->AddThreat(who, 5000000.0f);
}
void JustDied(Unit* /*killer*/)
{
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
Talk(SAY_THALADRED_DEATH);
}
void UpdateAI(uint32 diff)
{
advisorbase_ai::UpdateAI(diff);
//Faking death, don't do anything
if (FakeDeath)
return;
//Return since we have no target
if (!UpdateVictim())
return;
//Gaze_Timer
if (Gaze_Timer <= diff)
{
if (Unit* target = SelectTarget(<API key>, 0))
{
DoResetThreat();
me->AddThreat(target, 5000000.0f);
Talk(<API key>, target->GetGUID());
Gaze_Timer = 8500;
}
}
else
Gaze_Timer -= diff;
//Silence_Timer
if (Silence_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SILENCE);
Silence_Timer = 20000;
}
else
Silence_Timer -= diff;
//PsychicBlow_Timer
if (PsychicBlow_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_PSYCHIC_BLOW);
PsychicBlow_Timer = 20000+rand()%5000;
}
else
PsychicBlow_Timer -= diff;
<API key>();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new <API key>(creature);
}
};
//Lord Sanguinar AI
class boss_lord_sanguinar : public CreatureScript
{
public:
boss_lord_sanguinar()
: CreatureScript("boss_lord_sanguinar")
{
}
struct <API key> : public advisorbase_ai
{
<API key>(Creature* creature) : advisorbase_ai(creature) {}
uint32 Fear_Timer;
void Reset()
{
Fear_Timer = 20000;
advisorbase_ai::Reset();
}
void EnterCombat(Unit* who)
{
if (me->HasFlag(UNIT_FIELD_FLAGS, <API key>))
return;
if (!who || FakeDeath)
return;
Talk(SAY_SANGUINAR_AGGRO);
}
void JustDied(Unit* /*killer*/)
{
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
Talk(SAY_SANGUINAR_DEATH);
}
void UpdateAI(uint32 diff)
{
advisorbase_ai::UpdateAI(diff);
//Faking death, don't do anything
if (FakeDeath)
return;
//Return since we have no target
if (!UpdateVictim())
return;
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCast(me->getVictim(), <API key>);
Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds
}
else
Fear_Timer -= diff;
<API key>();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new <API key>(creature);
}
};
//Grand Astromancer Capernian AI
class <API key> : public CreatureScript
{
public:
<API key>()
: CreatureScript("<API key>")
{
}
struct <API key> : public advisorbase_ai
{
<API key>(Creature* creature) : advisorbase_ai(creature) {}
uint32 Fireball_Timer;
uint32 Conflagration_Timer;
uint32 <API key>;
uint32 Yell_Timer;
bool Yell;
void Reset()
{
Fireball_Timer = 2000;
Conflagration_Timer = 20000;
<API key> = 5000;
Yell_Timer = 2000;
Yell = false;
advisorbase_ai::Reset();
}
void JustDied(Unit* /*killer*/)
{
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
Talk(SAY_CAPERNIAN_DEATH);
}
void AttackStart(Unit* who)
{
if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, <API key>))
return;
if (me->Attack(who, true))
{
me->AddThreat(who, 0.0f);
me->SetInCombatWith(who);
who->SetInCombatWith(me);
me->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE);
}
}
void EnterCombat(Unit* who)
{
if (me->HasFlag(UNIT_FIELD_FLAGS, <API key>))
return;
if (!who || FakeDeath)
return;
}
void UpdateAI(uint32 diff)
{
advisorbase_ai::UpdateAI(diff);
//Faking Death, don't do anything
if (FakeDeath)
return;
//Return since we have no target
if (!UpdateVictim())
return;
//Yell_Timer
if (!Yell)
{
if (Yell_Timer <= diff)
{
Talk(SAY_CAPERNIAN_AGGRO);
Yell = true;
}
else
Yell_Timer -= diff;
}
//Fireball_Timer
if (Fireball_Timer <= diff)
{
DoCast(me->getVictim(), <API key>);
Fireball_Timer = 4000;
}
else
Fireball_Timer -= diff;
//Conflagration_Timer
if (Conflagration_Timer <= diff)
{
Unit* target = NULL;
target = SelectTarget(<API key>, 0);
if (target && me->IsWithinDistInMap(target, 30))
DoCast(target, SPELL_CONFLAGRATION);
else
DoCast(me->getVictim(), SPELL_CONFLAGRATION);
Conflagration_Timer = 10000+rand()%5000;
}
else
Conflagration_Timer -= diff;
//<API key>
if (<API key> <= diff)
{
bool InMeleeRange = false;
Unit* target = NULL;
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i!= threatlist.end(); ++i)
{
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
//if in melee range
if (unit && unit->IsWithinDistInMap(me, 5))
{
InMeleeRange = true;
target = unit;
break;
}
}
if (InMeleeRange)
DoCast(target, <API key>);
<API key> = 4000+rand()%2000;
}
else
<API key> -= diff;
//Do NOT deal any melee damage.
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new <API key>(creature);
}
};
//Master Engineer Telonicus AI
class <API key> : public CreatureScript
{
public:
<API key>()
: CreatureScript("<API key>")
{
}
struct <API key> : public advisorbase_ai
{
<API key>(Creature* creature) : advisorbase_ai(creature) {}
uint32 Bomb_Timer;
uint32 RemoteToy_Timer;
void Reset()
{
Bomb_Timer = 10000;
RemoteToy_Timer = 5000;
advisorbase_ai::Reset();
}
void JustDied(Unit* /*killer*/)
{
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
Talk(SAY_TELONICUS_DEATH);
}
void EnterCombat(Unit* who)
{
if (me->HasFlag(UNIT_FIELD_FLAGS, <API key>))
return;
if (!who || FakeDeath)
return;
Talk(SAY_TELONICUS_AGGRO);
}
void UpdateAI(uint32 diff)
{
advisorbase_ai::UpdateAI(diff);
//Faking Death, do nothing
if (FakeDeath)
return;
//Return since we have no target
if (!UpdateVictim())
return;
//Bomb_Timer
if (Bomb_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_BOMB);
Bomb_Timer = 25000;
}
else
Bomb_Timer -= diff;
//RemoteToy_Timer
if (RemoteToy_Timer <= diff)
{
if (Unit* target = SelectTarget(<API key>, 0))
DoCast(target, SPELL_REMOTE_TOY);
RemoteToy_Timer = 10000+rand()%5000;
}
else
RemoteToy_Timer -= diff;
<API key>();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new <API key>(creature);
}
};
//Flame Strike AI
class <API key> : public CreatureScript
{
public:
<API key>()
: CreatureScript("<API key>")
{
}
struct <API key> : public ScriptedAI
{
<API key>(Creature* creature) : ScriptedAI(creature)
{
SetCombatMovement(false);
}
uint32 Timer;
bool Casting;
bool KillSelf;
void Reset()
{
Timer = 5000;
Casting = false;
KillSelf = false;
me->SetFlag(UNIT_FIELD_FLAGS, <API key>);
me->setFaction(14);
}
void MoveInLineOfSight(Unit* /*who*/) {}
void EnterCombat(Unit* /*who*/) {}
void UpdateAI(uint32 diff)
{
if (!Casting)
{
DoCast(me, <API key>);
Casting = true;
}
//Timer
if (Timer <= diff)
{
if (!KillSelf)
{
me-><API key>(false);
DoCast(me, <API key>);
}
else
me->Kill(me);
KillSelf = true;
Timer = 1000;
}
else
Timer -= diff;
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new <API key>(creature);
}
};
//Phoenix AI
class mob_phoenix_tk : public CreatureScript
{
public:
mob_phoenix_tk()
: CreatureScript("mob_phoenix_tk")
{
}
struct mob_phoenix_tkAI : public ScriptedAI
{
mob_phoenix_tkAI(Creature* creature) : ScriptedAI(creature) {}
uint32 Cycle_Timer;
void Reset()
{
Cycle_Timer = 2000;
DoCast(me, SPELL_BURN, true);
}
void JustDied(Unit* /*killer*/)
{
//is this spell in use anylonger?
//DoCast(me, SPELL_EMBER_BLAST, true);
me->SummonCreature(NPC_PHOENIX_EGG, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), <API key>, 16000);
}
void UpdateAI(uint32 diff)
{
if (!UpdateVictim())
return;
if (Cycle_Timer <= diff)
{
//spell Burn should possible do this, but it doesn't, so do this for now.
uint32 dmg = urand(4500, 5500);
if (me->GetHealth() > dmg)
me->ModifyHealth(-int32(dmg));
Cycle_Timer = 2000;
}
else
Cycle_Timer -= diff;
<API key>();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_phoenix_tkAI(creature);
}
};
//Phoenix Egg AI
class mob_phoenix_egg_tk : public CreatureScript
{
public:
mob_phoenix_egg_tk()
: CreatureScript("mob_phoenix_egg_tk")
{
}
struct <API key> : public ScriptedAI
{
<API key>(Creature* creature) : ScriptedAI(creature) {}
uint32 Rebirth_Timer;
void Reset()
{
Rebirth_Timer = 15000;
}
//ignore any
void MoveInLineOfSight(Unit* /*who*/) {}
void AttackStart(Unit* who)
{
if (me->Attack(who, false))
{
me->SetInCombatWith(who);
who->SetInCombatWith(me);
DoStartNoMovement(who);
}
}
void JustSummoned(Creature* summoned)
{
summoned->AddThreat(me->getVictim(), 0.0f);
summoned->CastSpell(summoned, SPELL_REBIRTH, false);
}
void UpdateAI(uint32 diff)
{
if (!Rebirth_Timer)
return;
if (Rebirth_Timer <= diff)
{
me->SummonCreature(NPC_PHOENIX, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), <API key>, 5000);
Rebirth_Timer = 0;
}
else
Rebirth_Timer -= diff;
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new <API key>(creature);
}
};
void AddSC_boss_kaelthas()
{
new boss_kaelthas();
new <API key>();
new boss_lord_sanguinar();
new <API key>();
new <API key>();
new <API key>();
new mob_phoenix_tk();
new mob_phoenix_egg_tk();
} |
/* General typography */
@media only screen and (min-width: 1200px) {
html {
font-size: 16px !important;
}
}
@media only screen and (min-width: 992px) {
html {
font-size: 15px;
}
}
@media only screen and (min-width: 0) {
html {
font-size: 14px;
}
}
.font-light {
font-family: "Roboto-Light", sans-serif;
}
.body {
-<API key>: antialiased;
-<API key>: grayscale;
font-smoothing: antialiased;
}
nav i, nav [class^="mdi-"], nav [class*="mdi-"], nav i.material-icons {
height: 48px !important;
line-height: 48px !important;
}
nav, nav .nav-wrapper i, nav a.button-collapse, nav a.button-collapse i {
height: 48px !important;
line-height: 48px !important;
}
.font-medium {
font-family: "Roboto-Medium", sans-serif;
}
.font-black {
font-family: "Roboto-Black", sans-serif;
}
.level-1, .level-2, .level-3 {
-<API key>: antialiased;
-moz-font-smoothing: antialiased;
text-shadow: 0 0 0;
font-weight: normal;
line-height: 1.1;
}
.level-1 {
font-size: 1.6rem;
}
.level-2 {
font-size: 1.3rem;
}
.level-3 {
font-size: 1.1rem;
line-height: 1.6;
}
/* Marvel prototype fix mobile */
.marvel-device.nexus5 {
width: 240px;
height: 429px;
}
@media (min-width: 375px) {
.marvel-device.nexus5 {
width: 245px;
height: 435px;
}
}
@media (min-width: 425px) {
.marvel-device.nexus5 {
width: 320px;
height: 568px;
}
}
@media (min-width: 768px) {
.level-1 {
font-size: 2rem;
}
.level-2 {
font-size: 1.5rem;
}
.level-3 {
font-size: 1rem;
}
.level-3.truncate-4 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4; /* number of lines to show */
line-height: 1.6; /* fallback */
max-height: 6.4rem; /* fallback */
}
}
@media (min-width: 1024px) {
.level-1 {
font-size: 2.2rem;
}
.level-2 {
font-size: 1.8rem;
}
.level-3 {
font-size: 1.2rem;
}
.level-3.truncate-4 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4; /* number of lines to show */
line-height: 1.6; /* fallback */
max-height: 7.68rem; /* fallback */
}
}
@media (min-width: 1440px) {
.level-1 {
font-size: 2.6rem;
}
.level-2 {
font-size: 2rem;
}
.level-3 {
font-size: 1.3rem;
}
.level-3.truncate-4 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4; /* number of lines to show */
line-height: 1.6; /* fallback */
max-height: 8.32rem; /* fallback */
}
} |
package calculadora_repo;
/**
*
* @author Luis
*/
public class inter extends javax.swing.JFrame {
double a1;
double a2;
String pnt="";
int op;
/**
* Creates new form inter
*/
public inter() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
pantalla = new javax.swing.JTextField();
boton9 = new javax.swing.JButton();
boton6 = new javax.swing.JButton();
boton3 = new javax.swing.JButton();
botonNegativo = new javax.swing.JButton();
boton8 = new javax.swing.JButton();
boton7 = new javax.swing.JButton();
boton5 = new javax.swing.JButton();
boton4 = new javax.swing.JButton();
boton2 = new javax.swing.JButton();
boton1 = new javax.swing.JButton();
boton0 = new javax.swing.JButton();
botonPunto = new javax.swing.JButton();
botonPor = new javax.swing.JButton();
botonDiv = new javax.swing.JButton();
botonMenos = new javax.swing.JButton();
botonMas = new javax.swing.JButton();
botonIgual = new javax.swing.JButton();
<API key>(javax.swing.WindowConstants.EXIT_ON_CLOSE);
pantalla.setFont(new java.awt.Font("Agency FB", 0, 24)); // NOI18N
pantalla.<API key>(javax.swing.JTextField.RIGHT);
boton9.setText("9");
boton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton6.setText("6");
boton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton3.setText("3");
boton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
botonNegativo.setText("-");
boton8.setText("8");
boton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton7.setText("7");
boton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton5.setText("5");
boton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton4.setText("4");
boton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton2.setText("2");
boton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton1.setText("1");
boton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
boton0.setText("0");
boton0.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
botonPunto.setText(".");
botonPor.setText("*");
botonDiv.setText("/");
botonMenos.setText("-");
botonMenos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
botonMas.setText("+");
botonMas.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
botonIgual.setText("=");
botonIgual.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
<API key>(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.<API key>()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.<API key>()
.addComponent(pantalla)
.addContainerGap())
.addGroup(layout.<API key>()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.<API key>()
.addComponent(boton4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boton5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boton6)
.addGap(18, 18, 18)
.addComponent(botonDiv, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.<API key>()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(botonNegativo, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(boton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.<API key>()
.addComponent(boton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(boton3))
.addGroup(layout.<API key>()
.addComponent(boton0)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(botonPunto, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(botonMas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(botonMenos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(layout.<API key>()
.addComponent(boton7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boton8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(boton9)
.addGap(18, 18, 18)
.addComponent(botonPor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(botonIgual, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(58, 202, Short.MAX_VALUE))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.<API key>()
.addContainerGap()
.addComponent(pantalla, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(boton8)
.addComponent(boton7)
.addComponent(botonPor)
.addComponent(boton9))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(boton5)
.addComponent(boton4)
.addComponent(botonDiv)
.addComponent(boton6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(boton3)
.addComponent(boton2)
.addComponent(boton1)
.addComponent(botonMas))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(botonNegativo)
.addComponent(boton0)
.addComponent(botonPunto)
.addComponent(botonMenos))
.addGap(18, 18, 18)
.addComponent(botonIgual)
.addContainerGap(72, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"1";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"2";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"3";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"4";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"5";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"6";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"7";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"8";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"9";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
pnt = pnt+"0";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
op=1;
a1=Double.parseDouble(pnt);
pnt="";
pantalla.setText(pnt);
System.out.println(a1);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
op=2;
a1=Double.parseDouble(pnt);
pnt="";
pantalla.setText(pnt);
}//GEN-LAST:<API key>
private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key>
// TODO add your handling code here:
a2=Double.parseDouble(pnt);
ops naho = new ops();
switch (op) {
case 1:
a1=naho.suma(a1, a2);
pnt=a1+"";
pantalla.setText(pnt);
break;
case 2:
a1=naho.resta(a1, a2);
pnt=a1+"";
pantalla.setText(pnt);
break;
}
}//GEN-LAST:<API key>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.<API key>()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (<API key> ex) {
java.util.logging.Logger.getLogger(inter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (<API key> ex) {
java.util.logging.Logger.getLogger(inter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (<API key> ex) {
java.util.logging.Logger.getLogger(inter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.<API key> ex) {
java.util.logging.Logger.getLogger(inter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new inter().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton boton0;
private javax.swing.JButton boton1;
private javax.swing.JButton boton2;
private javax.swing.JButton boton3;
private javax.swing.JButton boton4;
private javax.swing.JButton boton5;
private javax.swing.JButton boton6;
private javax.swing.JButton boton7;
private javax.swing.JButton boton8;
private javax.swing.JButton boton9;
private javax.swing.JButton botonDiv;
private javax.swing.JButton botonIgual;
private javax.swing.JButton botonMas;
private javax.swing.JButton botonMenos;
private javax.swing.JButton botonNegativo;
private javax.swing.JButton botonPor;
private javax.swing.JButton botonPunto;
private javax.swing.JTextField pantalla;
// End of variables declaration//GEN-END:variables
} |
<?php
class <API key> {
static function debugLog( $identifier, $msg, $level = 'DEBUG' ) {
// TODO: call different wf*Log functions depending on $level
wfDebugLog( $identifier, $msg );
}
static function getIP() {
global $wgRequest;
return $wgRequest->getIP();
}
static function getHostname() {
return wfHostname();
}
static function formatMessage($message_identifier ) {
return <API key>( 'wfMessage', func_get_args() )->text();
}
static function runHooks($func, $args) {
return Hooks::run($func, $args);
}
static function getLanguageCode() {
global $wgLang;
return $wgLang->getCode();
}
static function isUseSquid() {
global $wgUseSquid;
return $wgUseSquid;
}
static function setupSession($sessionId=false) {
wfSetupSession();
}
static function validateIP($ip) {
return IP::isValid( $ip );
}
static function <API key>( $code ) {
return Language::isValidBuiltInCode( $code );
}
static function validateEmail( $email ) {
return Sanitizer::validateEmail( $email );
}
/**
* wmfMessageExists returns true if a translatable message has been defined
* for the string and language that have been passed in, false if none is
* present.
* @param string $msg_key The message string to look up.
* @param string $language A valid mediawiki language code.
* @return boolean - true if message exists, otherwise false.
*/
public static function messageExists( $msg_key, $language ) {
return wfMessage( $msg_key )->inLanguage( $language )->exists();
}
static function getUserAgent() {
return Http::userAgent();
}
static function isPosted() {
global $wgRequest;
return $wgRequest->wasPosted();
}
} |
#include "aniGlobal.h"
#include "wlan_qct_wda.h"
#include "halMsgApi.h"
#include "limUtils.h"
#include "palApi.h"
#include "csrInsideApi.h"
#include "smsDebug.h"
#include "logDump.h"
#include "smeQosInternal.h"
#include "wlan_qct_tl.h"
#include "smeInside.h"
#include "vos_diag_core_event.h"
#include "vos_diag_core_log.h"
#include "csrApi.h"
#include "pmc.h"
#include "vos_nvitem.h"
#ifdef <API key>
#include "csrNeighborRoam.h"
#endif
#if defined(FEATURE_WLAN_CCX) && !defined(<API key>)
#include "csrCcx.h"
#endif
#define <API key> 4
#define <API key> 3
#define <API key> 36
#define <API key> 1
#define <API key> ( 1 * <API key> )
#define <API key> ( 5 * <API key> )
#define <API key> ( 120 * <API key> )
#define <API key> 9
#define <API key> 80
#define <API key> 500
#define <API key> 2000
#define <API key> 500
#define <API key> 3000
#define <API key>(loAC, hiAC) (v_BOOL_t)(((hiAC) > (loAC)) ? (((hiAC)-(loAC)) > 4) : 0)
#define <API key> 1
#define RSSI_HACK_BMPS (-40)
#define MAX_CB_VALUE_IN_INI (2)
#ifdef <API key>
static tANI_BOOLEAN <API key> = VOS_FALSE;
#endif
static tCsrRoamSession csrRoamRoamSession[<API key>];
#ifdef <API key>
int <API key>(eCsrAuthType authType)
{
int n = AUTH_OPEN;
switch(authType)
{
case eCSR_<API key>:
n = AUTH_SHARED;
break;
case eCSR_AUTH_TYPE_WPA:
n = AUTH_WPA_EAP;
break;
case <API key>:
n = AUTH_WPA_PSK;
break;
case eCSR_AUTH_TYPE_RSN:
n = AUTH_WPA2_EAP;
break;
case <API key>:
#ifdef WLAN_FEATURE_11W
case eCSR_<API key>:
#endif
n = AUTH_WPA2_PSK;
break;
#ifdef FEATURE_WLAN_WAPI
case eCSR_<API key>:
n = AUTH_WAPI_CERT;
break;
case eCSR_<API key>:
n = AUTH_WAPI_PSK;
break;
#endif
default:
break;
}
return (n);
}
int <API key>(eCsrEncryptionType encType)
{
int n = ENC_MODE_OPEN;
switch(encType)
{
case <API key>:
case <API key>:
n = ENC_MODE_WEP40;
break;
case <API key>:
case <API key>:
n = ENC_MODE_WEP104;
break;
case <API key>:
n = ENC_MODE_TKIP;
break;
case <API key>:
n = ENC_MODE_AES;
break;
#ifdef FEATURE_WLAN_WAPI
case <API key>:
n = ENC_MODE_SMS4;
break;
#endif
default:
break;
}
return (n);
}
#endif
static const tANI_U8 <API key>[ <API key> ] = { 36, 40, 44, 48};
static const tANI_U8 <API key>[ <API key> ] = { 1, 6, 11 };
static void initConfigParam(tpAniSirGlobal pMac);
static tANI_BOOLEAN <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand,
<API key> Result, void *Context );
static eHalStatus csrRoamStartIbss( tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrRoamProfile *pProfile,
tANI_BOOLEAN *pfSameIbss );
static void <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirSmeNewBssInfo *pNewBss );
static void <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig, tDot11fBeaconIEs *pIes);
static ePhyChanBondState csrGetCBModeFromIes(tpAniSirGlobal pMac, tANI_U8 primaryChn, tDot11fBeaconIEs *pIes);
eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
static void <API key>( tpAniSirGlobal pMac, tANI_U32 result );
eHalStatus csrRoamOpen(tpAniSirGlobal pMac);
eHalStatus csrRoamClose(tpAniSirGlobal pMac);
void <API key>(void *pv);
void <API key>(void *pv);
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac, <API key> *pConnProfile, tCsrRoamProfile *pProfile2);
static eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval);
static eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId);
static void <API key>(void *pv);
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval);
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId);
static void <API key>(void *pv);
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 interval);
eHalStatus <API key>(tpAniSirGlobal pMac);
static void <API key>(void *pv);
static eHalStatus CsrInit11dInfo(tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo);
static eHalStatus <API key>( tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo);
static eHalStatus <API key>( tpAniSirGlobal pMac, <API key> *pConnectedInfo );
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tSirMacAddr peerMacAddr, tANI_U8 numKeys, tAniEdType edType,
tANI_BOOLEAN fUnicast, tAniKeyDirection aniKeyDirection,
tANI_U8 keyId, tANI_U8 keyLength, tANI_U8 *pKey, tANI_U8 paeRole,
tANI_U8 *pKeyRsc );
static eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes,
tCsrRoamProfile *pProfile );
void <API key>(void *pv);
void <API key>(void *pv);
static void csrRoamLinkUp(tpAniSirGlobal pMac, tCsrBssid bssid);
VOS_STATUS <API key>(tHalHandle hHal,
v_U8_t rssiNotification,
void * context);
static void csrRoamLinkDown(tpAniSirGlobal pMac, tANI_U32 sessionId);
void csrRoamVccTrigger(tpAniSirGlobal pMac);
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 statsMask, tANI_U8 staId);
static void <API key>(tpAniSirGlobal pMac, tListElem *pEntry);
static eCsrCfgDot11Mode <API key>( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,tANI_U8 operationChn, eCsrBand *pBand );
static eHalStatus <API key>(tpAniSirGlobal pMac, tSirBssDescription *pBssDesc);
<API key> * <API key>( tpAniSirGlobal pMac,
tDblLinkList *pStaList,
<API key> *pStaEntry);
void <API key>(void *pv);
tCsrPeStatsReqInfo * <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask,
tANI_U32 periodicity, tANI_BOOLEAN *pFound, tANI_U8 staId);
void <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask,
tCsrStatsCallback callback, tANI_U8 staId, void *pContext);
void <API key>(tpAniSirGlobal pMac, <API key> *pTlStats);
void <API key>(void *pv);
void <API key>(void *pv);
tListElem * <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask);
void <API key>(tpAniSirGlobal pMac, tCsrPeStatsReqInfo *pPeStaEntry);
tListElem * <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask);
eHalStatus <API key>(tpAniSirGlobal pMac);
static tANI_U32 csrFindIbssSession( tpAniSirGlobal pMac );
static eHalStatus csrRoamStartWds( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc );
static void csrInitSession( tpAniSirGlobal pMac, tANI_U32 sessionId );
static eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrRoamSetKey *pSetKey, tANI_U32 roamId );
static eHalStatus <API key>(tpAniSirGlobal pMac, tSirBssDescription *pBssDesc);
void <API key>(tpAniSirGlobal pMac);
#ifdef <API key>
void <API key>(void *pv);
#endif
extern void SysProcessMmhMsg(tpAniSirGlobal pMac, tSirMsgQ* pMsg);
extern void <API key>(void* pMsg);
static void <API key>(tANI_U8 *pBuf, tSirSmeDisassocRsp *pRsp);
void csrReinitPreauthCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand);
static void csrRoamInitGlobals(tpAniSirGlobal pMac)
{
if(pMac)
{
vos_mem_zero(&csrRoamRoamSession, sizeof(csrRoamRoamSession));
pMac->roam.roamSession = csrRoamRoamSession;
}
return;
}
static void <API key>(tpAniSirGlobal pMac)
{
if(pMac)
{
pMac->roam.roamSession = NULL;
}
return;
}
eHalStatus csrOpen(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
static uNvTables nvTables;
VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
v_REGDOMAIN_t regId;
tANI_U32 i;
do
{
csrRoamInitGlobals(pMac);
for( i = 0; i < <API key>; i++ )
csrRoamStateChange( pMac, <API key>, i);
initConfigParam(pMac);
if(!HAL_STATUS_SUCCESS((status = csrScanOpen(pMac))))
break;
if(!HAL_STATUS_SUCCESS((status = csrRoamOpen(pMac))))
break;
pMac->roam.nextRoamId = 1;
if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &pMac->roam.statsClientReqList)))
break;
if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &pMac->roam.peStatsReqList)))
break;
if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &pMac->roam.roamCmdPendingList)))
break;
vosStatus = <API key>( &nvTables );
if ( <API key>(vosStatus) )
{
palCopyMemory( pMac->hHdd, pMac->scan.countryCodeDefault,
nvTables.defaultCountryTable.countryCode, <API key> );
status = eHAL_STATUS_SUCCESS;
}
else
{
smsLog( pMac, LOGE, FL(" fail to get NV_FIELD_IMAGE") );
pMac->scan.countryCodeDefault[0] = 'U';
pMac->scan.countryCodeDefault[1] = 'S';
pMac->scan.countryCodeDefault[2] = 'I';
}
smsLog( pMac, LOG1, FL(" country Code from nvRam %.2s"), pMac->scan.countryCodeDefault );
if (!('0' == pMac->scan.countryCodeDefault[0] &&
'0' == pMac->scan.countryCodeDefault[1]))
{
<API key>(pMac, pMac->scan.countryCodeDefault,
®Id, COUNTRY_NV);
}
else
{
regId = REGDOMAIN_WORLD;
}
WDA_SetRegDomain(pMac, regId);
pMac->scan.domainIdDefault = regId;
pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault;
status = palCopyMemory(pMac->hHdd, pMac->scan.countryCodeCurrent,
pMac->scan.countryCodeDefault, <API key>);
status = csrInitGetChannels( pMac );
}while(0);
return (status);
}
eHalStatus csrSetRegInfo(tHalHandle hHal, tANI_U8 *apCntryCode)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
v_REGDOMAIN_t regId;
v_U8_t cntryCodeLength;
if(NULL == apCntryCode)
{
smsLog( pMac, LOGW, FL(" Invalid country Code Pointer") );
return eHAL_STATUS_FAILURE;
}
smsLog( pMac, LOGW, FL(" country Code %.2s"), apCntryCode );
cntryCodeLength = <API key>;
status = <API key>(pMac, apCntryCode, ®Id,
COUNTRY_USER);
if (status != eHAL_STATUS_SUCCESS)
{
smsLog( pMac, LOGE, FL(" fail to get regId for country Code %.2s"), apCntryCode );
return status;
}
status = WDA_SetRegDomain(hHal, regId);
if (status != eHAL_STATUS_SUCCESS)
{
smsLog( pMac, LOGE, FL(" fail to get regId for country Code %.2s"), apCntryCode );
return status;
}
pMac->scan.domainIdDefault = regId;
pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault;
palFillMemory( pMac->hHdd,
pMac->scan.countryCodeDefault,
<API key>,
0 );
palCopyMemory( pMac->hHdd, pMac->scan.countryCodeDefault,
apCntryCode, cntryCodeLength );
if((<API key> - 1) == cntryCodeLength)
{
palFillMemory( pMac->hHdd,
pMac->scan.countryCodeDefault + 2,
1,
0x20 );
}
status = palCopyMemory(pMac->hHdd, pMac->scan.countryCodeCurrent,
pMac->scan.countryCodeDefault, <API key>);
status = csrInitGetChannels( pMac );
return status;
}
eHalStatus csrSetChannels(tHalHandle hHal, tCsrConfigParam *pParam )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
tANI_U8 index = 0;
palCopyMemory( pMac->hHdd, pParam->Csr11dinfo.countryCode,
pMac->scan.countryCodeCurrent, <API key> );
for ( index = 0; index < pMac->scan.base20MHzChannels.numChannels ; index++)
{
pParam->Csr11dinfo.Channels.channelList[index] = pMac->scan.base20MHzChannels.channelList[ index ];
pParam->Csr11dinfo.ChnPower[index].firstChannel = pMac->scan.base20MHzChannels.channelList[ index ];
pParam->Csr11dinfo.ChnPower[index].numChannels = 1;
pParam->Csr11dinfo.ChnPower[index].maxtxPower = pMac->scan.defaultPowerTable[index].pwr;
}
pParam->Csr11dinfo.Channels.numChannels = pMac->scan.base20MHzChannels.numChannels;
return status;
}
eHalStatus csrClose(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
csrRoamClose(pMac);
csrScanClose(pMac);
csrLLClose(&pMac->roam.statsClientReqList);
csrLLClose(&pMac->roam.peStatsReqList);
csrLLClose(&pMac->roam.roamCmdPendingList);
<API key>(pMac);
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac)
{
tSirUpdateChanList *pChanList;
tCsrScanStruct *pScan = &pMac->scan;
tANI_U8 numChan = pScan->base20MHzChannels.numChannels;
tANI_U32 bufLen = sizeof(tSirUpdateChanList) +
(sizeof(tSirUpdateChanParam) * (numChan - 1));
vos_msg_t msg;
tANI_U8 i;
pChanList = (tSirUpdateChanList *) vos_mem_malloc(bufLen);
if (!pChanList)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, <API key>,
"Failed to allocate memory for tSirUpdateChanList");
return <API key>;
}
msg.type = <API key>;
msg.reserved = 0;
msg.bodyptr = pChanList;
pChanList->numChan = numChan;
for (i = 0; i < pChanList->numChan; i++)
{
pChanList->chanParam[i].chanId = pScan->defaultPowerTable[i].chanId;
pChanList->chanParam[i].pwr = <API key>(pMac,
pScan->defaultPowerTable[i].chanId);
if (<API key>(pChanList->chanParam[i].chanId) ==
NV_CHANNEL_DFS)
pChanList->chanParam[i].dfsSet = VOS_TRUE;
else
pChanList->chanParam[i].dfsSet = VOS_FALSE;
}
if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"%s: Failed to post msg to WDA", __func__);
vos_mem_free(pChanList);
return eHAL_STATUS_FAILURE;
}
return eHAL_STATUS_SUCCESS;
}
eHalStatus csrStart(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 i;
do
{
pMac->roam.gVosContext = <API key>(VOS_MODULE_ID_SME, pMac);
for( i = 0; i < <API key>; i++ )
csrRoamStateChange( pMac, <API key>, i );
status = csrRoamStart(pMac);
if(!HAL_STATUS_SUCCESS(status)) break;
pMac->scan.f11dInfoApplied = eANI_BOOLEAN_FALSE;
status = <API key>(pMac, csrCheckPSReady, pMac);
if(!HAL_STATUS_SUCCESS(status)) break;
pMac->roam.sPendingCommands = 0;
csrScanEnable(pMac);
#if defined <API key>
status = csrNeighborRoamInit(pMac);
#endif
pMac->roam.tlStatsReqInfo.numClient = 0;
pMac->roam.tlStatsReqInfo.periodicity = 0;
pMac->roam.tlStatsReqInfo.timerRunning = FALSE;
pMac->roam.vccLinkQuality = <API key>;
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, " csrStart: Couldn't Init HO control blk ");
break;
}
#ifdef QCA_WIFI_2_0
if (pMac->fScanOffload)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Scan offload is enabled, update default chan list");
status = <API key>(pMac);
}
#else
status = <API key>(pMac);
#endif
}while(0);
#if defined(ANI_LOGDUMP)
csrDumpInit(pMac);
#endif
return (status);
}
eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType)
{
tANI_U32 sessionId;
tANI_U32 i;
for(sessionId = 0; sessionId < <API key>; sessionId++)
{
csrRoamCloseSession(pMac, sessionId, TRUE, NULL, NULL);
}
csrScanDisable(pMac);
pMac->scan.fCancelIdleScan = eANI_BOOLEAN_FALSE;
pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE;
csrLLPurge( &pMac->roam.roamCmdPendingList, eANI_BOOLEAN_TRUE );
#if defined <API key>
<API key>(pMac);
#endif
csrScanFlushResult(pMac);
(void) <API key>(pMac, csrCheckPSReady);
pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault;
<API key>(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_FALSE );
for( i = 0; i < <API key>; i++ )
{
csrRoamStateChange( pMac, <API key>, i );
pMac->roam.curSubState[i] = <API key>;
}
#ifdef <API key>
if (<API key> == stopType)
{
<API key> = VOS_FALSE;
}
#endif
return (eHAL_STATUS_SUCCESS);
}
eHalStatus csrReady(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key>( pMac );
<API key>(pMac);
<API key>(pMac);
if(0 != pMac->scan.<API key> )
{
<API key>(pMac);
}
WLANTL_GetACWeights(pMac->roam.gVosContext, pMac->roam.ucACWeights);
status = csrInitChannelList( pMac );
if ( ! HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, "csrInitChannelList failed during csrReady with status=%d",
status );
}
return (status);
}
void <API key>( tpAniSirGlobal pMac )
{
v_U32_t wniDot11mode = 0;
wniDot11mode = <API key>(pMac,pMac->roam.configParam.uCfgDot11Mode);
ccmCfgSetInt(pMac, WNI_CFG_DOT11_MODE, wniDot11mode, NULL, eANI_BOOLEAN_FALSE);
}
void csrSetGlobalCfgs( tpAniSirGlobal pMac )
{
ccmCfgSetInt(pMac, <API key>, csrGetFragThresh(pMac), NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, csrGetRTSThresh(pMac), NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, WNI_CFG_11D_ENABLED,
((pMac->roam.configParam.Is11hSupportEnabled) ? pMac->roam.configParam.Is11dSupportEnabled : pMac->roam.configParam.Is11dSupportEnabled),
NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, WNI_CFG_11H_ENABLED, pMac->roam.configParam.Is11hSupportEnabled, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, !!(pMac->roam.configParam.<API key>), NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, pMac->roam.configParam.HeartbeatThresh24, NULL, eANI_BOOLEAN_FALSE);
<API key>( pMac );
}
eHalStatus csrRoamOpen(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 i;
tCsrRoamSession *pSession;
do
{
for( i = 0; i < <API key>; i++ )
{
pSession = CSR_GET_SESSION( pMac, i );
pSession->roamingTimerInfo.pMac = pMac;
pSession->roamingTimerInfo.sessionId = <API key>;
}
pMac->roam.WaitForKeyTimerInfo.pMac = pMac;
pMac->roam.WaitForKeyTimerInfo.sessionId = <API key>;
status = vos_timer_init(&pMac->roam.hTimerWaitForKey, VOS_TIMER_TYPE_SW,
<API key>,
&pMac->roam.WaitForKeyTimerInfo);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("cannot allocate memory for WaitForKey time out timer"));
break;
}
status = vos_timer_init(&pMac->roam.tlStatsReqInfo.hTlStatsTimer,
VOS_TIMER_TYPE_SW, <API key>, pMac);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("cannot allocate memory for summary Statistics timer"));
return eHAL_STATUS_FAILURE;
}
}while (0);
return (status);
}
eHalStatus csrRoamClose(tpAniSirGlobal pMac)
{
tANI_U32 sessionId;
for(sessionId = 0; sessionId < <API key>; sessionId++)
{
csrRoamCloseSession(pMac, sessionId, TRUE, NULL, NULL);
}
vos_timer_stop(&pMac->roam.hTimerWaitForKey);
vos_timer_destroy(&pMac->roam.hTimerWaitForKey);
vos_timer_stop(&pMac->roam.tlStatsReqInfo.hTlStatsTimer);
vos_timer_destroy(&pMac->roam.tlStatsReqInfo.hTlStatsTimer);
return (eHAL_STATUS_SUCCESS);
}
eHalStatus csrRoamStart(tpAniSirGlobal pMac)
{
(void)pMac;
return (eHAL_STATUS_SUCCESS);
}
void csrRoamStop(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
<API key>(pMac, sessionId);
<API key>(pMac);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrConnectState *pState)
{
eHalStatus status = <API key>;
if ( <API key>(pMac, sessionId) && (NULL != pState) )
{
status = eHAL_STATUS_SUCCESS;
*pState = pMac->roam.roamSession[sessionId].connectState;
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, <API key> *pProfile)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tANI_U32 size = 0;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pProfile)
{
if(pSession->pConnectBssDesc)
{
do
{
size = pSession->pConnectBssDesc->length + sizeof(pSession->pConnectBssDesc->length);
if(size)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pProfile->pBssDesc, size);
if(HAL_STATUS_SUCCESS(status))
{
palCopyMemory(pMac->hHdd, pProfile->pBssDesc, pSession->pConnectBssDesc, size);
}
else
break;
}
else
{
pProfile->pBssDesc = NULL;
}
pProfile->AuthType = pSession->connectedProfile.AuthType;
pProfile->EncryptionType = pSession->connectedProfile.EncryptionType;
pProfile->mcEncryptionType = pSession->connectedProfile.mcEncryptionType;
pProfile->BSSType = pSession->connectedProfile.BSSType;
pProfile->operationChannel = pSession->connectedProfile.operationChannel;
pProfile->CBMode = pSession->connectedProfile.CBMode;
palCopyMemory(pMac->hHdd, &pProfile->bssid, &pSession->connectedProfile.bssid, sizeof(tCsrBssid));
palCopyMemory(pMac->hHdd, &pProfile->SSID, &pSession->connectedProfile.SSID, sizeof(tSirMacSSid));
#ifdef <API key>
if (pSession->connectedProfile.MDID.mdiePresent)
{
pProfile->MDID.mdiePresent = 1;
pProfile->MDID.mobilityDomain = pSession->connectedProfile.MDID.mobilityDomain;
}
else
{
pProfile->MDID.mdiePresent = 0;
pProfile->MDID.mobilityDomain = 0;
}
#endif
#ifdef FEATURE_WLAN_CCX
pProfile->isCCXAssoc = pSession->connectedProfile.isCCXAssoc;
if (csrIsAuthTypeCCX(pSession->connectedProfile.AuthType))
{
palCopyMemory( pMac->hHdd, pProfile->ccxCckmInfo.krk,
pSession->connectedProfile.ccxCckmInfo.krk, CSR_KRK_KEY_LEN );
pProfile->ccxCckmInfo.reassoc_req_num=
pSession->connectedProfile.ccxCckmInfo.reassoc_req_num;
pProfile->ccxCckmInfo.krk_plumbed =
pSession->connectedProfile.ccxCckmInfo.krk_plumbed;
}
#endif
}while(0);
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, <API key> *pProfile)
{
eHalStatus status = eHAL_STATUS_FAILURE;
if((<API key>(pMac, sessionId)) ||
(csrIsConnStateIbss(pMac, sessionId)))
{
if(pProfile)
{
status = <API key>(pMac, sessionId, pProfile);
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, <API key> *pProfile)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
if(pProfile->pBssDesc)
{
palFreeMemory(pMac->hHdd, pProfile->pBssDesc);
}
if(pProfile->pAddIEAssoc)
{
palFreeMemory(pMac->hHdd, pProfile->pAddIEAssoc);
}
palZeroMemory(pMac->hHdd, pProfile, sizeof(<API key>));
pProfile->AuthType = <API key>;
return (status);
}
static eHalStatus <API key>( tpAniSirGlobal pMac, <API key> *pConnectedInfo )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
if( pConnectedInfo->pbFrames )
{
palFreeMemory( pMac->hHdd, pConnectedInfo->pbFrames );
pConnectedInfo->pbFrames = NULL;
}
pConnectedInfo->nBeaconLength = 0;
pConnectedInfo->nAssocReqLength = 0;
pConnectedInfo->nAssocRspLength = 0;
pConnectedInfo->staId = 0;
#ifdef <API key>
pConnectedInfo->nRICRspLength = 0;
#endif
#ifdef FEATURE_WLAN_CCX
pConnectedInfo->nTspecIeLength = 0;
#endif
return ( status );
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
csrReinitPreauthCmd(pMac, pCommand);
csrReleaseCommand( pMac, pCommand );
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
csrReinitRoamCmd(pMac, pCommand);
csrReleaseCommand( pMac, pCommand );
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
csrReinitScanCmd(pMac, pCommand);
csrReleaseCommand( pMac, pCommand );
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
<API key>(pMac, pCommand);
csrReleaseCommand( pMac, pCommand );
}
void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
palZeroMemory(pMac->hHdd, &pCommand->u.setKeyCmd, sizeof(tSetKeyCmd));
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
palZeroMemory(pMac->hHdd, &pCommand->u.removeKeyCmd, sizeof(tRemoveKeyCmd));
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
csrReinitSetKeyCmd(pMac, pCommand);
csrReleaseCommand( pMac, pCommand );
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
<API key>(pMac, pCommand);
csrReleaseCommand( pMac, pCommand );
}
void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping )
{
if( eSmeCsrCommandMask & pCommand->command )
{
switch (pCommand->command)
{
case eSmeCommandScan:
smsLog( pMac, LOGW, "%s: Drop scan reason %d callback 0x%X",
__func__, pCommand->u.scanCmd.reason, (unsigned int)pCommand->u.scanCmd.callback);
if (NULL != pCommand->u.scanCmd.callback)
{
smsLog( pMac, LOGW, "%s callback scan requester", __func__);
csrScanCallCallback(pMac, pCommand, eCSR_SCAN_ABORT);
}
<API key>( pMac, pCommand );
break;
case eSmeCommandRoam:
<API key>( pMac, pCommand );
break;
case <API key>:
<API key>( pMac, pCommand );
break;
case eSmeCommandSetKey:
<API key>( pMac, pCommand );
break;
case <API key>:
<API key>( pMac, pCommand );
break;
default:
smsLog( pMac, LOGW, " CSR abort standard command %d", pCommand->command );
csrReleaseCommand( pMac, pCommand );
break;
}
}
}
void <API key>( tpAniSirGlobal pMac, eCsrRoamSubState NewSubstate, tANI_U32 sessionId)
{
smsLog( pMac, LOG1, " CSR RoamSubstate: [ %d <== %d ]", NewSubstate, pMac->roam.curSubState[sessionId]);
if(pMac->roam.curSubState[sessionId] == NewSubstate)
{
return;
}
pMac->roam.curSubState[sessionId] = NewSubstate;
}
eCsrRoamState csrRoamStateChange( tpAniSirGlobal pMac, eCsrRoamState NewRoamState, tANI_U8 sessionId)
{
eCsrRoamState PreviousState;
smsLog( pMac, LOG1, "CSR RoamState: [ %d <== %d ]", NewRoamState, pMac->roam.curState[sessionId]);
PreviousState = pMac->roam.curState[sessionId];
if ( NewRoamState != pMac->roam.curState[sessionId] )
{
if ( CSR_IS_ROAM_JOINING(pMac, sessionId) )
{
<API key>( pMac, <API key>, sessionId );
}
pMac->roam.curState[sessionId] = NewRoamState;
}
return( PreviousState );
}
void <API key>(tpAniSirGlobal pMac, tANI_U8 catOffset)
{
int i;
if(catOffset)
{
pMac->roam.configParam.bCatRssiOffset = catOffset;
for(i = 0; i < CSR_NUM_RSSI_CAT; i++)
{
pMac->roam.configParam.RSSICat[CSR_NUM_RSSI_CAT - i - 1] = (int)CSR_BEST_RSSI_VALUE - (int)(i * catOffset);
}
}
}
static void initConfigParam(tpAniSirGlobal pMac)
{
int i;
pMac->roam.configParam.agingCount = CSR_AGING_COUNT;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.phyMode = <API key>;
pMac->roam.configParam.eBand = eCSR_BAND_ALL;
pMac->roam.configParam.uCfgDot11Mode = <API key>;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.HeartbeatThresh24 = 40;
pMac->roam.configParam.HeartbeatThresh50 = 40;
pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE;
pMac->roam.configParam.<API key> = eANI_BOOLEAN_FALSE;
pMac->roam.configParam.Is11eSupportEnabled = eANI_BOOLEAN_TRUE;
pMac->roam.configParam.Is11hSupportEnabled = eANI_BOOLEAN_TRUE;
pMac->roam.configParam.RTSThreshold = 2346;
pMac->roam.configParam.shortSlotTime = eANI_BOOLEAN_TRUE;
pMac->roam.configParam.WMMSupportMode = eCsrRoamWmmAuto;
pMac->roam.configParam.<API key> = eANI_BOOLEAN_TRUE;
pMac->roam.configParam.TxRate = eCSR_TX_RATE_AUTO;
pMac->roam.configParam.impsSleepTime = <API key>;
pMac->roam.configParam.scanAgeTimeNCNPS = <API key>;
pMac->roam.configParam.scanAgeTimeNCPS = <API key>;
pMac->roam.configParam.scanAgeTimeCNPS = <API key>;
pMac->roam.configParam.scanAgeTimeCPS = <API key>;
for(i = 0; i < CSR_NUM_RSSI_CAT; i++)
{
pMac->roam.configParam.BssPreferValue[i] = i;
}
<API key>(pMac, <API key>);
pMac->roam.configParam.nRoamingTime = <API key>;
pMac->roam.configParam.fEnforce11dChannels = eANI_BOOLEAN_FALSE;
pMac->roam.configParam.<API key> = eANI_BOOLEAN_FALSE;
pMac->roam.configParam.<API key> = eANI_BOOLEAN_FALSE;
pMac->roam.configParam.<API key> = eANI_BOOLEAN_FALSE;
pMac->roam.configParam.nActiveMaxChnTime = <API key>;
pMac->roam.configParam.nActiveMinChnTime = <API key>;
pMac->roam.configParam.nPassiveMaxChnTime = <API key>;
pMac->roam.configParam.nPassiveMinChnTime = <API key>;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.disableAggWithBtc = eANI_BOOLEAN_TRUE;
#ifdef <API key>
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.nRestTimeConc = CSR_REST_TIME_CONC;
pMac->roam.configParam.<API key> = <API key>;
pMac->roam.configParam.<API key> = <API key>;
#endif
pMac->roam.configParam.IsIdleScanEnabled = TRUE;
pMac->roam.configParam.nTxPowerCap = CSR_MAX_TX_POWER;
pMac->roam.configParam.statsReqPeriodicity = <API key>;
pMac->roam.configParam.<API key> = <API key>;
#ifdef <API key>
pMac->roam.configParam.csr11rConfig.<API key> = 0;
#endif
#ifdef <API key>
pMac->roam.configParam.neighborRoamConfig.nMaxNeighborRetries = 3;
pMac->roam.configParam.neighborRoamConfig.<API key> = 120;
pMac->roam.configParam.neighborRoamConfig.<API key> = 125;
pMac->roam.configParam.neighborRoamConfig.<API key> = 20;
pMac->roam.configParam.neighborRoamConfig.<API key> = 40;
pMac->roam.configParam.neighborRoamConfig.<API key> = 200;
pMac->roam.configParam.neighborRoamConfig.<API key>.numChannels = 3;
pMac->roam.configParam.neighborRoamConfig.<API key>.channelList[0] = 1;
pMac->roam.configParam.neighborRoamConfig.<API key>.channelList[1] = 6;
pMac->roam.configParam.neighborRoamConfig.<API key>.channelList[2] = 11;
pMac->roam.configParam.neighborRoamConfig.<API key> = 20000;
pMac->roam.configParam.neighborRoamConfig.<API key> = 0;
#endif
#ifdef WLAN_FEATURE_11AC
pMac->roam.configParam.nVhtChannelWidth = <API key> + 1;
#endif
pMac->roam.configParam.addTSWhenACMIsOff = 0;
pMac->roam.configParam.fScanTwice = eANI_BOOLEAN_FALSE;
pMac->roam.configParam.doBMPSWorkaround = 0;
}
eCsrBand csrGetCurrentBand(tHalHandle hHal)
{
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
return pMac->roam.configParam.bandCapability;
}
#if defined(FEATURE_WLAN_CCX) && defined(<API key>)
eHalStatus <API key>(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
if (NULL != pNeighborRoamInfo->roamChannelInfo.<API key>.ChannelList)
{
vos_mem_free(pNeighborRoamInfo->roamChannelInfo.<API key>.ChannelList);
pNeighborRoamInfo->roamChannelInfo.<API key>.ChannelList = NULL;
pNeighborRoamInfo->roamChannelInfo.<API key>.numOfChannels = 0;
}
return status;
}
#endif
#if defined (<API key>) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
eHalStatus <API key>(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList)
{
vos_mem_free(pNeighborRoamInfo->cfgParams.channelInfo.ChannelList);
pNeighborRoamInfo->cfgParams.channelInfo.ChannelList = NULL;
pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = 0;
}
return status;
}
eHalStatus <API key>(tpAniSirGlobal pMac,
const tANI_U8 *pChannelList,
const tANI_U8 numChannels)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = numChannels;
pNeighborRoamInfo->cfgParams.channelInfo.ChannelList =
vos_mem_malloc(pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels);
if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList)
{
smsLog(pMac, LOGE, FL("Memory Allocation for CFG Channel List failed"));
pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = 0;
return <API key>;
}
palCopyMemory(pMac->hHdd, pNeighborRoamInfo->cfgParams.channelInfo.ChannelList,
pChannelList,
pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels);
return status;
}
eHalStatus <API key>(tpAniSirGlobal pMac,
eCsrBand eBand)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
tANI_U8 outNumChannels = 0;
tANI_U8 inNumChannels = 0;
tANI_U8 *inPtr = NULL;
tANI_U8 i = 0;
tANI_U8 ChannelList[<API key>] = {0};
if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"No update required for channel list "
"either cfg.ini channel list is not set up or "
"auto band (Band %d)", eBand);
return status;
}
inNumChannels = pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels;
inPtr = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList;
if (eCSR_BAND_24 == eBand)
{
for (i = 0; i < inNumChannels; i++)
{
if (<API key>(inPtr[i]) && <API key>(pMac, inPtr[i]))
{
ChannelList[outNumChannels++] = inPtr[i];
}
}
<API key>(pMac);
<API key>(pMac, ChannelList, outNumChannels);
}
else if (eCSR_BAND_5G == eBand)
{
for (i = 0; i < inNumChannels; i++)
{
if (CSR_IS_CHANNEL_5GHZ(inPtr[i]) &&
<API key>(pMac, inPtr[i]) &&
!CSR_IS_CHANNEL_DFS(inPtr[i]))
{
ChannelList[outNumChannels++] = inPtr[i];
}
}
<API key>(pMac);
<API key>(pMac, ChannelList, outNumChannels);
}
else if (eCSR_BAND_ALL == eBand)
{
for (i = 0; i < inNumChannels; i++)
{
if (<API key>(pMac, inPtr[i]) &&
!CSR_IS_CHANNEL_DFS(inPtr[i]))
{
ChannelList[outNumChannels++] = inPtr[i];
}
}
<API key>(pMac);
<API key>(pMac, ChannelList, outNumChannels);
}
else
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Invalid band, No operation carried out (Band %d)", eBand);
status = <API key>;
}
return status;
}
#endif
#if defined(FEATURE_WLAN_CCX) && defined(<API key>)
eHalStatus <API key>(tpAniSirGlobal pMac,
tANI_U8 *pChannelList,
tANI_U8 numChannels,
const eCsrBand eBand)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
tANI_U8 outNumChannels = 0;
tANI_U8 inNumChannels = numChannels;
tANI_U8 *inPtr = pChannelList;
tANI_U8 i = 0;
tANI_U8 ChannelList[<API key>] = {0};
tANI_U8 tmpChannelList[<API key>] = {0};
tANI_U8 <API key> = 0;
tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.<API key>;
if (pMac->scan.occupiedChannels.numChannels)
{
<API key>(pMac,
&pMac->scan.occupiedChannels.channelList[0],
pMac->scan.occupiedChannels.numChannels,
inPtr,
inNumChannels,
&<API key>);
inNumChannels = <API key>;
}
if (eCSR_BAND_24 == eBand)
{
for (i = 0; i < inNumChannels; i++)
{
if (<API key>(inPtr[i]) && <API key>(pMac, inPtr[i]))
{
ChannelList[outNumChannels++] = inPtr[i];
}
}
}
else if (eCSR_BAND_5G == eBand)
{
for (i = 0; i < inNumChannels; i++)
{
if (CSR_IS_CHANNEL_5GHZ(inPtr[i]) &&
<API key>(pMac, inPtr[i]) &&
!CSR_IS_CHANNEL_DFS(inPtr[i]))
{
ChannelList[outNumChannels++] = inPtr[i];
}
}
}
else if (eCSR_BAND_ALL == eBand)
{
for (i = 0; i < inNumChannels; i++)
{
if (<API key>(pMac, inPtr[i]) &&
!CSR_IS_CHANNEL_DFS(inPtr[i]))
{
ChannelList[outNumChannels++] = inPtr[i];
}
}
}
else
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Invalid band, No operation carried out (Band %d)", eBand);
return <API key>;
}
if ((eCSR_BAND_ALL == eBand) && <API key>(pMac))
{
<API key>(
pMac,
ChannelList,
outNumChannels,
tmpChannelList,
&outNumChannels);
palCopyMemory(pMac->hHdd, ChannelList,
tmpChannelList, outNumChannels);
}
if(outNumChannels)
{
if (NULL != currChannelListInfo->ChannelList)
{
vos_mem_free(currChannelListInfo->ChannelList);
currChannelListInfo->ChannelList = NULL;
currChannelListInfo->numOfChannels = 0;
}
currChannelListInfo->ChannelList = vos_mem_malloc(outNumChannels * sizeof(tANI_U8));
if (NULL == currChannelListInfo->ChannelList)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Failed to allocate memory for roam scan channel list");
currChannelListInfo->numOfChannels = 0;
return <API key>;
}
palCopyMemory(pMac->hHdd, currChannelListInfo->ChannelList,
ChannelList, outNumChannels);
}
return status;
}
#endif
eHalStatus csrSetBand(tHalHandle hHal, eCsrBand eBand)
{
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
eHalStatus status = eHAL_STATUS_SUCCESS;
if (<API key>(pMac) &&
(eBand == eCSR_BAND_24))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"failed to set band cfg80211 = %u, band = %u",
pMac->roam.configParam.uCfgDot11Mode, eBand);
return <API key>;
}
if ((<API key>(pMac) ||
<API key>(pMac)) &&
(eBand == eCSR_BAND_5G))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"failed to set band dot11mode = %u, band = %u",
pMac->roam.configParam.uCfgDot11Mode, eBand);
return <API key>;
}
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Band changed to %u (0 - ALL, 1 - 2.4 GHZ, 2 - 5GHZ)", eBand);
pMac->roam.configParam.eBand = eBand;
pMac->roam.configParam.bandCapability = eBand;
<API key>( pMac );
#if defined (<API key>) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
if (!<API key>(pMac))
<API key>( pMac, eBand );
#endif
status = csrInitGetChannels( pMac );
if (eHAL_STATUS_SUCCESS == status)
csrInitChannelList( hHal );
return status;
}
ePhyChanBondState <API key>(v_U32_t cbIniValue)
{
ePhyChanBondState phyCbState;
switch (cbIniValue) {
case 0:
phyCbState = <API key>;
break;
case 1:
phyCbState = <API key>;
break;
case 2:
phyCbState = <API key>;
break;
#ifdef WLAN_FEATURE_11AC
case 3:
phyCbState = <API key>;
break;
case 4:
phyCbState = <API key>;
break;
case 5:
phyCbState = <API key>;
break;
case 6:
phyCbState = <API key>;
break;
case 7:
phyCbState = <API key>;
break;
case 8:
phyCbState = <API key>;
break;
case 9:
phyCbState = <API key>;
break;
#endif
default:
phyCbState = <API key>;
break;
}
return phyCbState;
}
v_U32_t <API key>(ePhyChanBondState phyCbState)
{
v_U32_t cbIniValue;
switch (phyCbState) {
case <API key>:
cbIniValue = 0;
break;
case <API key>:
cbIniValue = 1;
break;
case <API key>:
cbIniValue = 2;
break;
#ifdef WLAN_FEATURE_11AC
case <API key>:
cbIniValue = 3;
break;
case <API key>:
cbIniValue = 4;
break;
case <API key>:
cbIniValue = 5;
break;
case <API key>:
cbIniValue = 6;
break;
case <API key>:
cbIniValue = 7;
break;
case <API key>:
cbIniValue = 8;
break;
case <API key>:
cbIniValue = 9;
break;
#endif
default:
cbIniValue = 10;
break;
}
return cbIniValue;
}
eHalStatus <API key>(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
if(pParam)
{
pMac->roam.configParam.WMMSupportMode = pParam->WMMSupportMode;
pMac->roam.configParam.Is11eSupportEnabled = pParam->Is11eSupportEnabled;
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.Is11dSupportEnabled = pParam->Is11dSupportEnabled;
pMac->roam.configParam.<API key> = pParam->Is11dSupportEnabled;
pMac->roam.configParam.Is11hSupportEnabled = pParam->Is11hSupportEnabled;
pMac->roam.configParam.fenableMCCMode = pParam->fEnableMCCMode;
pMac->roam.configParam.fAllowMCCGODiffBI = pParam->fAllowMCCGODiffBI;
if (pParam-><API key> > MAX_CB_VALUE_IN_INI)
{
smsLog( pMac, LOGW, "Invalid CB value from ini in 2.4GHz band %d, CB DISABLED", pParam-><API key>);
}
pMac->roam.configParam.<API key> = <API key>(pParam-><API key>);
if (pParam-><API key> > MAX_CB_VALUE_IN_INI)
{
smsLog( pMac, LOGW, "Invalid CB value from ini in 5GHz band %d, CB DISABLED", pParam-><API key>);
}
pMac->roam.configParam.<API key> = <API key>(pParam-><API key>);
pMac->roam.configParam.RTSThreshold = pParam->RTSThreshold;
pMac->roam.configParam.phyMode = pParam->phyMode;
pMac->roam.configParam.shortSlotTime = pParam->shortSlotTime;
pMac->roam.configParam.HeartbeatThresh24 = pParam->HeartbeatThresh24;
pMac->roam.configParam.HeartbeatThresh50 = pParam->HeartbeatThresh50;
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.TxRate = pParam->TxRate;
pMac->roam.configParam.AdHocChannel24 = pParam->AdHocChannel24;
pMac->roam.configParam.AdHocChannel5G = pParam->AdHocChannel5G;
pMac->roam.configParam.bandCapability = pParam->bandCapability;
pMac->roam.configParam.cbChoice = pParam->cbChoice;
pMac->roam.configParam.bgScanInterval = pParam->bgScanInterval;
pMac->roam.configParam.disableAggWithBtc = pParam->disableAggWithBtc;
if (pParam->nActiveMaxChnTime)
{
pMac->roam.configParam.nActiveMaxChnTime = pParam->nActiveMaxChnTime;
}
if (pParam->nActiveMinChnTime)
{
pMac->roam.configParam.nActiveMinChnTime = pParam->nActiveMinChnTime;
}
if (pParam->nPassiveMaxChnTime)
{
pMac->roam.configParam.nPassiveMaxChnTime = pParam->nPassiveMaxChnTime;
}
if (pParam->nPassiveMinChnTime)
{
pMac->roam.configParam.nPassiveMinChnTime = pParam->nPassiveMinChnTime;
}
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
#ifdef <API key>
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
if (pParam->nRestTimeConc)
{
pMac->roam.configParam.nRestTimeConc = pParam->nRestTimeConc;
}
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
if (pParam-><API key>)
{
pMac->roam.configParam.<API key> = pParam-><API key>;
}
#endif
if (pParam->impsSleepTime)
{
tANI_U32 impsSleepTime = pParam->impsSleepTime * <API key>;
if(<API key> <= impsSleepTime)
{
pMac->roam.configParam.impsSleepTime = impsSleepTime;
}
else
{
pMac->roam.configParam.impsSleepTime = <API key>;
}
}
else
{
pMac->roam.configParam.impsSleepTime = 0;
}
pMac->roam.configParam.eBand = pParam->eBand;
pMac->roam.configParam.uCfgDot11Mode = <API key>(NULL, pMac->roam.configParam.phyMode,
pMac->roam.configParam.<API key>);
if (pParam->nScanResultAgeCount)
{
pMac->roam.configParam.agingCount = pParam->nScanResultAgeCount;
}
if(pParam->scanAgeTimeNCNPS)
{
pMac->roam.configParam.scanAgeTimeNCNPS = pParam->scanAgeTimeNCNPS;
}
if(pParam->scanAgeTimeNCPS)
{
pMac->roam.configParam.scanAgeTimeNCPS = pParam->scanAgeTimeNCPS;
}
if(pParam->scanAgeTimeCNPS)
{
pMac->roam.configParam.scanAgeTimeCNPS = pParam->scanAgeTimeCNPS;
}
if(pParam->scanAgeTimeCPS)
{
pMac->roam.configParam.scanAgeTimeCPS = pParam->scanAgeTimeCPS;
}
<API key>(pMac, pParam->bCatRssiOffset);
pMac->roam.configParam.nRoamingTime = pParam->nRoamingTime;
pMac->roam.configParam.fEnforce11dChannels = pParam->fEnforce11dChannels;
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.vccRssiThreshold = pParam->vccRssiThreshold;
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.IsIdleScanEnabled = pParam->IsIdleScanEnabled;
pMac->roam.configParam.statsReqPeriodicity = pParam->statsReqPeriodicity;
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.nTxPowerCap = pParam->nTxPowerCap;
if( csrIs11dSupported( pMac ) )
{
status = CsrInit11dInfo(pMac, &pParam->Csr11dinfo);
}
else
{
pMac->scan.curScanType = eSIR_ACTIVE_SCAN;
}
if( csrIs11hSupported( pMac ) && !csrIs11dSupported( pMac ) )
{
<API key>(pMac, &pParam->Csr11dinfo);
}
#ifdef <API key>
palCopyMemory( pMac->hHdd, &pMac->roam.configParam.csr11rConfig, &pParam->csr11rConfig, sizeof(tCsr11rConfigParams) );
smsLog( pMac, LOG1, "IsFTResourceReqSupp = %d", pMac->roam.configParam.csr11rConfig.<API key>);
#endif
#if defined (<API key>) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.RoamRssiDiff = pParam->RoamRssiDiff;
pMac->roam.configParam.<API key> = pParam-><API key>;
smsLog( pMac, LOG1, "<API key> = %d",
pMac->roam.configParam.<API key> );
pMac->roam.configParam.nRoamPrefer5GHz = pParam->nRoamPrefer5GHz;
pMac->roam.configParam.nRoamIntraBand = pParam->nRoamIntraBand;
pMac->roam.configParam.isWESModeEnabled = pParam->isWESModeEnabled;
pMac->roam.configParam.nProbes = pParam->nProbes;
pMac->roam.configParam.<API key> = pParam-><API key>;
#endif
#ifdef <API key>
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.<API key> = pParam-><API key>;
#endif
#ifdef FEATURE_WLAN_LFR
pMac->roam.configParam.<API key> = pParam-><API key>;
pMac->roam.configParam.MAWCEnabled = pParam->MAWCEnabled;
#endif
#ifdef FEATURE_WLAN_CCX
pMac->roam.configParam.<API key> = pParam-><API key>;
#endif
#ifdef <API key>
palCopyMemory( pMac->hHdd, &pMac->roam.configParam.neighborRoamConfig, &pParam->neighborRoamConfig, sizeof(<API key>) );
smsLog( pMac, LOG1, "<API key> = %d", pMac->roam.configParam.neighborRoamConfig.<API key>);
smsLog( pMac, LOG1, "<API key> = %d", pMac->roam.configParam.neighborRoamConfig.<API key>);
smsLog( pMac, LOG1, "<API key> = %d", pMac->roam.configParam.neighborRoamConfig.<API key>);
smsLog( pMac, LOG1, "<API key> = %d", pMac->roam.configParam.neighborRoamConfig.<API key>);
smsLog( pMac, LOG1, "<API key> = %d", pMac->roam.configParam.neighborRoamConfig.<API key>);
smsLog( pMac, LOG1, "nMaxNeighborRetries = %d", pMac->roam.configParam.neighborRoamConfig.nMaxNeighborRetries);
smsLog( pMac, LOG1, "<API key> = %d", pMac->roam.configParam.neighborRoamConfig.<API key>);
smsLog( pMac, LOG1, "<API key> = %d", pMac->roam.configParam.neighborRoamConfig.<API key>);
{
int i;
smsLog( pMac, LOG1, FL("Num of Channels in CFG Channel List: %d"), pMac->roam.configParam.neighborRoamConfig.<API key>.numChannels);
for( i=0; i< pMac->roam.configParam.neighborRoamConfig.<API key>.numChannels; i++)
{
smsLog( pMac, LOG1, "%d ", pMac->roam.configParam.neighborRoamConfig.<API key>.channelList[i] );
}
smsLog( pMac, LOG1, "");
}
#endif
pMac->roam.configParam.addTSWhenACMIsOff = pParam->addTSWhenACMIsOff;
pMac->scan.fValidateList = pParam->fValidateList;
pMac->scan.fEnableBypass11d = pParam->fEnableBypass11d;
pMac->scan.fEnableDFSChnlScan = pParam->fEnableDFSChnlScan;
pMac->scan.<API key> = pParam->scanCfgAgingTime;
pMac->roam.configParam.fScanTwice = pParam->fScanTwice;
pMac->scan.<API key> = pParam-><API key>;
pMac->roam.configParam.doBMPSWorkaround = 0;
#ifdef WLAN_FEATURE_11AC
pMac->roam.configParam.nVhtChannelWidth = pParam->nVhtChannelWidth;
pMac->roam.configParam.txBFEnable= pParam->enableTxBF;
pMac->roam.configParam.txBFCsnValue = pParam->txBFCsnValue;
pMac->roam.configParam.enableVhtFor24GHz = pParam->enableVhtFor24GHz;
#endif
pMac->roam.configParam.txLdpcEnable = pParam->enableTxLdpc;
pMac->roam.configParam.enableOxygenNwk = pParam->enableOxygenNwk;
pMac->roam.configParam.<API key> = pParam-><API key>;
}
return status;
}
eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
{
eHalStatus status = <API key>;
if(pParam)
{
pParam->WMMSupportMode = pMac->roam.configParam.WMMSupportMode;
pParam->Is11eSupportEnabled = pMac->roam.configParam.Is11eSupportEnabled;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabled;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->Is11hSupportEnabled = pMac->roam.configParam.Is11hSupportEnabled;
pParam-><API key> = <API key>(pMac->roam.configParam.<API key>);
pParam-><API key> = <API key>(pMac->roam.configParam.<API key>);
pParam->RTSThreshold = pMac->roam.configParam.RTSThreshold;
pParam->phyMode = pMac->roam.configParam.phyMode;
pParam->shortSlotTime = pMac->roam.configParam.shortSlotTime;
pParam->HeartbeatThresh24 = pMac->roam.configParam.HeartbeatThresh24;
pParam->HeartbeatThresh50 = pMac->roam.configParam.HeartbeatThresh50;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->TxRate = pMac->roam.configParam.TxRate;
pParam->AdHocChannel24 = pMac->roam.configParam.AdHocChannel24;
pParam->AdHocChannel5G = pMac->roam.configParam.AdHocChannel5G;
pParam->bandCapability = pMac->roam.configParam.bandCapability;
pParam->cbChoice = pMac->roam.configParam.cbChoice;
pParam->bgScanInterval = pMac->roam.configParam.bgScanInterval;
pParam->nActiveMaxChnTime = pMac->roam.configParam.nActiveMaxChnTime;
pParam->nActiveMinChnTime = pMac->roam.configParam.nActiveMinChnTime;
pParam->nPassiveMaxChnTime = pMac->roam.configParam.nPassiveMaxChnTime;
pParam->nPassiveMinChnTime = pMac->roam.configParam.nPassiveMinChnTime;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->disableAggWithBtc = pMac->roam.configParam.disableAggWithBtc;
#ifdef <API key>
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->nRestTimeConc = pMac->roam.configParam.nRestTimeConc;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
#endif
pParam->impsSleepTime = pMac->roam.configParam.impsSleepTime / <API key>;
pParam->eBand = pMac->roam.configParam.eBand;
pParam->nScanResultAgeCount = pMac->roam.configParam.agingCount;
pParam->scanAgeTimeNCNPS = pMac->roam.configParam.scanAgeTimeNCNPS;
pParam->scanAgeTimeNCPS = pMac->roam.configParam.scanAgeTimeNCPS;
pParam->scanAgeTimeCNPS = pMac->roam.configParam.scanAgeTimeCNPS;
pParam->scanAgeTimeCPS = pMac->roam.configParam.scanAgeTimeCPS;
pParam->bCatRssiOffset = pMac->roam.configParam.bCatRssiOffset;
pParam->nRoamingTime = pMac->roam.configParam.nRoamingTime;
pParam->fEnforce11dChannels = pMac->roam.configParam.fEnforce11dChannels;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->vccRssiThreshold = pMac->roam.configParam.vccRssiThreshold;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->IsIdleScanEnabled = pMac->roam.configParam.IsIdleScanEnabled;
pParam->nTxPowerCap = pMac->roam.configParam.nTxPowerCap;
pParam->statsReqPeriodicity = pMac->roam.configParam.statsReqPeriodicity;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->addTSWhenACMIsOff = pMac->roam.configParam.addTSWhenACMIsOff;
pParam->fValidateList = pMac->roam.configParam.fValidateList;
pParam->fEnableBypass11d = pMac->scan.fEnableBypass11d;
pParam->fEnableDFSChnlScan = pMac->scan.fEnableDFSChnlScan;
pParam->fScanTwice = pMac->roam.configParam.fScanTwice;
pParam-><API key> = pMac->scan.<API key>;
pParam->fEnableMCCMode = pMac->roam.configParam.fenableMCCMode;
pParam->fAllowMCCGODiffBI = pMac->roam.configParam.fAllowMCCGODiffBI;
pParam->scanCfgAgingTime = pMac->scan.<API key>;
#ifdef <API key>
palCopyMemory( pMac->hHdd, &pParam->neighborRoamConfig, &pMac->roam.configParam.neighborRoamConfig, sizeof(<API key>) );
#endif
#ifdef WLAN_FEATURE_11AC
pParam->nVhtChannelWidth = pMac->roam.configParam.nVhtChannelWidth;
pParam->enableTxBF = pMac->roam.configParam.txBFEnable;
pParam->txBFCsnValue = pMac->roam.configParam.txBFCsnValue;
#endif
#ifdef <API key>
palCopyMemory( pMac->hHdd, &pMac->roam.configParam.csr11rConfig, &pParam->csr11rConfig, sizeof(tCsr11rConfigParams) );
#endif
#if defined (<API key>) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->RoamRssiDiff = pMac->roam.configParam.RoamRssiDiff;
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam->nRoamPrefer5GHz = pMac->roam.configParam.nRoamPrefer5GHz;
pParam->nRoamIntraBand = pMac->roam.configParam.nRoamIntraBand;
pParam->isWESModeEnabled = pMac->roam.configParam.isWESModeEnabled;
pParam->nProbes = pMac->roam.configParam.nProbes;
pParam-><API key> = pMac->roam.configParam.<API key>;
#endif
#ifdef <API key>
pParam-><API key> = pMac->roam.configParam.<API key>;
pParam-><API key> = pMac->roam.configParam.<API key>;
#endif
#ifdef FEATURE_WLAN_LFR
pParam-><API key> = pMac->roam.configParam.<API key>;
#endif
#ifdef FEATURE_WLAN_CCX
pParam-><API key> = pMac->roam.configParam.<API key>;
#endif
#ifdef <API key>
palCopyMemory( pMac->hHdd, &pParam->neighborRoamConfig, &pMac->roam.configParam.neighborRoamConfig, sizeof(<API key>) );
{
int i;
smsLog( pMac, LOG1, FL("Num of Channels in CFG Channel List: %d"), pMac->roam.configParam.neighborRoamConfig.<API key>.numChannels);
for( i=0; i< pMac->roam.configParam.neighborRoamConfig.<API key>.numChannels; i++)
{
smsLog( pMac, LOG1, "%d ", pMac->roam.configParam.neighborRoamConfig.<API key>.channelList[i] );
}
smsLog( pMac, LOG1, "");
}
#endif
pParam->enableTxLdpc = pMac->roam.configParam.txLdpcEnable;
pParam->enableOxygenNwk = pMac->roam.configParam.enableOxygenNwk;
pParam-><API key> = pMac->roam.configParam.<API key>;
csrSetChannels(pMac, pParam);
status = eHAL_STATUS_SUCCESS;
}
return (status);
}
eHalStatus csrSetPhyMode(tHalHandle hHal, tANI_U32 phyMode, eCsrBand eBand, tANI_BOOLEAN *pfRestartNeeded)
{
eHalStatus status = <API key>;
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
tANI_BOOLEAN fRestartNeeded = eANI_BOOLEAN_FALSE;
eCsrPhyMode newPhyMode = <API key>;
do
{
if(eCSR_BAND_24 == eBand)
{
if(CSR_IS_RADIO_A_ONLY(pMac)) break;
if((eCSR_DOT11_MODE_11a & phyMode) || (<API key> & phyMode)) break;
}
if(eCSR_BAND_5G == eBand)
{
if(<API key>(pMac)) break;
if((eCSR_DOT11_MODE_11b & phyMode) || (<API key> & phyMode) ||
(eCSR_DOT11_MODE_11g & phyMode) || (<API key> & phyMode)
)
{
break;
}
}
if((0 == phyMode) || (<API key> & phyMode))
{
newPhyMode = <API key>;
}
else if(<API key> & phyMode)
{
newPhyMode = <API key>;
}
else
{
if(<API key> & phyMode)
{
if(<API key> != phyMode) break;
newPhyMode = <API key>;
}
else if(<API key> & phyMode)
{
if(<API key> != phyMode) break;
if(eCSR_BAND_24 == eBand) break;
newPhyMode = <API key>;
eBand = eCSR_BAND_5G;
}
else if(<API key> & phyMode)
{
if(<API key> != phyMode) break;
if(eCSR_BAND_5G == eBand) break;
newPhyMode = <API key>;
eBand = eCSR_BAND_24;
}
else if(<API key> & phyMode)
{
if(<API key> != phyMode) break;
if(eCSR_BAND_5G == eBand) break;
newPhyMode = <API key>;
eBand = eCSR_BAND_24;
}
else if(eCSR_DOT11_MODE_11n & phyMode)
{
newPhyMode = eCSR_DOT11_MODE_11n;
}
else if(eCSR_DOT11_MODE_abg & phyMode)
{
newPhyMode = eCSR_DOT11_MODE_abg;
}
else if(eCSR_DOT11_MODE_11a & phyMode)
{
if((eCSR_DOT11_MODE_11g & phyMode) || (eCSR_DOT11_MODE_11b & phyMode))
{
if(eCSR_BAND_ALL == eBand)
{
newPhyMode = eCSR_DOT11_MODE_abg;
}
else
{
break;
}
}
else
{
newPhyMode = eCSR_DOT11_MODE_11a;
eBand = eCSR_BAND_5G;
}
}
else if(eCSR_DOT11_MODE_11g & phyMode)
{
newPhyMode = eCSR_DOT11_MODE_11g;
eBand = eCSR_BAND_24;
}
else if(eCSR_DOT11_MODE_11b & phyMode)
{
newPhyMode = eCSR_DOT11_MODE_11b;
eBand = eCSR_BAND_24;
}
else
{
smsLog( pMac, LOGE, FL(" cannot recognize the phy mode 0x%08X"), phyMode );
newPhyMode = <API key>;
}
}
status = eHAL_STATUS_SUCCESS;
if(eBand != pMac->roam.configParam.eBand)
{
fRestartNeeded = eANI_BOOLEAN_TRUE;
break;
}
if(newPhyMode != pMac->roam.configParam.phyMode)
{
fRestartNeeded = eANI_BOOLEAN_TRUE;
break;
}
}while(0);
if(HAL_STATUS_SUCCESS(status))
{
pMac->roam.configParam.eBand = eBand;
pMac->roam.configParam.phyMode = newPhyMode;
if(pfRestartNeeded)
{
*pfRestartNeeded = fRestartNeeded;
}
}
return (status);
}
void <API key>( tpAniSirGlobal pMac, tCsrChannel *pChannelList )
{
tANI_U8 Index;
tANI_U8 cChannels;
if ( !<API key>( pMac ) )
{
if ( CSR_IS_24_BAND_ONLY( pMac ) )
{
for( Index = 0, cChannels = 0; Index < pChannelList->numChannels;
Index++ )
{
if ( <API key>(pChannelList->channelList[ Index ]) )
{
pChannelList->channelList[ cChannels ] = pChannelList->channelList[ Index ];
cChannels++;
}
}
if ( pChannelList->numChannels > cChannels )
{
palZeroMemory( pMac->hHdd, &pChannelList->channelList[ cChannels ],
sizeof( pChannelList->channelList[ 0 ] ) * ( pChannelList->numChannels - cChannels ) );
}
pChannelList->numChannels = cChannels;
}
else if ( CSR_IS_5G_BAND_ONLY( pMac ) )
{
for ( Index = 0, cChannels = 0; Index < pChannelList->numChannels; Index++ )
{
if ( CSR_IS_CHANNEL_5GHZ(pChannelList->channelList[ Index ]) )
{
pChannelList->channelList[ cChannels ] = pChannelList->channelList[ Index ];
cChannels++;
}
}
if ( pChannelList->numChannels > cChannels )
{
palZeroMemory( pMac->hHdd, &pChannelList->channelList[ cChannels ],
sizeof( pChannelList->channelList[ 0 ] ) * ( pChannelList->numChannels - cChannels ) );
}
pChannelList->numChannels = cChannels;
}
}
}
#define <API key> 6
eHalStatus csrIsValidChannel(tpAniSirGlobal pMac, tANI_U8 chnNum)
{
tANI_U8 index= 0;
eHalStatus status = eHAL_STATUS_FAILURE;
for (index=0; index < pMac->scan.base20MHzChannels.numChannels ;index++)
{
if(pMac->scan.base20MHzChannels.channelList[ index ] == chnNum){
status = eHAL_STATUS_SUCCESS;
break;
}
}
return status;
}
eHalStatus csrInitGetChannels(tpAniSirGlobal pMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U8 <API key> = 0;
VOS_STATUS vosStatus;
tANI_U8 Index = 0;
tANI_U8 <API key> = 0;
vosStatus = <API key>( pMac->scan.defaultPowerTable, &<API key>,
pMac->scan.<API key>, &<API key>);
if ( (VOS_STATUS_SUCCESS != vosStatus) || (<API key> == 0) )
{
smsLog( pMac, LOGE, FL("failed to get channels "));
status = eHAL_STATUS_FAILURE;
}
else
{
if ( <API key> > <API key> )
{
<API key> = <API key>;
}
pMac->scan.numChannelsDefault = <API key>;
for ( Index = 0; Index < <API key>; Index++)
{
pMac->scan.base20MHzChannels.channelList[ Index ] = pMac->scan.defaultPowerTable[ Index ].chanId;
}
pMac->scan.base20MHzChannels.numChannels = <API key>;
if(<API key> > <API key>)
{
<API key> = <API key>;
}
for ( Index = 0; Index < <API key>; Index++)
{
pMac->scan.base40MHzChannels.channelList[ Index ] = pMac->scan.<API key>[ Index ].chanId;
}
pMac->scan.base40MHzChannels.numChannels = <API key>;
}
return (status);
}
eHalStatus csrInitChannelList( tHalHandle hHal )
{
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key>(pMac, &pMac->scan.baseChannels);
<API key>(pMac, &pMac->scan.base20MHzChannels);
<API key>(pMac, eANI_BOOLEAN_FALSE);
<API key>(pMac, eANI_BOOLEAN_TRUE);
<API key>( pMac, &pMac->scan.base20MHzChannels, pMac->scan.countryCodeCurrent, eANI_BOOLEAN_TRUE );
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac,
<API key> *pUpdateConfigParam)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tCsr11dinfo *ps11dinfo = NULL;
ps11dinfo = &pUpdateConfigParam->Csr11dinfo;
status = CsrInit11dInfo(pMac, ps11dinfo);
return status;
}
static eHalStatus CsrInit11dInfo(tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tANI_U8 index;
tANI_U32 count=0;
tSirMacChanInfo *pChanInfo;
tSirMacChanInfo *pChanInfoStart;
tANI_BOOLEAN applyConfig = TRUE;
if(!ps11dinfo)
{
return (status);
}
if ( ps11dinfo->Channels.numChannels && ( <API key> >= ps11dinfo->Channels.numChannels ) )
{
pMac->scan.base20MHzChannels.numChannels = ps11dinfo->Channels.numChannels;
status = palCopyMemory(pMac->hHdd, pMac->scan.base20MHzChannels.channelList,
ps11dinfo->Channels.channelList, ps11dinfo->Channels.numChannels);
if(!HAL_STATUS_SUCCESS(status)) return (status);
}
else
{
return (eHAL_STATUS_SUCCESS);
}
status = palCopyMemory(pMac->hHdd, pMac->scan.countryCodeDefault,
ps11dinfo->countryCode, <API key>);
if(!HAL_STATUS_SUCCESS(status)) return (status);
if(0 == pMac->scan.countryCodeCurrent[0])
{
status = palCopyMemory(pMac->hHdd, pMac->scan.countryCodeCurrent,
ps11dinfo->countryCode, <API key>);
if(!HAL_STATUS_SUCCESS(status)) return (status);
}
if(HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd, (void **)&pChanInfo, sizeof(tSirMacChanInfo) * <API key>)))
{
palZeroMemory(pMac->hHdd, pChanInfo, sizeof(tSirMacChanInfo) * <API key>);
pChanInfoStart = pChanInfo;
for(index = 0; index < ps11dinfo->Channels.numChannels; index++)
{
pChanInfo->firstChanNum = ps11dinfo->ChnPower[index].firstChannel;
pChanInfo->numChannels = ps11dinfo->ChnPower[index].numChannels;
pChanInfo->maxTxPower = CSR_ROAM_MIN( ps11dinfo->ChnPower[index].maxtxPower, pMac->roam.configParam.nTxPowerCap );
pChanInfo++;
count++;
}
if(count)
{
<API key>( pMac, count * sizeof(tSirMacChanInfo), pChanInfoStart );
}
palFreeMemory(pMac->hHdd, pChanInfoStart);
}
if( HAL_STATUS_SUCCESS(status) )
{
for( index = 0; index < <API key>; index++ )
{
if((<API key>(pMac, index)) && CSR_IS_ROAM_STOP(pMac, index))
{
applyConfig = FALSE;
}
}
if(TRUE == applyConfig)
{
<API key>( pMac, &pMac->scan.base20MHzChannels, pMac->scan.countryCodeCurrent, eANI_BOOLEAN_TRUE );
}
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo)
{
tANI_U8 index;
tANI_U32 count=0;
tSirMacChanInfo *pChanInfo;
tSirMacChanInfo *pChanInfoStart;
if(!ps11dinfo || !pMac)
{
return eHAL_STATUS_FAILURE;
}
if(HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd, (void **)&pChanInfo, sizeof(tSirMacChanInfo) * <API key>)))
{
palZeroMemory(pMac->hHdd, pChanInfo, sizeof(tSirMacChanInfo) * <API key>);
pChanInfoStart = pChanInfo;
for(index = 0; index < ps11dinfo->Channels.numChannels; index++)
{
pChanInfo->firstChanNum = ps11dinfo->ChnPower[index].firstChannel;
pChanInfo->numChannels = ps11dinfo->ChnPower[index].numChannels;
pChanInfo->maxTxPower = CSR_ROAM_MIN( ps11dinfo->ChnPower[index].maxtxPower, pMac->roam.configParam.nTxPowerCap );
pChanInfo++;
count++;
}
if(count)
{
<API key>( pMac, count * sizeof(tSirMacChanInfo), pChanInfoStart );
}
palFreeMemory(pMac->hHdd, pChanInfoStart);
}
return eHAL_STATUS_SUCCESS;
}
void <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tSmeCmd *pCommand, eCsrRoamReason eRoamReason)
{
tListElem *pEntry, *pNextEntry;
tSmeCmd *pDupCommand;
tDblLinkList localList;
vos_mem_zero(&localList, sizeof(tDblLinkList));
if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList)))
{
smsLog(pMac, LOGE, FL(" failed to open list"));
return;
}
csrLLLock( &pMac->sme.smeCmdPendingList );
pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK );
while( pEntry )
{
pNextEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK );
pDupCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if (
(pCommand && ( pCommand->sessionId == pDupCommand->sessionId ) &&
((pCommand->command == pDupCommand->command) &&
(vos_mem_compare(pDupCommand->u.roamCmd.peerMac, pCommand->u.roamCmd.peerMac, sizeof(v_MACADDR_t))) &&
(pCommand->u.roamCmd.roamReason == pDupCommand->u.roamCmd.roamReason ||
eCsrForcedDisassoc == pCommand->u.roamCmd.roamReason ||
eCsrHddIssued == pCommand->u.roamCmd.roamReason)))
||
( (sessionId == pDupCommand->sessionId) &&
(eSmeCommandRoam == pDupCommand->command) &&
((eCsrForcedDisassoc == eRoamReason) ||
(eCsrHddIssued == eRoamReason))
)
)
{
smsLog(pMac, LOGW, FL(" roamReason = %d"), pDupCommand->u.roamCmd.roamReason);
if(csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ))
{
csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK);
}
}
pEntry = pNextEntry;
}
csrLLUnlock( &pMac->sme.smeCmdPendingList );
while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) )
{
pDupCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
csrRoamCallCallback(pMac, pDupCommand->sessionId, NULL, pDupCommand->u.roamCmd.roamId,
eCSR_ROAM_CANCELLED, <API key>);
<API key>(pMac, pDupCommand);
}
csrLLClose(&localList);
}
eHalStatus csrRoamCallCallback(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamInfo *pRoamInfo,
tANI_U32 roamId, eRoamCmdStatus u1, eCsrRoamResult u2)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
#ifdef <API key>
<API key>(connectionStatus, <API key>);
#endif
tCsrRoamSession *pSession;
if( <API key>( pMac, sessionId) )
{
pSession = CSR_GET_SESSION( pMac, sessionId );
}
else
{
smsLog(pMac, LOGE, "Session ID:%d is not valid", sessionId);
VOS_ASSERT(0);
return eHAL_STATUS_FAILURE;
}
if(<API key> == u1 && pRoamInfo)
{
smsLog(pMac, LOGW, " Assoc complete result = %d statusCode = %d reasonCode = %d", u2, pRoamInfo->statusCode, pRoamInfo->reasonCode);
}
if ((u1 == <API key>) && (pSession->bRefAssocStartCnt)) {
pSession->bRefAssocStartCnt
}
if ( (pSession == NULL) ||
(eANI_BOOLEAN_FALSE == pSession->sessionActive) )
{
smsLog(pMac, LOG1, "Session ID is not valid");
return eHAL_STATUS_FAILURE;
}
if(NULL != pSession->callback)
{
if( pRoamInfo )
{
pRoamInfo->sessionId = (tANI_U8)sessionId;
}
switch( u1 ){
case <API key>:
case <API key>:
case <API key>:
case eCSR_ROAM_LOSTLINK:
case <API key>:
wrnprintf("eRoamCmdStatus %d eCsrRoamResult %d, tSirResultCodes %u, eSirMacStatusCodes %lu \n", u1, u2, pSession->joinFailStatusCode.statusCode, pSession->joinFailStatusCode.reasonCode);
if (pRoamInfo) {
wrnprintf("pRoamInfo tSirResultCodes %u eSirMacStatusCodes %lu\n", pRoamInfo->statusCode, pRoamInfo->reasonCode);
}
break;
default:
break;
}
status = pSession->callback(pSession->pContext, pRoamInfo, roamId, u1, u2);
}
#ifdef <API key>
palZeroMemory(pMac->hHdd, &connectionStatus, sizeof(<API key>));
if((<API key> == u1) && (<API key> == u2))
{
connectionStatus.eventId = <API key>;
connectionStatus.bssType = pRoamInfo->u.pConnectedProfile->BSSType;
if(NULL != pRoamInfo->pBssDesc)
{
connectionStatus.rssi = pRoamInfo->pBssDesc->rssi * (-1);
connectionStatus.channel = pRoamInfo->pBssDesc->channelId;
}
connectionStatus.qosCapability = pRoamInfo->u.pConnectedProfile->qosConnection;
connectionStatus.authType = (v_U8_t)<API key>(pRoamInfo->u.pConnectedProfile->AuthType);
connectionStatus.encryptionType = (v_U8_t)<API key>(pRoamInfo->u.pConnectedProfile->EncryptionType);
palCopyMemory(pMac->hHdd, connectionStatus.ssid, pRoamInfo->u.pConnectedProfile->SSID.ssId, 6);
connectionStatus.reason = <API key>;
<API key>(&connectionStatus, EVENT_WLAN_STATUS);
}
if((<API key> == u1) || (<API key> == u2))
{
connectionStatus.eventId = <API key>;
connectionStatus.reason = <API key>;
<API key>(&connectionStatus, EVENT_WLAN_STATUS);
}
if(<API key> == u2)
{
connectionStatus.eventId = <API key>;
connectionStatus.reason = <API key>;
<API key>(&connectionStatus, EVENT_WLAN_STATUS);
}
if(<API key> == u2)
{
connectionStatus.eventId = <API key>;
connectionStatus.reason = <API key>;
<API key>(&connectionStatus, EVENT_WLAN_STATUS);
}
if(<API key> == u2)
{
connectionStatus.eventId = <API key>;
connectionStatus.reason = eCSR_REASON_DEAUTH;
<API key>(&connectionStatus, EVENT_WLAN_STATUS);
}
#endif
return (status);
}
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac)
{
#ifdef <API key>
return <API key>(pMac);
#else
return eANI_BOOLEAN_FALSE;
#endif
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
eCsrRoamSubState NewSubstate, tANI_BOOLEAN fMICFailure )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrBssid bssId = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
tANI_U16 reasonCode;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if ( <API key>( pMac, sessionId ) )
{
smsLog(pMac, LOG1, FL(" restore AC weights (%d-%d-%d-%d)"), pMac->roam.ucACWeights[0], pMac->roam.ucACWeights[1],
pMac->roam.ucACWeights[2], pMac->roam.ucACWeights[3]);
WLANTL_SetACWeights(pMac->roam.gVosContext, pMac->roam.ucACWeights);
}
if ( fMICFailure )
{
reasonCode = <API key>;
}
else if (NewSubstate == <API key>)
{
reasonCode = <API key>;
}
else
{
reasonCode = <API key>;
}
#ifdef <API key>
if ( (<API key>(pMac)) &&
(NewSubstate != <API key>))
{
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
palCopyMemory(pMac->hHdd, &bssId, pNeighborRoamInfo-><API key>.BSSIDs.bssid, sizeof(tSirMacAddr));
}
else
#endif
if(pSession->pConnectBssDesc)
{
palCopyMemory(pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
}
smsLog( pMac, LOG2, "CSR Attempting to Disassociate Bssid=%02x-%02x-%02x-%02x-%02x-%02x"
"subState = %d reason=%d", bssId[ 0 ], bssId[ 1 ], bssId[ 2 ], bssId[ 3 ],
bssId[ 4 ], bssId[ 5 ], NewSubstate, reasonCode);
<API key>( pMac, NewSubstate, sessionId);
status = <API key>( pMac, sessionId, bssId, reasonCode );
if(HAL_STATUS_SUCCESS(status))
{
csrRoamLinkDown(pMac, sessionId);
#ifndef <API key>
if(<API key> != NewSubstate)
{
sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, <API key>, NULL);
}
#endif
}
else
{
smsLog(pMac, LOGW, FL("<API key> failed with status %d"), status);
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac,
tANI_U32 sessionId,
tANI_U8 *pPeerMacAddr,
tANI_U32 reason)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
do
{
pCommand = csrGetCommandBuffer( pMac );
if ( !pCommand )
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
break;
}
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.roamReason = <API key>;
vos_mem_copy(pCommand->u.roamCmd.peerMac, pPeerMacAddr, 6);
pCommand->u.roamCmd.reason = (tSirMacReasonCodes)reason;
status = csrQueueSmeCommand(pMac, pCommand, eANI_BOOLEAN_FALSE);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
<API key>( pMac, pCommand );
}
}while(0);
return status;
}
eHalStatus <API key>( tpAniSirGlobal pMac,
tANI_U32 sessionId,
tANI_U8 *pPeerMacAddr,
tANI_U32 reason)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
do
{
pCommand = csrGetCommandBuffer( pMac );
if ( !pCommand )
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
break;
}
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.roamReason = eCsrForcedDeauthSta;
vos_mem_copy(pCommand->u.roamCmd.peerMac, pPeerMacAddr, 6);
pCommand->u.roamCmd.reason = (tSirMacReasonCodes)reason;
status = csrQueueSmeCommand(pMac, pCommand, eANI_BOOLEAN_FALSE);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
<API key>( pMac, pCommand );
}
}while(0);
return status;
}
eHalStatus
<API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tANI_BOOLEAN bEnable )
{
eHalStatus status = eHAL_STATUS_FAILURE;
tCsrBssid bssId = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (!pSession)
{
smsLog( pMac, LOGE, "<API key>:CSR Session not found");
return (status);
}
if (pSession->pConnectBssDesc)
{
palCopyMemory(pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
}
else
{
smsLog( pMac, LOGE, "<API key>:Connected BSS Description in CSR Session not found");
return (status);
}
smsLog( pMac, LOG2, "CSR issuing tkip counter measures for Bssid = %02x-%02x-%02x-%02x-%02x-%02x, Enable = %d",
bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
bssId[ 3 ], bssId[ 4 ], bssId[ 5 ], bEnable);
status = <API key>( pMac, sessionId, bEnable, bssId );
return (status);
}
eHalStatus
<API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
VOS_MODULE_ID modId, void *pUsrContext,
void *pfnSapEventCallback, v_U8_t *pAssocStasBuf )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrBssid bssId = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (!pSession)
{
smsLog( pMac, LOGE, "<API key>:CSR Session not found");
return (status);
}
if(pSession->pConnectBssDesc)
{
palCopyMemory( pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid) );
}
else
{
smsLog( pMac, LOGE, "<API key>:Connected BSS Description in CSR Session not found");
return (status);
}
smsLog( pMac, LOG2, "CSR getting associated stations for Bssid = %02x-%02x-%02x-%02x-%02x-%02x",
bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
bssId[ 3 ], bssId[ 4 ], bssId[ 5 ] );
status = <API key>( pMac, sessionId, modId, bssId, pUsrContext, pfnSapEventCallback, pAssocStasBuf );
return (status);
}
eHalStatus
<API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
void *pUsrContext, void *pfnSapEventCallback, v_MACADDR_t pRemoveMac )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrBssid bssId = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (!pSession)
{
smsLog( pMac, LOGE, "<API key>:CSR Session not found");
return (status);
}
if(pSession->pConnectBssDesc)
{
palCopyMemory( pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid) );
}
else
{
smsLog( pMac, LOGE, "<API key>:Connected BSS Description in CSR Session not found");
return (status);
}
smsLog( pMac, LOG2, "CSR getting WPS Session Overlap for Bssid = %02x-%02x-%02x-%02x-%02x-%02x",
bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
bssId[ 3 ], bssId[ 4 ], bssId[ 5 ] );
status = <API key>( pMac, sessionId, bssId, pUsrContext, pfnSapEventCallback, pRemoveMac);
return (status);
}
eHalStatus csrRoamIssueDeauth( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamSubState NewSubstate )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrBssid bssId = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pSession->pConnectBssDesc)
{
palCopyMemory(pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
}
smsLog( pMac, LOG2, "CSR Attempting to Deauth Bssid= %02x-%02x-%02x-%02x-%02x-%02x",
bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
bssId[ 3 ], bssId[ 4 ], bssId[ 5 ] );
<API key>( pMac, NewSubstate, sessionId);
status = <API key>( pMac, sessionId, bssId, eSIR_MAC_DE<API key> );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, FL("<API key> failed with status %d"), status);
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pBssDesc )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tANI_U32 size;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(NULL == pBssDesc)
{
<API key>(pMac, sessionId);
}
else
{
size = pBssDesc->length + sizeof( pBssDesc->length );
if(NULL != pSession->pConnectBssDesc)
{
if(((pSession->pConnectBssDesc->length) + sizeof(pSession->pConnectBssDesc->length)) < size)
{
<API key>(pMac, sessionId);
}
}
if(NULL == pSession->pConnectBssDesc)
{
status = palAllocateMemory( pMac->hHdd, (void **)&pSession->pConnectBssDesc, size);
}
if ( HAL_STATUS_SUCCESS(status) && pSession->pConnectBssDesc )
{
palCopyMemory( pMac->hHdd, pSession->pConnectBssDesc, pBssDesc, size );
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,
tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig,
tDot11fBeaconIEs *pIes)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
eCsrCfgDot11Mode cfgDot11Mode;
VOS_ASSERT( pIes != NULL );
if (pIes == NULL)
return eHAL_STATUS_FAILURE;
do
{
palCopyMemory(pMac->hHdd, &pBssConfig->BssCap, &pBssDesc->capabilityInfo, sizeof(<API key>));
pBssConfig->qosType = <API key>(pMac, pBssDesc, pIes);
if(pIes->SSID.present)
{
palCopyMemory(pMac->hHdd, &pBssConfig->SSID.ssId, pIes->SSID.ssid, pIes->SSID.num_ssid);
pBssConfig->SSID.length = pIes->SSID.num_ssid;
}
else
pBssConfig->SSID.length = 0;
if(csrIsNULLSSID(pBssConfig->SSID.ssId, pBssConfig->SSID.length))
{
smsLog(pMac, LOGW, " BSS desc SSID is a wildcard");
if(pProfile->SSIDs.numOfSSIDs == 0)
{
smsLog(pMac, LOGW, " Both BSS desc and profile doesn't have SSID");
status = eHAL_STATUS_FAILURE;
break;
}
}
if(CSR_IS_CHANNEL_5GHZ(pBssDesc->channelId))
{
pBssConfig->eBand = eCSR_BAND_5G;
}
else
{
pBssConfig->eBand = eCSR_BAND_24;
}
if(csrIsPhyModeMatch( pMac, pProfile->phyMode, pBssDesc, pProfile, &cfgDot11Mode, pIes ))
{
pBssConfig->uCfgDot11Mode = cfgDot11Mode;
}
else
{
smsLog(pMac, LOGW, " Can not find match phy mode");
if(eCSR_BAND_24 == pBssConfig->eBand)
{
pBssConfig->uCfgDot11Mode = <API key>;
}
else
{
pBssConfig->uCfgDot11Mode = <API key>;
}
}
if ((pBssConfig->uCfgDot11Mode != <API key>) &&
(pMac->roam.configParam.WMMSupportMode == eCsrRoamWmmNoQos))
{
pBssConfig->qosType = <API key>;
}
if (((pBssConfig->uCfgDot11Mode == <API key>) ||
(pBssConfig->uCfgDot11Mode == <API key>)) &&
((pBssConfig->qosType != <API key>) ||
(pBssConfig->qosType != <API key>) ||
(pBssConfig->qosType != <API key>) ))
{
pBssConfig->qosType = <API key>;
}
switch( pProfile->negotiatedAuthType )
{
default:
case eCSR_AUTH_TYPE_WPA:
case <API key>:
case <API key>:
case eCSR_<API key>:
pBssConfig->authType = eSIR_OPEN_SYSTEM;
break;
case eCSR_<API key>:
pBssConfig->authType = eSIR_SHARED_KEY;
break;
case eCSR_<API key>:
pBssConfig->authType = eSIR_AUTO_SWITCH;
break;
}
if( <API key> != cfgDot11Mode )
{
pBssConfig->uShortSlotTime = pMac->roam.configParam.shortSlotTime;
}
else
{
pBssConfig->uShortSlotTime = 0;
}
if(pBssConfig->BssCap.ibss)
{
pBssConfig->f11hSupport = eANI_BOOLEAN_FALSE;
}
else
{
pBssConfig->f11hSupport = pMac->roam.configParam.Is11hSupportEnabled;
}
pBssConfig->uPowerLimit = <API key>(pMac, &pIes->PowerConstraints);
if ( CSR_IS_11A_BSS( pBssDesc ) )
{
pBssConfig->uHeartBeatThresh = pMac->roam.configParam.HeartbeatThresh50;
}
else
{
pBssConfig->uHeartBeatThresh = pMac->roam.configParam.HeartbeatThresh24;
}
if ( pBssDesc->beaconInterval )
{
pBssConfig->uJoinTimeOut = CSR_ROAM_MAX(10 * pBssDesc->beaconInterval, <API key>);
}
else
{
pBssConfig->uJoinTimeOut = <API key>;
}
pBssConfig->cbMode = csrGetCBModeFromIes(pMac, pBssDesc->channelId, pIes);
}while(0);
return (status);
}
static eHalStatus <API key>(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,
tBssConfigParam *pBssConfig, tSirBssDescription *pBssDesc)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U8 operationChannel = 0;
tANI_U8 qAPisEnabled = FALSE;
pBssConfig->SSID.length = 0;
if(pProfile->SSIDs.numOfSSIDs)
{
palCopyMemory(pMac->hHdd, &pBssConfig->SSID, &pProfile->SSIDs.SSIDList[0].SSID, sizeof(tSirMacSSid));
}
else
{
return eHAL_STATUS_FAILURE;
}
if( csrIsBssTypeIBSS(pProfile->BSSType) )
{
pBssConfig->BssCap.ibss = 1;
}
else
{
pBssConfig->BssCap.ess = 1;
}
if( <API key> != pProfile->EncryptionType.encryptionType[0] )
{
pBssConfig->BssCap.privacy = 1;
}
pBssConfig->eBand = pMac->roam.configParam.eBand;
if(pProfile->ChannelInfo.ChannelList)
{
operationChannel = pProfile->ChannelInfo.ChannelList[0];
}
pBssConfig->uCfgDot11Mode = <API key>(pMac, pProfile, operationChannel,
&pBssConfig->eBand);
if ( pBssConfig->BssCap.ess == 1 )
{
if(CSR_IS_INFRA_AP(pProfile) && (eCsrRoamWmmNoQos != pMac->roam.configParam.WMMSupportMode )){
qAPisEnabled = TRUE;
}
else
if (<API key>(pMac, pBssDesc) == eHAL_STATUS_SUCCESS) {
qAPisEnabled = TRUE;
} else {
qAPisEnabled = FALSE;
}
} else {
qAPisEnabled = TRUE;
}
if (( eCsrRoamWmmNoQos != pMac->roam.configParam.WMMSupportMode && qAPisEnabled) ||
(( <API key> == pBssConfig->uCfgDot11Mode && qAPisEnabled) ||
( <API key> == pBssConfig->uCfgDot11Mode ) )
)
{
pBssConfig->qosType = <API key>;
} else {
pBssConfig->qosType = <API key>;
}
switch( pProfile->AuthType.authType[0] )
{
default:
case eCSR_AUTH_TYPE_WPA:
case <API key>:
case <API key>:
case eCSR_<API key>:
pBssConfig->authType = eSIR_OPEN_SYSTEM;
break;
case eCSR_<API key>:
pBssConfig->authType = eSIR_SHARED_KEY;
break;
case eCSR_<API key>:
pBssConfig->authType = eSIR_AUTO_SWITCH;
break;
}
if( <API key> != pBssConfig->uCfgDot11Mode )
{
pBssConfig->uShortSlotTime = pMac->roam.configParam.shortSlotTime;
}
else
{
pBssConfig->uShortSlotTime = 0;
}
pBssConfig->f11hSupport = eANI_BOOLEAN_FALSE;
pBssConfig->uPowerLimit = 0;
if ( eCSR_BAND_5G == pBssConfig->eBand )
{
pBssConfig->uHeartBeatThresh = pMac->roam.configParam.HeartbeatThresh50;
}
else
{
pBssConfig->uHeartBeatThresh = pMac->roam.configParam.HeartbeatThresh24;
}
pBssConfig->uJoinTimeOut = <API key>;
return (status);
}
static eHalStatus <API key>(tpAniSirGlobal pMac, tSirBssDescription *pBssDesc)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tDot11fBeaconIEs *pIes = NULL;
do
{
if(!HAL_STATUS_SUCCESS(<API key>(pMac, pBssDesc, &pIes)))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"<API key>() failed");
break;
}
if( CSR_IS_QOS_BSS(pIes) )
{
status = eHAL_STATUS_SUCCESS;
}
} while (0);
if (NULL != pIes)
{
vos_mem_free(pIes);
}
return status;
}
void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy )
{
tANI_U32 PrivacyEnabled = 0;
tANI_U32 RsnEnabled = 0;
tANI_U32 WepDefaultKeyId = 0;
tANI_U32 WepKeyLength = <API key>;
tANI_U32 Key0Length = 0;
tANI_U32 Key1Length = 0;
tANI_U32 Key2Length = 0;
tANI_U32 Key3Length = 0;
tANI_U8 Key0[ <API key> ];
tANI_U8 Key1[ <API key> ];
tANI_U8 Key2[ <API key> ];
tANI_U8 Key3[ <API key> ];
switch ( pProfile-><API key> )
{
case <API key>:
PrivacyEnabled = 0;
RsnEnabled = 0;
Key0Length = 0;
Key1Length = 0;
Key2Length = 0;
Key3Length = 0;
break;
case <API key>:
case <API key>:
PrivacyEnabled = 1;
RsnEnabled = 0;
WepDefaultKeyId = pProfile->Keys.defaultIndex;
WepKeyLength = <API key>;
if ( pProfile->Keys.KeyLength[0] )
{
palCopyMemory( pMac->hHdd, Key0, pProfile->Keys.KeyMaterial[0], <API key> );
Key0Length = <API key>;
}
else
{
Key0Length = 0;
}
if ( pProfile->Keys.KeyLength[1] )
{
palCopyMemory( pMac->hHdd, Key1, pProfile->Keys.KeyMaterial[1], <API key> );
Key1Length = <API key>;
}
else
{
Key1Length = 0;
}
if ( pProfile->Keys.KeyLength[2] )
{
palCopyMemory( pMac->hHdd, Key2, pProfile->Keys.KeyMaterial[2], <API key> );
Key2Length = <API key>;
}
else
{
Key2Length = 0;
}
if ( pProfile->Keys.KeyLength[3] )
{
palCopyMemory( pMac->hHdd, Key3, pProfile->Keys.KeyMaterial[3], <API key> );
Key3Length = <API key>;
}
else
{
Key3Length = 0;
}
break;
case <API key>:
case <API key>:
PrivacyEnabled = 1;
RsnEnabled = 0;
WepDefaultKeyId = pProfile->Keys.defaultIndex;
WepKeyLength = <API key>;
if ( pProfile->Keys.KeyLength[0] )
{
palCopyMemory( pMac->hHdd, Key0, pProfile->Keys.KeyMaterial[ 0 ], <API key> );
Key0Length = <API key>;
}
else
{
Key0Length = 0;
}
if ( pProfile->Keys.KeyLength[1] )
{
palCopyMemory( pMac->hHdd, Key1, pProfile->Keys.KeyMaterial[ 1 ], <API key> );
Key1Length = <API key>;
}
else
{
Key1Length = 0;
}
if ( pProfile->Keys.KeyLength[2] )
{
palCopyMemory( pMac->hHdd, Key2, pProfile->Keys.KeyMaterial[ 2 ], <API key> );
Key2Length = <API key>;
}
else
{
Key2Length = 0;
}
if ( pProfile->Keys.KeyLength[3] )
{
palCopyMemory( pMac->hHdd, Key3, pProfile->Keys.KeyMaterial[ 3 ], <API key> );
Key3Length = <API key>;
}
else
{
Key3Length = 0;
}
break;
case <API key>:
case <API key>:
#ifdef FEATURE_WLAN_WAPI
case <API key>:
#endif
PrivacyEnabled = (0 != fPrivacy);
RsnEnabled = 1;
Key0Length = 0;
Key1Length = 0;
Key2Length = 0;
Key3Length = 0;
break;
default:
PrivacyEnabled = 0;
RsnEnabled = 0;
break;
}
ccmCfgSetInt(pMac, <API key>, PrivacyEnabled, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, WNI_CFG_RSN_ENABLED, RsnEnabled, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>, Key0, Key0Length, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>, Key1, Key1Length, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>, Key2, Key2Length, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>, Key3, Key3Length, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, WepKeyLength, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, WepDefaultKeyId, NULL, eANI_BOOLEAN_FALSE);
}
static void csrSetCfgSsid( tpAniSirGlobal pMac, tSirMacSSid *pSSID )
{
tANI_U32 len = 0;
if(pSSID->length <= WNI_CFG_SSID_LEN)
{
len = pSSID->length;
}
ccmCfgSetStr(pMac, WNI_CFG_SSID, (tANI_U8 *)pSSID->ssId, len, NULL, eANI_BOOLEAN_FALSE);
}
eHalStatus csrSetQosToCfg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrMediaAccessType qosType )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 QoSEnabled;
tANI_U32 WmeEnabled;
switch( qosType )
{
case <API key>:
QoSEnabled = FALSE;
WmeEnabled = TRUE;
break;
case <API key>:
QoSEnabled = FALSE;
WmeEnabled = TRUE;
break;
case <API key>:
QoSEnabled = FALSE;
WmeEnabled = TRUE;
break;
case <API key>:
QoSEnabled = TRUE;
WmeEnabled = FALSE;
break;
case <API key>:
QoSEnabled = TRUE;
WmeEnabled = FALSE;
break;
default:
case <API key>:
QoSEnabled = FALSE;
WmeEnabled = FALSE;
break;
}
pMac->roam.roamSession[sessionId].fWMMConnection = (tANI_BOOLEAN)WmeEnabled;
pMac->roam.roamSession[sessionId].fQOSConnection = (tANI_BOOLEAN)QoSEnabled;
return (status);
}
static eHalStatus csrGetRateSet( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, eCsrPhyMode phyMode, tSirBssDescription *pBssDesc,
tDot11fBeaconIEs *pIes, tSirMacRateSet *pOpRateSet, tSirMacRateSet *pExRateSet)
{
eHalStatus status = eHAL_STATUS_FAILURE;
int i;
eCsrCfgDot11Mode cfgDot11Mode;
tANI_U8 *pDstRate;
palZeroMemory(pMac->hHdd, pOpRateSet, sizeof(tSirMacRateSet));
palZeroMemory(pMac->hHdd, pExRateSet, sizeof(tSirMacRateSet));
VOS_ASSERT( pIes != NULL );
if( NULL != pIes )
{
csrIsPhyModeMatch( pMac, phyMode, pBssDesc, pProfile, &cfgDot11Mode, pIes );
pDstRate = pOpRateSet->rate;
if(pIes->SuppRates.present)
{
for ( i = 0; i < pIes->SuppRates.num_rates; i++ )
{
if ( <API key>( pMac, pIes->SuppRates.rates[ i ] ) )
{
*pDstRate++ = pIes->SuppRates.rates[ i ];
pOpRateSet->numRates++;
}
}
}
if ( <API key> == cfgDot11Mode ||
<API key> == cfgDot11Mode ||
<API key> == cfgDot11Mode ||
<API key> == cfgDot11Mode )
{
pDstRate = pExRateSet->rate;
if(pIes->ExtSuppRates.present)
{
for ( i = 0; i < pIes->ExtSuppRates.num_rates; i++ )
{
if ( <API key>( pMac, pIes->ExtSuppRates.rates[ i ] ) )
{
*pDstRate++ = pIes->ExtSuppRates.rates[ i ];
pExRateSet->numRates++;
}
}
}
}
}
else
{
smsLog(pMac, LOGE, FL("failed to parse BssDesc"));
}
if (pOpRateSet->numRates > 0 || pExRateSet->numRates > 0) status = eHAL_STATUS_SUCCESS;
return status;
}
static void csrSetCfgRateSet( tpAniSirGlobal pMac, eCsrPhyMode phyMode, tCsrRoamProfile *pProfile,
tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes)
{
int i;
tANI_U8 *pDstRate;
eCsrCfgDot11Mode cfgDot11Mode;
tANI_U8 OperationalRates[ <API key> ];
tANI_U32 <API key> = 0;
tANI_U8 <API key>[ <API key> ];
tANI_U32 <API key> = 0;
tANI_U8 <API key>[ 4 ];
tANI_U32 <API key> = 0;
tANI_U32 PropRatesEnable = 0;
tANI_U8 MCSRateIdxSet[ <API key> ];
tANI_U32 MCSRateLength = 0;
VOS_ASSERT( pIes != NULL );
if( NULL != pIes )
{
csrIsPhyModeMatch( pMac, phyMode, pBssDesc, pProfile, &cfgDot11Mode, pIes );
pDstRate = OperationalRates;
if(pIes->SuppRates.present)
{
for ( i = 0; i < pIes->SuppRates.num_rates; i++ )
{
if ( <API key>( pMac, pIes->SuppRates.rates[ i ] ) &&
( <API key> < <API key> ))
{
*pDstRate++ = pIes->SuppRates.rates[ i ];
<API key>++;
}
}
}
if ( <API key> == cfgDot11Mode ||
<API key> == cfgDot11Mode ||
<API key> == cfgDot11Mode ||
<API key> == cfgDot11Mode )
{
pDstRate = <API key>;
if(pIes->ExtSuppRates.present)
{
for ( i = 0; i < pIes->ExtSuppRates.num_rates; i++ )
{
if ( <API key>( pMac, pIes->ExtSuppRates.rates[ i ] ) &&
( <API key> < <API key> ))
{
*pDstRate++ = pIes->ExtSuppRates.rates[ i ];
<API key>++;
}
}
}
}
if( pIes->Airgo.present && pMac->roam.configParam.<API key> )
{
PropRatesEnable = 1;
}
else
{
PropRatesEnable = 0;
}
if ( PropRatesEnable && pIes->Airgo.PropSuppRates.present &&
( pIes->Airgo.PropSuppRates.num_rates > 0 ))
{
<API key> = pIes->Airgo.PropSuppRates.num_rates;
if ( <API key> > sizeof(<API key>) )
{
<API key> = sizeof (<API key>);
}
palCopyMemory( pMac->hHdd, <API key>, pIes->Airgo.PropSuppRates.rates, <API key> );
}
else {
<API key> = 0;
}
pDstRate = MCSRateIdxSet;
if ( pIes->HTCaps.present )
{
for ( i = 0; i < VALID_MAX_MCS_INDEX; i++ )
{
if ( (unsigned int)pIes->HTCaps.supportedMCSSet[0] & (1 << i) )
{
MCSRateLength++;
*pDstRate++ = i;
}
}
}
ccmCfgSetStr(pMac, <API key>, OperationalRates,
<API key>, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>, <API key>,
<API key>, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>,
<API key>,
<API key>, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, PropRatesEnable, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>, MCSRateIdxSet,
MCSRateLength, NULL, eANI_BOOLEAN_FALSE);
}
else
{
smsLog(pMac, LOGE, FL("failed to parse BssDesc"));
}
}
static void <API key>( tpAniSirGlobal pMac,
tCsrRoamProfile *pProfile )
{
tSirMacRateSetIE <API key> = { SIR_MAC_RATESET_EID,
{ 8,
{ SIR_MAC_RATE_6,
SIR_MAC_RATE_9,
SIR_MAC_RATE_12,
SIR_MAC_RATE_18,
SIR_MAC_RATE_24,
SIR_MAC_RATE_36,
SIR_MAC_RATE_48,
SIR_MAC_RATE_54 } } };
tSirMacRateSetIE <API key> = { SIR_MAC_RATESET_EID,
{ 4,
{ SIR_MAC_RATE_1,
SIR_MAC_RATE_2,
SIR_MAC_RATE_5_5,
SIR_MAC_RATE_11 } } };
tSirMacPropRateSet <API key> = { 3,
{ SIR_MAC_RATE_72,
SIR_MAC_RATE_96,
SIR_MAC_RATE_108 } };
eCsrCfgDot11Mode cfgDot11Mode;
eCsrBand eBand;
tANI_U8 OperationalRates[ <API key> ];
tANI_U32 <API key> = 0;
tANI_U8 <API key>[ <API key> ];
tANI_U32 <API key> = 0;
tANI_U8 <API key>[ 4 ];
tANI_U32 <API key> = 0;
tANI_U32 PropRatesEnable = 0;
tANI_U8 operationChannel = 0;
if(pProfile->ChannelInfo.ChannelList)
{
operationChannel = pProfile->ChannelInfo.ChannelList[0];
}
cfgDot11Mode = <API key>( pMac, pProfile, operationChannel, &eBand );
if ( eCSR_BAND_5G == eBand )
{
<API key> = <API key>.supportedRateSet.numRates *
sizeof(*<API key>.supportedRateSet.rate);
palCopyMemory( pMac->hHdd, OperationalRates,
<API key>.supportedRateSet.rate,
<API key> );
<API key> = 0;
if ( pMac->roam.configParam.<API key> )
{
<API key> = <API key>.numPropRates *
sizeof(*<API key>.propRate);
palCopyMemory( pMac->hHdd, <API key>,
<API key>.propRate,
<API key> );
}
else
{
<API key> = 0;
}
}
else if ( <API key> == cfgDot11Mode )
{
<API key> = <API key>.supportedRateSet.numRates *
sizeof(*<API key>.supportedRateSet.rate);
palCopyMemory( pMac->hHdd, OperationalRates,
<API key>.supportedRateSet.rate,
<API key> );
<API key> = 0;
<API key> = 0;
}
else
{
<API key> = <API key>.supportedRateSet.numRates *
sizeof(*<API key>.supportedRateSet.rate);
palCopyMemory( pMac->hHdd, OperationalRates,
<API key>.supportedRateSet.rate,
<API key> );
<API key> = <API key>.supportedRateSet.numRates *
sizeof(*<API key>.supportedRateSet.rate);
palCopyMemory( pMac->hHdd, <API key>,
<API key>.supportedRateSet.rate,
<API key> );
if ( pMac->roam.configParam.<API key> )
{
<API key> = <API key>.numPropRates *
sizeof(*<API key>.propRate);
palCopyMemory( pMac->hHdd, <API key>,
<API key>.propRate,
<API key> );
}
else
{
<API key> = 0;
}
}
if ( <API key> && pMac->roam.configParam.<API key> )
{
PropRatesEnable = 1;
}
else
{
PropRatesEnable = 0;
}
ccmCfgSetStr(pMac, <API key>, OperationalRates,
<API key>, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>, <API key>,
<API key>, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetStr(pMac, <API key>,
<API key>,
<API key>, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, PropRatesEnable, NULL, eANI_BOOLEAN_FALSE);
}
void <API key>(tHalHandle hHal, tANI_S32 result)
{
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
tListElem *pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK);
tANI_U32 sessionId;
tSmeCmd *pCommand = NULL;
if(NULL == pEntry)
{
smsLog(pMac, LOGW, " CFG_CNF with active list empty");
return;
}
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
sessionId = pCommand->sessionId;
if(CSR_IS_ROAM_JOINING(pMac, sessionId) && <API key>(pMac, sessionId))
{
<API key>(pMac, (tANI_U32)result);
}
}
tANI_U32 <API key>(eCsrCfgDot11Mode dot11Mode, eCsrBand band)
{
if(<API key> == dot11Mode)
{
return (<API key>);
}
else
{
if(eCSR_BAND_24 == band)
return (<API key>);
}
return (<API key>);
}
#ifdef WLAN_FEATURE_11AC
ePhyChanBondState <API key>(ePhyChanBondState aniCBMode)
{
switch ( aniCBMode )
{
case <API key>:
case <API key>:
case <API key>:
return <API key>;
case <API key>:
case <API key>:
case <API key>:
return <API key>;
case <API key>:
default :
return <API key>;
}
}
#endif
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig,
tDot11fBeaconIEs *pIes, tANI_BOOLEAN resetCountry)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 cfgCb = <API key>;
tANI_U8 channel = 0;
if (pBssDesc)
{
if (<API key>(pMac, pBssDesc, pIes, eANI_BOOLEAN_TRUE))
{
pMac->scan.<API key> = eANI_BOOLEAN_FALSE;
if (VOS_TRUE == resetCountry)
{
<API key>(pMac, FALSE);
}
else
{
<API key>(pMac, TRUE);
}
}
if ((csrIs11dSupported (pMac)) && pIes)
{
if (!pIes->Country.present)
{
<API key>(pMac, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE );
}
else
{
palCopyMemory(pMac->hHdd, pMac->scan.currentCountryBssid,
pBssDesc->bssId, sizeof(tSirMacAddr));
}
}
}
csrSetQosToCfg( pMac, sessionId, pBssConfig->qosType );
csrSetCfgSsid(pMac, &pBssConfig->SSID );
ccmCfgSetInt(pMac, <API key>, pBssConfig->authType, NULL, eANI_BOOLEAN_FALSE);
csrSetCfgPrivacy(pMac, pProfile, (tANI_BOOLEAN)pBssConfig->BssCap.privacy );
ccmCfgSetInt(pMac, <API key>, pBssConfig->uShortSlotTime, NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, WNI_CFG_11D_ENABLED,
((pBssConfig->f11hSupport) ? pBssConfig->f11hSupport : pProfile->ieee80211d),
NULL, eANI_BOOLEAN_FALSE);
ccmCfgSetInt(pMac, <API key>, pBssConfig->uPowerLimit, NULL, eANI_BOOLEAN_FALSE);
if(CSR_IS_INFRA_AP(pProfile) || CSR_IS_WDS_AP(pProfile) || CSR_IS_IBSS(pProfile))
{
channel = pProfile->operationChannel;
}
else
{
if(pBssDesc)
{
channel = pBssDesc->channelId;
}
}
if(0 != channel)
{
if(<API key>(channel))
{
cfgCb = <API key>;
}
else
{
cfgCb = pBssConfig->cbMode;
}
}
#ifdef WLAN_FEATURE_11AC
if(cfgCb > <API key>)
{
if(!<API key>(DOT11AC)) {
cfgCb = <API key>(cfgCb);
}
else
{
ccmCfgSetInt(pMac, <API key>, pMac->roam.configParam.nVhtChannelWidth, NULL, eANI_BOOLEAN_FALSE);
}
}
else
#endif
ccmCfgSetInt(pMac, <API key>, cfgCb, NULL, eANI_BOOLEAN_FALSE);
if(pBssDesc)
{
csrSetCfgRateSet(pMac, (eCsrPhyMode)pProfile->phyMode, pProfile, pBssDesc, pIes);
}
else
{
<API key>(pMac, pProfile);
}
<API key>( pMac, <API key>, sessionId );
ccmCfgSetInt(pMac, <API key>, pBssConfig->uJoinTimeOut, (tCcmCfgSetCallback)<API key>, eANI_BOOLEAN_FALSE);
return (status);
}
eHalStatus csrRoamStopNetwork( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes)
{
eHalStatus status;
tBssConfigParam *pBssConfig;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
status = palAllocateMemory(pMac->hHdd, (void **)&pBssConfig, sizeof(tBssConfigParam));
if(HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, pBssConfig, sizeof(tBssConfigParam));
status = <API key>(pMac, pProfile, pBssDesc, pBssConfig, pIes);
if(HAL_STATUS_SUCCESS(status))
{
pSession->bssParams.uCfgDot11Mode = pBssConfig->uCfgDot11Mode;
pSession->bssParams.cbMode= pBssConfig->cbMode;
if( csrIsBssTypeIBSS(pProfile->BSSType) || CSR_IS_WDS( pProfile )
|| CSR_IS_INFRA_AP(pProfile)
)
{
<API key>(pMac, sessionId, pProfile, pBssDesc, pBssConfig, pIes);
}
if ( csrIsConnStateIbss( pMac, sessionId ) )
{
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
}
else
{
if ( csrIsConnStateInfra( pMac, sessionId ) )
{
if ( pBssDesc && ( ( csrIsIbssBssDesc( pBssDesc ) ) ||
!csrIsSsidEqual( pMac, pSession->pConnectBssDesc, pBssDesc, pIes ) ) )
{
status = <API key>( pMac, sessionId,
<API key>, FALSE );
}
else
{
if ( pBssDesc )
{
status = <API key>(pMac, sessionId, pProfile,
pBssDesc, pBssConfig,
pIes, eANI_BOOLEAN_FALSE);
}
}
}
else
{
if ( pBssDesc || CSR_IS_WDS_AP( pProfile )
|| CSR_IS_INFRA_AP(pProfile)
)
{
tANI_BOOLEAN is11rRoamingFlag = eANI_BOOLEAN_FALSE;
is11rRoamingFlag = csrRoamIs11rAssoc(pMac);
status = <API key>(pMac, sessionId, pProfile,
pBssDesc, pBssConfig,
pIes, is11rRoamingFlag);
}
}
}
}
palFreeMemory(pMac->hHdd, pBssConfig);
}
return (status);
}
eCsrJoinState csrRoamJoin( tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrScanResultInfo *pScanResult, tCsrRoamProfile *pProfile )
{
eCsrJoinState eRoamState = eCsrContinueRoaming;
eHalStatus status;
tSirBssDescription *pBssDesc = &pScanResult->BssDescriptor;
tDot11fBeaconIEs *pIesLocal = (tDot11fBeaconIEs *)( pScanResult->pvIes );
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return (eCsrStopRoaming);
}
if( CSR_IS_WDS_STA( pProfile ) )
{
status = csrRoamStartWds( pMac, sessionId, pProfile, pBssDesc );
if( !HAL_STATUS_SUCCESS( status ) )
{
eRoamState = eCsrStopRoaming;
}
}
else
{
if( !pIesLocal && (!HAL_STATUS_SUCCESS(<API key>(pMac, pBssDesc, &pIesLocal))) )
{
smsLog(pMac, LOGE, FL(" fail to parse IEs"));
return (eCsrStopRoaming);
}
if ( csrIsInfraBssDesc( pBssDesc ) )
{
if ( <API key>(pMac, sessionId) &&
csrIsBssIdEqual( pMac, pBssDesc, pSession->pConnectBssDesc ) &&
csrIsSsidEqual( pMac, pSession->pConnectBssDesc, pBssDesc, pIesLocal )
)
{
if(csrIsSameProfile(pMac, &pSession->connectedProfile, pProfile))
{
smsLog(pMac, LOGW, FL(" detect same profile authType = %d encryType = %d"), pProfile->AuthType, pProfile->EncryptionType);
if(<API key>(pMac, &pSession->connectedProfile, pProfile))
{
eRoamState = <API key>;
}
else
{
tBssConfigParam bssConfig;
palZeroMemory(pMac->hHdd, &bssConfig, sizeof(bssConfig));
status = <API key>(pMac, pProfile, pBssDesc, &bssConfig, pIesLocal);
if(HAL_STATUS_SUCCESS(status))
{
pSession->bssParams.uCfgDot11Mode = bssConfig.uCfgDot11Mode;
pSession->bssParams.cbMode = bssConfig.cbMode;
status = <API key>(pMac, sessionId, pProfile,
pBssDesc, &bssConfig,
pIesLocal, eANI_BOOLEAN_FALSE);
if(!HAL_STATUS_SUCCESS(status))
{
eRoamState = eCsrStopRoaming;
}
}
else
{
eRoamState = eCsrStopRoaming;
}
}
}
else
{
if(!HAL_STATUS_SUCCESS(<API key>( pMac, sessionId,
<API key>, FALSE )))
{
smsLog(pMac, LOGW, FL(" fail to issue disassociate"));
eRoamState = eCsrStopRoaming;
}
}
}
else
{
if(!HAL_STATUS_SUCCESS(csrRoamStopNetwork(pMac, sessionId, pProfile, pBssDesc, pIesLocal)))
{
eRoamState = eCsrStopRoaming;
}
}
}
else
{
if(!HAL_STATUS_SUCCESS(csrRoamStopNetwork(pMac, sessionId, pProfile, pBssDesc, pIesLocal)))
{
eRoamState = eCsrStopRoaming;
}
}
if( pIesLocal && !pScanResult->pvIes )
{
palFreeMemory(pMac->hHdd, pIesLocal);
}
}
return( eRoamState );
}
eHalStatus csrRoamShouldRoam(tpAniSirGlobal pMac, tANI_U32 sessionId,
tSirBssDescription *pBssDesc, tANI_U32 roamId)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamInfo roamInfo;
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.pBssDesc = pBssDesc;
status = csrRoamCallCallback(pMac, sessionId, &roamInfo, roamId, <API key>, <API key>);
return (status);
}
static void <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
switch( pCommand->u.roamCmd.roamProfile.AuthType.authType[0] )
{
default:
case eCSR_AUTH_TYPE_WPA:
case <API key>:
case <API key>:
case eCSR_<API key>:
pCommand->u.roamCmd.roamProfile.negotiatedAuthType = eCSR_<API key>;
break;
case eCSR_<API key>:
pCommand->u.roamCmd.roamProfile.negotiatedAuthType = eCSR_<API key>;
break;
case eCSR_<API key>:
pCommand->u.roamCmd.roamProfile.negotiatedAuthType = eCSR_<API key>;
break;
}
pCommand->u.roamCmd.roamProfile.<API key> =
pCommand->u.roamCmd.roamProfile.EncryptionType.encryptionType[0];
pCommand->u.roamCmd.roamProfile.<API key> =
pCommand->u.roamCmd.roamProfile.EncryptionType.encryptionType[0];
}
static void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
switch(pCommand->u.roamCmd.roamReason)
{
case eCsrLostLink1:
pCommand->u.roamCmd.roamReason = eCsrLostLink1Abort;
break;
case eCsrLostLink2:
pCommand->u.roamCmd.roamReason = eCsrLostLink2Abort;
break;
case eCsrLostLink3:
pCommand->u.roamCmd.roamReason = eCsrLostLink3Abort;
break;
default:
smsLog(pMac, LOGE, FL(" aborting roaming reason %d not recognized"),
pCommand->u.roamCmd.roamReason);
break;
}
}
static eCsrJoinState csrRoamJoinNextBss( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fUseSameBss )
{
eHalStatus status;
tCsrScanResult *pScanResult = NULL;
eCsrJoinState eRoamState = eCsrStopRoaming;
tScanResultList *pBSSList = (tScanResultList *)pCommand->u.roamCmd.hBSSList;
tANI_BOOLEAN fDone = eANI_BOOLEAN_FALSE;
tCsrRoamInfo roamInfo, *pRoamInfo = NULL;
#ifndef <API key>
v_U8_t acm_mask = 0;
#endif
tANI_U32 sessionId = pCommand->sessionId;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tCsrRoamProfile *pProfile = &pCommand->u.roamCmd.roamProfile;
tANI_U8 concurrentChannel = 0;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return (eCsrStopRoaming);
}
do
{
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(roamInfo));
memcpy (&roamInfo.bssid, &pSession->joinFailStatusCode.bssId, sizeof(tSirMacAddr));
if(NULL != pBSSList)
{
if((eANI_BOOLEAN_FALSE == fUseSameBss) || (pCommand->u.roamCmd.pRoamBssEntry == NULL))
{
if(pCommand->u.roamCmd.pRoamBssEntry == NULL)
{
pCommand->u.roamCmd.pLastRoamBss = NULL;
pCommand->u.roamCmd.pRoamBssEntry = csrLLPeekHead(&pBSSList->List, LL_ACCESS_LOCK);
}
else
{
pCommand->u.roamCmd.pRoamBssEntry = csrLLNext(&pBSSList->List, pCommand->u.roamCmd.pRoamBssEntry, LL_ACCESS_LOCK);
if(NULL == pCommand->u.roamCmd.pRoamBssEntry)
{
break;
}
else
{
roamInfo.pBssDesc = pCommand->u.roamCmd.pLastRoamBss;
roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
pRoamInfo = &roamInfo;
}
}
while(pCommand->u.roamCmd.pRoamBssEntry)
{
pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link);
if (<API key>() &&
!<API key>(pMac, sessionId, &pScanResult->Result.BssDescriptor))
{
concurrentChannel =
<API key>(pMac);
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "%s: "
" csr Concurrent Channel = %d", __func__, concurrentChannel);
if ((concurrentChannel) &&
(concurrentChannel ==
pScanResult->Result.BssDescriptor.channelId))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
FL("Concurrent channel match =%d"),
concurrentChannel);
concurrentChannel = 0;
}
}
if (!concurrentChannel)
{
if(HAL_STATUS_SUCCESS(csrRoamShouldRoam(pMac,
sessionId, &pScanResult->Result.BssDescriptor,
pCommand->u.roamCmd.roamId)))
{
break;
}
}
else
{
eRoamState = <API key>;
}
pCommand->u.roamCmd.pRoamBssEntry = csrLLNext(&pBSSList->List, pCommand->u.roamCmd.pRoamBssEntry, LL_ACCESS_LOCK);
if(NULL == pCommand->u.roamCmd.pRoamBssEntry)
{
fDone = eANI_BOOLEAN_TRUE;
break;
}
}
if(fDone)
{
break;
}
}
}
if( <API key>( pProfile ) )
{
if(pRoamInfo)
{
if(pSession->bRefAssocStartCnt)
{
pSession->bRefAssocStartCnt
csrRoamCallCallback(pMac, sessionId, pRoamInfo, pCommand->u.roamCmd.roamId,
<API key>,
<API key>);
}
}
if ( !CSR_IS_ROAMING(pSession) && <API key>(pCommand) )
{
smsLog(pMac, LOGW, FL(" Roam command (reason %d) aborted due to roaming completed"),
pCommand->u.roamCmd.roamReason);
eRoamState = eCsrStopRoaming;
<API key>(pMac, pCommand);
break;
}
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(roamInfo));
if(pScanResult)
{
tDot11fBeaconIEs *pIesLocal = (tDot11fBeaconIEs *)pScanResult->Result.pvIes;
if( !pIesLocal && (!HAL_STATUS_SUCCESS(<API key>(pMac, &pScanResult->Result.BssDescriptor, &pIesLocal))) )
{
smsLog(pMac, LOGE, FL(" cannot parse IEs"));
fDone = eANI_BOOLEAN_TRUE;
eRoamState = eCsrStopRoaming;
break;
}
roamInfo.pBssDesc = &pScanResult->Result.BssDescriptor;
pCommand->u.roamCmd.pLastRoamBss = roamInfo.pBssDesc;
if( pCommand->u.roamCmd.roamProfile.uapsd_mask &&
CSR_IS_QOS_BSS(pIesLocal) &&
CSR_IS_UAPSD_BSS(pIesLocal) )
{
#ifndef <API key>
acm_mask = sme_QosGetACMMask(pMac, &pScanResult->Result.BssDescriptor,
pIesLocal);
pCommand->u.roamCmd.roamProfile.uapsd_mask &= ~(acm_mask);
#endif
}
else
{
pCommand->u.roamCmd.roamProfile.uapsd_mask = 0;
}
if( pIesLocal && !pScanResult->Result.pvIes)
{
palFreeMemory(pMac->hHdd, pIesLocal);
}
}
else
{
pCommand->u.roamCmd.roamProfile.uapsd_mask = 0;
}
roamInfo.pProfile = pProfile;
pSession->bRefAssocStartCnt++;
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
<API key>, <API key> );
}
if ( NULL == pCommand->u.roamCmd.pRoamBssEntry )
{
if ( CSR_IS_START_IBSS(pProfile) )
{
tANI_BOOLEAN fSameIbss = eANI_BOOLEAN_FALSE;
<API key>( pMac, pCommand );
status = csrRoamStartIbss( pMac, sessionId, pProfile, &fSameIbss );
if(HAL_STATUS_SUCCESS(status))
{
if ( fSameIbss )
{
eRoamState = <API key>;
}
else
{
eRoamState = eCsrContinueRoaming;
}
}
else
{
eRoamState = eCsrStopRoaming;
}
break;
}
else if ( (CSR_IS_WDS_AP(pProfile))
|| (CSR_IS_INFRA_AP(pProfile))
)
{
<API key>( pMac, pCommand );
status = csrRoamStartWds( pMac, sessionId, pProfile, NULL );
if(HAL_STATUS_SUCCESS(status))
{
eRoamState = eCsrContinueRoaming;
}
else
{
eRoamState = eCsrStopRoaming;
}
}
else
{
smsLog(pMac, LOGW, FL("cannot continue without BSS list"));
eRoamState = eCsrStopRoaming;
break;
}
}
else
{
pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link);
pCommand->u.roamCmd.roamProfile.<API key> = pScanResult->ucEncryptionType;
pCommand->u.roamCmd.roamProfile.<API key> = pScanResult->mcEncryptionType;
pCommand->u.roamCmd.roamProfile.negotiatedAuthType = pScanResult->authType;
if ( CSR_IS_START_IBSS(&pCommand->u.roamCmd.roamProfile) )
{
if(csrIsSameProfile(pMac, &pSession->connectedProfile, pProfile))
{
eRoamState = <API key>;
break;
}
}
if( pCommand->u.roamCmd.<API key> )
{
pCommand->u.roamCmd.<API key> = eANI_BOOLEAN_FALSE;
eRoamState = <API key>;
break;
}
eRoamState = csrRoamJoin( pMac, sessionId, &pScanResult->Result, pProfile );
break;
}
} while( 0 );
if( (eCsrStopRoaming == eRoamState) && (<API key>( pProfile )) )
{
if(pSession->bRefAssocStartCnt > 0)
{
pSession->bRefAssocStartCnt
pRoamInfo = &roamInfo;
csrRoamCallCallback(pMac, sessionId, pRoamInfo, pCommand->u.roamCmd.roamId,
<API key>,
<API key>);
}
}
return( eRoamState );
}
static eHalStatus csrRoam( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
eCsrJoinState RoamState;
tANI_U32 sessionId = pCommand->sessionId;
{
RoamState = csrRoamJoinNextBss( pMac, pCommand, eANI_BOOLEAN_FALSE );
if (( eCsrStopRoaming == RoamState ) || ( <API key> == RoamState))
{
tANI_BOOLEAN fComplete = eANI_BOOLEAN_FALSE;
if ( csrIsConnStateInfra(pMac, sessionId) )
{
status = <API key>( pMac, sessionId, <API key>, FALSE );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, FL(" failed to issue disassociate, status = %d"), status);
fComplete = eANI_BOOLEAN_TRUE;
}
}
else if( csrIsConnStateIbss(pMac, sessionId) )
{
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, FL(" failed to issue stop bss, status = %d"), status);
fComplete = eANI_BOOLEAN_TRUE;
}
}
else if (<API key>(pMac, sessionId))
{
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, FL(" failed to issue stop bss, status = %d"), status);
fComplete = eANI_BOOLEAN_TRUE;
}
}
else
{
fComplete = eANI_BOOLEAN_TRUE;
}
if(fComplete)
{
if(<API key> == RoamState)
{
csrRoamComplete( pMac, <API key>, NULL );
}
else
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
}
}
else if ( <API key> == RoamState )
{
csrRoamComplete( pMac, <API key>, NULL );
}
else if ( <API key> == RoamState )
{
csrRoamComplete( pMac, <API key>, NULL );
}
}
return status;
}
eHalStatus <API key> ( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
tANI_U32 sessionId;
tCsrRoamSession *pSession;
tCsrScanResult *pScanResult = NULL;
tSirBssDescription *pBssDesc = NULL;
eHalStatus status = eHAL_STATUS_SUCCESS;
sessionId = pCommand->sessionId;
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(CSR_IS_ROAMING(pSession) && pSession->fCancelRoaming)
{
smsLog(pMac, LOG1, FL(" Roam command cancelled"));
csrRoamComplete(pMac, eCsrNothingToJoin, NULL);
return eHAL_STATUS_FAILURE;
}
if (pCommand->u.roamCmd.pRoamBssEntry)
{
pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link);
pBssDesc = &pScanResult->Result.BssDescriptor;
}
else
{
smsLog(pMac, LOG1, FL(" Roam command cancelled"));
csrRoamComplete(pMac, eCsrNothingToJoin, NULL);
return eHAL_STATUS_FAILURE;
}
status = <API key>(pMac, sessionId, pBssDesc,
(tDot11fBeaconIEs *)( pScanResult->Result.pvIes ), &pCommand->u.roamCmd.roamProfile);
return status;
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamInfo roamInfo;
tANI_U32 sessionId = pCommand->sessionId;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
switch ( pCommand->u.roamCmd.roamReason )
{
case eCsrForcedDisassoc:
status = <API key>( pMac, pCommand, TRUE, FALSE );
csrFreeRoamProfile(pMac, sessionId);
break;
case <API key>:
#if 0
status = <API key>( pMac, pCommand, FALSE );
#else
status = <API key>( pMac, pCommand, TRUE, FALSE );
#endif
break;
case <API key>:
status = <API key>( pMac, pCommand, TRUE, TRUE );
csrFreeRoamProfile(pMac, sessionId);
break;
case eCsrForcedDeauth:
status = <API key>( pMac, pCommand, FALSE, FALSE );
csrFreeRoamProfile(pMac, sessionId);
break;
case <API key>:
case <API key>:
{
tDot11fBeaconIEs *pIes = NULL;
if( pSession->pConnectBssDesc )
{
status = <API key>(pMac, pSession->pConnectBssDesc, &pIes);
if(!HAL_STATUS_SUCCESS(status) )
{
smsLog(pMac, LOGE, FL(" fail to parse IEs"));
}
else
{
roamInfo.reasonCode = <API key>;
csrRoamCallCallback(pMac, pSession->sessionId, &roamInfo, 0, <API key>, <API key>);
pSession->roamingReason = eCsrReassocRoaming;
roamInfo.pBssDesc = pSession->pConnectBssDesc;
roamInfo.pProfile = &pCommand->u.roamCmd.roamProfile;
pSession->bRefAssocStartCnt++;
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
<API key>, <API key> );
smsLog(pMac, LOG1, FL(" calling <API key>"));
status = <API key>( pMac, sessionId, pSession->pConnectBssDesc, pIes,
&pCommand->u.roamCmd.roamProfile );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("<API key> failed with status %d"), status);
<API key>( pMac, pCommand );
}
palFreeMemory(pMac->hHdd, pIes);
pIes = NULL;
}
}
break;
}
case eCsrCapsChange:
smsLog(pMac, LOGE, FL("received eCsrCapsChange "));
csrRoamStateChange( pMac, <API key>, sessionId );
status = <API key>( pMac, sessionId, <API key>, FALSE);
break;
case <API key>:
smsLog(pMac, LOG1, FL("received FT Reassoc Req "));
status = <API key>(pMac, pCommand);
break;
case eCsrStopBss:
csrRoamStateChange( pMac, <API key>, sessionId);
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
break;
case <API key>:
csrRoamStateChange( pMac, <API key>, sessionId);
<API key>( pMac, <API key>, sessionId);
status = <API key>( pMac, sessionId, pCommand->u.roamCmd.peerMac,
pCommand->u.roamCmd.reason);
break;
case eCsrForcedDeauthSta:
csrRoamStateChange( pMac, <API key>, sessionId);
<API key>( pMac, <API key>, sessionId);
status = <API key>( pMac, sessionId, pCommand->u.roamCmd.peerMac,
pCommand->u.roamCmd.reason);
break;
case eCsrPerformPreauth:
smsLog(pMac, LOG1, FL("Attempting FT PreAuth Req"));
status = <API key>(pMac, sessionId,
pCommand->u.roamCmd.pLastRoamBss);
break;
default:
csrRoamStateChange( pMac, <API key>, sessionId );
if( pCommand->u.roamCmd.<API key> )
{
csrFreeRoamProfile(pMac, sessionId);
if(HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd, (void **)&pSession->pCurRoamProfile, sizeof(tCsrRoamProfile))))
{
palZeroMemory(pMac->hHdd, pSession->pCurRoamProfile, sizeof(tCsrRoamProfile));
csrRoamCopyProfile(pMac, pSession->pCurRoamProfile, &pCommand->u.roamCmd.roamProfile);
}
}
status = csrRoam( pMac, pCommand );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, FL("csrRoam() failed with status = 0x%08X"), status);
}
break;
}
return (status);
}
void csrReinitPreauthCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
pCommand->u.roamCmd.pLastRoamBss = NULL;
pCommand->u.roamCmd.pRoamBssEntry = NULL;
palZeroMemory(pMac->hHdd, &pCommand->u.roamCmd, sizeof(tRoamCmd));
}
void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
if(pCommand->u.roamCmd.fReleaseBssList)
{
csrScanResultPurge(pMac, pCommand->u.roamCmd.hBSSList);
pCommand->u.roamCmd.fReleaseBssList = eANI_BOOLEAN_FALSE;
pCommand->u.roamCmd.hBSSList = <API key>;
}
if(pCommand->u.roamCmd.fReleaseProfile)
{
csrReleaseProfile(pMac, &pCommand->u.roamCmd.roamProfile);
pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_FALSE;
}
pCommand->u.roamCmd.pRoamBssEntry = NULL;
palZeroMemory(pMac->hHdd, &pCommand->u.roamCmd, sizeof(tRoamCmd));
}
void <API key>(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
palZeroMemory(pMac->hHdd, &pCommand->u.wmStatusChangeCmd, sizeof(tWmStatusChangeCmd));
}
void csrRoamComplete( tpAniSirGlobal pMac, <API key> Result, void *Context )
{
tListElem *pEntry;
tSmeCmd *pCommand;
tANI_BOOLEAN fReleaseCommand = eANI_BOOLEAN_TRUE;
smsLog( pMac, LOG2, "Roam Completion ..." );
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if ( pEntry )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if ( eSmeCommandRoam == pCommand->command )
{
fReleaseCommand = <API key>( pMac, pCommand, Result, Context );
if( fReleaseCommand )
{
if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) )
{
<API key>( pMac, pCommand );
}
else
{
smsLog( pMac, LOGE, " **********csrRoamComplete fail to release command reason %d",
pCommand->u.roamCmd.roamReason );
}
}
else
{
smsLog( pMac, LOGE, " **********csrRoamComplete fail to release command reason %d",
pCommand->u.roamCmd.roamReason );
}
}
else
{
smsLog( pMac, LOGW, "CSR: Roam Completion called but ROAM command is not ACTIVE ..." );
}
}
else
{
smsLog( pMac, LOGW, "CSR: Roam Completion called but NO commands are ACTIVE ..." );
}
if( fReleaseCommand )
{
<API key>( pMac );
}
}
void <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId )
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
palZeroMemory( pMac->hHdd, &(pSession->PmkidCandidateInfo[0]), sizeof(tPmkidCandidateInfo) * <API key> );
pSession->NumPmkidCandidate = 0;
}
#ifdef FEATURE_WLAN_WAPI
void <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId )
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
palZeroMemory( pMac->hHdd, &(pSession->BkidCandidateInfo[0]), sizeof(tBkidCandidateInfo) * <API key> );
pSession->NumBkidCandidate = 0;
}
#endif
extern tANI_U8 csrWpaOui[][ CSR_WPA_OUI_SIZE ];
static eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrAuthType authType,
tSirBssDescription *pSirBssDesc,
tDot11fBeaconIEs *pIes)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tDot11fBeaconIEs *pIesLocal = pIes;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if((eCSR_AUTH_TYPE_WPA == authType) ||
(<API key> == authType) ||
(eCSR_AUTH_TYPE_RSN == authType) ||
(<API key> == authType)
#if defined <API key>
||
(<API key> == authType) ||
(eCSR_<API key> == authType)
#endif
#ifdef FEATURE_WLAN_WAPI
||
(eCSR_<API key> == authType) ||
(eCSR_<API key> == authType)
#endif
#ifdef WLAN_FEATURE_11W
||
(eCSR_<API key> == authType)
#endif
)
{
if( !pIesLocal && (!HAL_STATUS_SUCCESS(<API key>(pMac, pSirBssDesc, &pIesLocal))) )
{
smsLog(pMac, LOGE, FL(" cannot parse IEs"));
}
if( pIesLocal )
{
tANI_U32 nIeLen;
tANI_U8 *pIeBuf;
if((eCSR_AUTH_TYPE_RSN == authType) ||
#if defined <API key>
(<API key> == authType) ||
(eCSR_<API key> == authType) ||
#endif
#if defined WLAN_FEATURE_11W
(eCSR_<API key> == authType) ||
#endif
(<API key> == authType))
{
if(pIesLocal->RSN.present)
{
nIeLen = 8
+ pIesLocal->RSN.<API key> * 4
+ 2
+ pIesLocal->RSN.akm_suite_count * 4
+ 2;
if( pIesLocal->RSN.pmkid_count )
{
nIeLen += 2 + pIesLocal->RSN.pmkid_count * 4;
}
if(HAL_STATUS_SUCCESS((status = palAllocateMemory(pMac->hHdd, (void **)&pSession->pWpaRsnRspIE, nIeLen + 2))))
{
palZeroMemory(pMac->hHdd, pSession->pWpaRsnRspIE, nIeLen + 2);
pSession->pWpaRsnRspIE[0] = DOT11F_EID_RSN;
pSession->pWpaRsnRspIE[1] = (tANI_U8)nIeLen;
pIeBuf = pSession->pWpaRsnRspIE + 2;
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->RSN.version, sizeof(pIesLocal->RSN.version));
pIeBuf += sizeof(pIesLocal->RSN.version);
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->RSN.gp_cipher_suite, sizeof(pIesLocal->RSN.gp_cipher_suite));
pIeBuf += sizeof(pIesLocal->RSN.gp_cipher_suite);
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->RSN.<API key>, sizeof(pIesLocal->RSN.<API key>));
pIeBuf += sizeof(pIesLocal->RSN.<API key> );
if( pIesLocal->RSN.<API key> )
{
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->RSN.pwise_cipher_suites,
pIesLocal->RSN.<API key> * 4);
pIeBuf += pIesLocal->RSN.<API key> * 4;
}
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->RSN.akm_suite_count, 2);
pIeBuf += 2;
if( pIesLocal->RSN.akm_suite_count )
{
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->RSN.akm_suites,
pIesLocal->RSN.akm_suite_count * 4);
pIeBuf += pIesLocal->RSN.akm_suite_count * 4;
}
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->RSN.akm_suites +
pIesLocal->RSN.akm_suite_count * 4,
2 + pIesLocal->RSN.pmkid_count * 4);
pSession->nWpaRsnRspIeLength = nIeLen + 2;
}
}
}
else if((eCSR_AUTH_TYPE_WPA == authType) ||
(<API key> == authType))
{
if(pIesLocal->WPA.present)
{
nIeLen = 12
+ pIesLocal->WPA.<API key> * 4
+ 2
+ pIesLocal->WPA.auth_suite_count * 4;
if(HAL_STATUS_SUCCESS((status = palAllocateMemory(pMac->hHdd, (void **)&pSession->pWpaRsnRspIE, nIeLen + 2))))
{
pSession->pWpaRsnRspIE[0] = DOT11F_EID_WPA;
pSession->pWpaRsnRspIE[1] = (tANI_U8)nIeLen;
pIeBuf = pSession->pWpaRsnRspIE + 2;
palCopyMemory(pMac->hHdd, pIeBuf, &csrWpaOui[1], 4);
pIeBuf += 4;
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->WPA.version, 8 +
pIesLocal->WPA.<API key> * 4);
pIeBuf += 8 + pIesLocal->WPA.<API key> * 4;
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->WPA.auth_suite_count, 2 +
pIesLocal->WPA.auth_suite_count * 4);
pIeBuf += pIesLocal->WPA.auth_suite_count * 4;
pSession->nWpaRsnRspIeLength = nIeLen + 2;
}
}
}
#ifdef FEATURE_WLAN_WAPI
else if((eCSR_<API key> == authType) ||
(eCSR_<API key> == authType))
{
if(pIesLocal->WAPI.present)
{
nIeLen = 4
+ pIesLocal->WAPI.akm_suite_count * 4
+ 2
+ pIesLocal->WAPI.<API key> * 4
+ 6;
if( pIesLocal->WAPI.bkid_count )
{
nIeLen += 2 + pIesLocal->WAPI.bkid_count * 4;
}
if(HAL_STATUS_SUCCESS((status = palAllocateMemory(pMac->hHdd, (void **)&pSession->pWapiRspIE, nIeLen + 2))))
{
pSession->pWapiRspIE[0] = DOT11F_EID_WAPI;
pSession->pWapiRspIE[1] = (tANI_U8)nIeLen;
pIeBuf = pSession->pWapiRspIE + 2;
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->WAPI.version, 2);
pIeBuf += 4;
if( pIesLocal->WAPI.akm_suite_count )
{
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->WAPI.akm_suites,
pIesLocal->WAPI.akm_suite_count * 4);
pIeBuf += pIesLocal->WAPI.akm_suite_count * 4;
}
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->WAPI.<API key>, 2);
pIeBuf += 2;
if( pIesLocal->WAPI.<API key> )
{
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->WAPI.<API key>,
pIesLocal->WAPI.<API key> * 4);
pIeBuf += pIesLocal->WAPI.<API key> * 4;
}
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->WAPI.<API key>, 4);
pIeBuf += 4;
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->WAPI.<API key> + 4, 2);
pIeBuf += 2;
palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->WAPI.bkid_count, 2);
pIeBuf += 2;
if( pIesLocal->WAPI.bkid_count )
{
palCopyMemory(pMac->hHdd, pIeBuf, pIesLocal->WAPI.bkid, pIesLocal->WAPI.bkid_count * 4);
pIeBuf += pIesLocal->WAPI.bkid_count * 4;
}
pSession->nWapiRspIeLength = nIeLen + 2;
}
}
}
#endif
if( !pIes )
{
palFreeMemory(pMac->hHdd, pIesLocal);
}
}
}
return (status);
}
static void <API key>( tpAniSirGlobal pMac, tDot11fBeaconIEs *pIEs )
{
v_U8_t bACWeights[WLANTL_MAX_AC];
v_U8_t paramBk, paramBe, paramVi, paramVo;
v_BOOL_t fWeightChange = VOS_FALSE;
if( pIEs->WMMParams.present )
{
bACWeights[WLANTL_AC_BK] = pMac->roam.ucACWeights[WLANTL_AC_BK];
bACWeights[WLANTL_AC_BE] = pMac->roam.ucACWeights[WLANTL_AC_BE];
bACWeights[WLANTL_AC_VI] = pMac->roam.ucACWeights[WLANTL_AC_VI];
bACWeights[WLANTL_AC_VO] = pMac->roam.ucACWeights[WLANTL_AC_VO];
paramBk = pIEs->WMMParams.acbk_aifsn + pIEs->WMMParams.acbk_acwmin;
paramBe = pIEs->WMMParams.acbe_aifsn + pIEs->WMMParams.acbe_acwmin;
paramVi = pIEs->WMMParams.acvi_aifsn + pIEs->WMMParams.acvi_acwmin;
paramVo = pIEs->WMMParams.acvo_aifsn + pIEs->WMMParams.acvo_acwmin;
if( <API key>(paramBk, paramBe) )
{
bACWeights[WLANTL_AC_BE] = bACWeights[WLANTL_AC_BK];
fWeightChange = VOS_TRUE;
}
if( <API key>(paramBk, paramVi) )
{
bACWeights[WLANTL_AC_VI] = bACWeights[WLANTL_AC_BK];
fWeightChange = VOS_TRUE;
}
else if( <API key>(paramBe, paramVi) )
{
bACWeights[WLANTL_AC_VI] = bACWeights[WLANTL_AC_BE];
fWeightChange = VOS_TRUE;
}
if( <API key>(paramBk, paramVo) )
{
bACWeights[WLANTL_AC_VO] = bACWeights[WLANTL_AC_BK];
fWeightChange = VOS_TRUE;
}
else if( <API key>(paramBe, paramVo) )
{
bACWeights[WLANTL_AC_VO] = bACWeights[WLANTL_AC_BE];
fWeightChange = VOS_TRUE;
}
else if( <API key>(paramVi, paramVo) )
{
bACWeights[WLANTL_AC_VO] = bACWeights[WLANTL_AC_VI];
fWeightChange = VOS_TRUE;
}
if(fWeightChange)
{
smsLog(pMac, LOGE, FL(" change AC weights (%d-%d-%d-%d)"), bACWeights[0], bACWeights[1],
bACWeights[2], bACWeights[3]);
WLANTL_SetACWeights(pMac->roam.gVosContext, bACWeights);
}
}
}
#ifdef <API key>
tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac)
{
#ifdef <API key>
return <API key>(pMac);
#else
return eANI_BOOLEAN_FALSE;
#endif
}
#endif
#ifdef FEATURE_WLAN_CCX
tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac)
{
#ifdef <API key>
return <API key>(pMac);
#else
return eANI_BOOLEAN_FALSE;
#endif
}
#endif
#ifdef FEATURE_WLAN_LFR
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
tCsrRoamSession *pSession = NULL;
if (<API key>( pMac, sessionId ) )
{
pSession = CSR_GET_SESSION( pMac, sessionId );
if (NULL != pSession->pCurRoamProfile)
{
if (pSession->pCurRoamProfile->csrPersona != VOS_STA_MODE)
{
return eANI_BOOLEAN_FALSE;
}
}
}
#ifdef <API key>
if (eANI_BOOLEAN_TRUE == <API key>(pMac))
{
return (pMac->roam.configParam.<API key>);
}
else
#endif
{
return (pMac->roam.configParam.<API key> &&
(!<API key>(pMac)));
}
}
#ifdef FEATURE_WLAN_CCX
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac)
{
return pMac->roam.neighborRoamInfo.isCCXAssoc;
}
#endif
#ifdef <API key>
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac)
{
return (pMac->roam.configParam.<API key>);
}
#endif
#endif
#if defined(FEATURE_WLAN_CCX)
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac)
{
return pMac->roam.configParam.<API key>;
}
#endif
static tANI_BOOLEAN <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand,
<API key> Result, void *Context )
{
tANI_BOOLEAN fReleaseCommand = eANI_BOOLEAN_TRUE;
tSirBssDescription *pSirBssDesc = NULL;
tSirMacAddr BroadcastMac = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
tCsrScanResult *pScanResult = NULL;
tCsrRoamInfo roamInfo;
sme_QosAssocInfo assocInfo;
<API key> ind_qos;
tANI_U8 acm_mask = 0;
tDot11fBeaconIEs *pIes = NULL;
tANI_U32 sessionId = pCommand->sessionId;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tCsrRoamProfile *pProfile = &pCommand->u.roamCmd.roamProfile;
eRoamCmdStatus roamStatus;
eCsrRoamResult roamResult;
eHalStatus status;
tANI_U32 <API key> = 0;
tSirSmeStartBssRsp *pSmeStartBssRsp = NULL;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eANI_BOOLEAN_FALSE;
}
smsLog( pMac, LOG1, FL("Processing ROAM results..."));
switch( Result )
{
case eCsrJoinSuccess:
case eCsrReassocSuccess:
if(eCsrReassocSuccess == Result)
{
ind_qos = <API key>;
}
else
{
ind_qos = <API key>;
}
smsLog(pMac, LOGW, FL("receives association indication"));
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(roamInfo));
if(pSession->pWpaRsnRspIE)
{
pSession->nWpaRsnRspIeLength = 0;
palFreeMemory(pMac->hHdd, pSession->pWpaRsnRspIE);
pSession->pWpaRsnRspIE = NULL;
}
#ifdef FEATURE_WLAN_WAPI
if(pSession->pWapiRspIE)
{
pSession->nWapiRspIeLength = 0;
palFreeMemory(pMac->hHdd, pSession->pWapiRspIE);
pSession->pWapiRspIE = NULL;
}
#endif
#ifdef <API key>
pSession->maxRetryCount = 0;
<API key>(pMac, sessionId);
#endif
if( <API key>( pProfile ) )
{
pSession->connectState = <API key>;
}
else
{
pSession->connectState = <API key>;
}
if( (<API key> == pCommand->u.roamCmd.roamReason) ||
(<API key> == pCommand->u.roamCmd.roamReason) )
{
pSirBssDesc = pSession->pConnectBssDesc;
if(pSirBssDesc)
{
palCopyMemory(pMac->hHdd, &roamInfo.bssid, &pSirBssDesc->bssId, sizeof(tCsrBssid));
}
}
else
{
if(pCommand->u.roamCmd.pRoamBssEntry)
{
pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link);
if(pScanResult != NULL)
{
pSirBssDesc = &pScanResult->Result.BssDescriptor;
pIes = (tDot11fBeaconIEs *)( pScanResult->Result.pvIes );
palCopyMemory(pMac->hHdd, &roamInfo.bssid, &pSirBssDesc->bssId, sizeof(tCsrBssid));
}
}
}
if( pSirBssDesc )
{
roamInfo.staId = HAL_STA_INVALID_IDX;
<API key>(pMac, sessionId, pProfile, pSirBssDesc, pIes);
<API key>(pMac, sessionId, pProfile->negotiatedAuthType, pSirBssDesc, pIes);
#ifdef FEATURE_WLAN_CCX
roamInfo.isCCXAssoc = pSession->connectedProfile.isCCXAssoc;
#endif
csrRoamStateChange( pMac, <API key>, sessionId );
if( <API key>( pProfile-><API key> ) &&
!pProfile->bWPSAssociation)
{
if( !HAL_STATUS_SUCCESS( <API key>( pMac, sessionId,
pProfile-><API key>,
pSirBssDesc, &(pSirBssDesc->bssId),
FALSE, TRUE, eSIR_TX_RX, 0, 0, NULL, 0 ) ) )
{
smsLog( pMac, LOGE, FL(" Set context for unicast fail") );
<API key>( pMac, <API key>, sessionId );
}
<API key>( pMac, sessionId, pProfile-><API key>,
pSirBssDesc, &BroadcastMac,
FALSE, FALSE, eSIR_TX_RX, 0, 0, NULL, 0 );
}
else
{
roamInfo.fAuthRequired = eANI_BOOLEAN_TRUE;
<API key>( pMac, <API key>, sessionId );
if(pProfile->bWPSAssociation)
{
<API key> = <API key>;
}
else
{
<API key> = <API key>;
}
pMac->roam.WaitForKeyTimerInfo.sessionId = (tANI_U8)sessionId;
if(!HAL_STATUS_SUCCESS( <API key>( pMac, <API key> ) ) )
{
smsLog( pMac, LOGE, FL(" Failed to start pre-auth timer") );
<API key>( pMac, <API key>, sessionId);
}
}
assocInfo.pBssDesc = pSirBssDesc;
assocInfo.pProfile = pProfile;
if(Context)
{
tSirSmeJoinRsp *pJoinRsp = (tSirSmeJoinRsp *)Context;
tANI_U32 len;
<API key>( pMac, &pSession->connectedInfo );
len = pJoinRsp->assocReqLength + pJoinRsp->assocRspLength + pJoinRsp->beaconLength;
#ifdef <API key>
len += pJoinRsp->parsedRicRspLen;
#endif
#ifdef FEATURE_WLAN_CCX
len += pJoinRsp->tspecIeLen;
#endif
if(len)
{
if(HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd,
(void **)&pSession->connectedInfo.pbFrames, len)))
{
if(HAL_STATUS_SUCCESS( palCopyMemory(pMac->hHdd,
pSession->connectedInfo.pbFrames, pJoinRsp->frames, len) ))
{
pSession->connectedInfo.nAssocReqLength = pJoinRsp->assocReqLength;
pSession->connectedInfo.nAssocRspLength = pJoinRsp->assocRspLength;
pSession->connectedInfo.nBeaconLength = pJoinRsp->beaconLength;
#ifdef <API key>
pSession->connectedInfo.nRICRspLength = pJoinRsp->parsedRicRspLen;
#endif
#ifdef FEATURE_WLAN_CCX
pSession->connectedInfo.nTspecIeLength = pJoinRsp->tspecIeLen;
#endif
roamInfo.nAssocReqLength = pJoinRsp->assocReqLength;
roamInfo.nAssocRspLength = pJoinRsp->assocRspLength;
roamInfo.nBeaconLength = pJoinRsp->beaconLength;
roamInfo.pbFrames = pSession->connectedInfo.pbFrames;
}
else
{
smsLog(pMac, LOGE, "%s: Copying of memory failed for %d bytes !!!",
__func__, len);
palFreeMemory( pMac->hHdd, pSession->connectedInfo.pbFrames );
pSession->connectedInfo.pbFrames = NULL;
}
}
}
if(pCommand->u.roamCmd.fReassoc)
{
roamInfo.fReassocReq = roamInfo.fReassocRsp = eANI_BOOLEAN_TRUE;
}
pSession->connectedInfo.staId = ( tANI_U8 )pJoinRsp->staId;
roamInfo.staId = ( tANI_U8 )pJoinRsp->staId;
roamInfo.ucastSig = ( tANI_U8 )pJoinRsp->ucastSig;
roamInfo.bcastSig = ( tANI_U8 )pJoinRsp->bcastSig;
}
else
{
if(pCommand->u.roamCmd.fReassoc)
{
roamInfo.fReassocReq = roamInfo.fReassocRsp = eANI_BOOLEAN_TRUE;
roamInfo.nAssocReqLength = pSession->connectedInfo.nAssocReqLength;
roamInfo.nAssocRspLength = pSession->connectedInfo.nAssocRspLength;
roamInfo.nBeaconLength = pSession->connectedInfo.nBeaconLength;
roamInfo.pbFrames = pSession->connectedInfo.pbFrames;
}
}
#ifndef <API key>
sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, ind_qos, &assocInfo);
#endif
roamInfo.pBssDesc = pSirBssDesc;
roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
#ifndef <API key>
acm_mask = sme_QosGetACMMask(pMac, pSirBssDesc, NULL);
#endif
pSession->connectedProfile.acm_mask = acm_mask;
if( pSession->connectedProfile.modifyProfileFields.uapsd_mask )
{
smsLog(pMac, LOGE, " uapsd_mask (0x%X) set, request UAPSD now",
pSession->connectedProfile.modifyProfileFields.uapsd_mask);
pmcStartUapsd( pMac, NULL, NULL );
}
pSession->connectedProfile.dot11Mode = pSession->bssParams.uCfgDot11Mode;
roamInfo.u.pConnectedProfile = &pSession->connectedProfile;
if( pSession->bRefAssocStartCnt > 0 )
{
pSession->bRefAssocStartCnt
if(!<API key>(SLM_SESSIONIZATION) && ( <API key>( pMac )))
{
pMac->roam.configParam.doBMPSWorkaround = 1;
}
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, <API key>, <API key>);
}
csrRoamCompletion(pMac, sessionId, NULL, pCommand, <API key>, eANI_BOOLEAN_TRUE);
<API key>( pMac, sessionId );
if( <API key>(pMac, sessionId ) && pIes )
{
<API key>(pMac, pIes);
}
#ifdef FEATURE_WLAN_WAPI
<API key>( pMac, sessionId );
#endif
}
else
{
smsLog(pMac, LOGW, " Roam command doesn't have a BSS desc");
}
<API key>(pMac);
if( !CSR_IS_WAIT_FOR_KEY(pMac, sessionId) )
{
csrRoamLinkUp(pMac, pSession->connectedProfile.bssid);
}
if (<API key>(pMac))
{
if (<API key>(pMac, <API key>)
!= eHAL_STATUS_SUCCESS)
{
smsLog(pMac, LOGP, FL("Cannot start BMPS Retry timer"));
}
smsLog(pMac, LOG2, FL("BMPS Retry Timer already running or started"));
}
break;
case eCsrStartBssSuccess:
smsLog(pMac, LOG2, FL("receives start BSS ok indication"));
status = eHAL_STATUS_FAILURE;
pSmeStartBssRsp = (tSirSmeStartBssRsp *)Context;
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
if( CSR_IS_IBSS( pProfile ) )
{
pSession->connectState = <API key>;
}
else if (CSR_IS_INFRA_AP(pProfile))
{
pSession->connectState = <API key>;
}
else
{
pSession->connectState = <API key>;
}
if( !CSR_IS_WDS_STA( pProfile ) )
{
csrRoamStateChange( pMac, <API key>, sessionId );
pSirBssDesc = &pSmeStartBssRsp->bssDescription;
if( !HAL_STATUS_SUCCESS(<API key>( pMac, pSirBssDesc, &pIes )) )
{
smsLog(pMac, LOG2, FL("cannot parse IBSS IEs"));
roamInfo.pBssDesc = pSirBssDesc;
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
eCSR_ROAM_IBSS_IND, <API key> );
break;
}
if (!CSR_IS_INFRA_AP(pProfile))
{
pScanResult = <API key>( pMac, pSirBssDesc, pIes, FALSE );
}
<API key>(pMac, sessionId, pSirBssDesc);
<API key>(pMac, &pSession->connectedProfile);
<API key>( pMac, &pSession->connectedInfo );
if(pSirBssDesc)
{
<API key>(pMac, sessionId, pProfile, pSirBssDesc, pIes);
palCopyMemory(pMac->hHdd, &roamInfo.bssid, &pSirBssDesc->bssId, sizeof(tCsrBssid));
}
palFreeMemory(pMac->hHdd, pIes);
#ifdef <API key>
{
<API key> *pIbssLog;
tANI_U32 bi;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
if(<API key> == pCommand->u.roamCmd.hBSSList)
{
pIbssLog->eventId = <API key>;
}
else
{
pIbssLog->eventId = <API key>;
}
if(pSirBssDesc)
{
palCopyMemory(pMac->hHdd, pIbssLog->bssid, pSirBssDesc->bssId, 6);
pIbssLog->operatingChannel = pSirBssDesc->channelId;
}
if(HAL_STATUS_SUCCESS(ccmCfgGetInt(pMac, <API key>, &bi)))
{
pIbssLog->beaconInterval = (v_U8_t)bi;
}
<API key>(pIbssLog);
}
}
#endif
if( <API key>( pProfile-><API key> ) && !CSR_IS_INFRA_AP( pSession->pCurRoamProfile ))
{
<API key>( pMac, sessionId,
pProfile-><API key>,
pSirBssDesc, &BroadcastMac,
FALSE, FALSE, eSIR_TX_RX, 0, 0, NULL, 0 );
}
}
else
{
if(pCommand->u.roamCmd.pRoamBssEntry)
{
if((pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link)))
{
pSirBssDesc = &pScanResult->Result.BssDescriptor;
pIes = (tDot11fBeaconIEs *)( pScanResult->Result.pvIes );
<API key>( pMac, <API key>, sessionId);
status = csrSendJoinReqMsg( pMac, sessionId, pSirBssDesc, pProfile, pIes, eWNI_SME_JOIN_REQ );
}
}
else
{
smsLog( pMac, LOGE, " StartBSS for WDS station with no BssDesc" );
VOS_ASSERT( 0 );
}
}
if( !CSR_IS_JOIN_TO_IBSS( pProfile ) )
{
roamStatus = eCSR_ROAM_IBSS_IND;
roamResult = <API key>;
if( CSR_IS_WDS( pProfile ) )
{
roamStatus = eCSR_ROAM_WDS_IND;
roamResult = <API key>;
}
if( CSR_IS_INFRA_AP( pProfile ) )
{
roamStatus = eCSR_ROAM_INFRA_IND;
roamResult = <API key>;
}
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
if(<API key> == pCommand->u.roamCmd.hBSSList)
{
roamInfo.pBssDesc = pSirBssDesc;
}
roamInfo.staId = (tANI_U8)pSmeStartBssRsp->staId;
vos_mem_copy (roamInfo.bssid, pSirBssDesc->bssId, sizeof(tCsrBssid));
if(!<API key>(SLM_SESSIONIZATION) &&
( <API key>( pMac )))
{
pMac->roam.configParam.doBMPSWorkaround = 1;
}
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, roamStatus, roamResult );
}
<API key>(pMac);
if( CSR_IS_IBSS( pProfile) && <API key> != pCommand->u.roamCmd.hBSSList)
{
<API key>(pMac, sessionId, <API key>);
pSession->ibss_join_pending = TRUE;
}
if( HAL_STATUS_SUCCESS( status ) )
{
fReleaseCommand = eANI_BOOLEAN_FALSE;
}
else if( CSR_IS_WDS_STA( pProfile ) )
{
<API key>( pMac, sessionId, <API key> );
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
eCSR_ROAM_WDS_IND, <API key> );
}
break;
case eCsrStartBssFailure:
#ifdef <API key>
{
<API key> *pIbssLog;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
pIbssLog->status = <API key>;
<API key>(pIbssLog);
}
}
#endif
roamStatus = eCSR_ROAM_IBSS_IND;
roamResult = <API key>;
if( CSR_IS_WDS( pProfile ) )
{
roamStatus = eCSR_ROAM_WDS_IND;
roamResult = <API key>;
}
if( CSR_IS_INFRA_AP( pProfile ) )
{
roamStatus = eCSR_ROAM_INFRA_IND;
roamResult = <API key>;
}
if(Context)
{
pSirBssDesc = (tSirBssDescription *)Context;
}
else
{
pSirBssDesc = NULL;
}
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.pBssDesc = pSirBssDesc;
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, roamStatus, roamResult );
<API key>( pMac );
break;
case <API key>:
smsLog(pMac, LOGW, FL("receives silently roaming indication"));
csrRoamStateChange( pMac, <API key>, sessionId );
<API key>( pMac, <API key>, sessionId );
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.pBssDesc = pSession->pConnectBssDesc;
if( roamInfo.pBssDesc )
{
palCopyMemory(pMac->hHdd, &roamInfo.bssid, &roamInfo.pBssDesc->bssId, sizeof(tCsrBssid));
}
csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
eCSR_ROAM_IBSS_IND, <API key> );
break;
case <API key>:
smsLog(pMac, LOGW, FL("receives silently stop roaming indication"));
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(roamInfo));
pMac->roam.curState[sessionId] = <API key>;
roamInfo.pBssDesc = pSession->pConnectBssDesc;
if( roamInfo.pBssDesc )
{
palCopyMemory(pMac->hHdd, &roamInfo.bssid, &roamInfo.pBssDesc->bssId, sizeof(tCsrBssid));
}
roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
roamInfo.nBeaconLength = pSession->connectedInfo.nBeaconLength;
roamInfo.nAssocReqLength = pSession->connectedInfo.nAssocReqLength;
roamInfo.nAssocRspLength = pSession->connectedInfo.nAssocRspLength;
roamInfo.pbFrames = pSession->connectedInfo.pbFrames;
roamInfo.staId = pSession->connectedInfo.staId;
roamInfo.u.pConnectedProfile = &pSession->connectedProfile;
VOS_ASSERT( roamInfo.staId != 0 );
pSession->bRefAssocStartCnt
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
<API key>, <API key>);
csrRoamCompletion(pMac, sessionId, NULL, pCommand, <API key>, eANI_BOOLEAN_TRUE);
break;
case eCsrReassocFailure:
#ifndef <API key>
sme_QosCsrEventInd(pMac, (tANI_U8)sessionId, <API key>, NULL);
#endif
case eCsrJoinWdsFailure:
smsLog(pMac, LOGW, FL("failed to join WDS"));
<API key>(pMac, sessionId);
<API key>(pMac, &pSession->connectedProfile);
<API key>( pMac, &pSession->connectedInfo );
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.pBssDesc = pCommand->u.roamCmd.pLastRoamBss;
roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
eCSR_ROAM_WDS_IND,
<API key>);
break;
case eCsrJoinFailure:
case eCsrNothingToJoin:
case <API key>:
default:
{
smsLog(pMac, LOGW, FL("receives no association indication"));
smsLog(pMac, LOG1, FL("Assoc ref count %d"),
pSession->bRefAssocStartCnt);
if( <API key>( &pSession->connectedProfile ) ||
<API key>( pMac, sessionId ) )
{
<API key>(pMac, sessionId);
<API key>(pMac, &pSession->connectedProfile);
<API key>( pMac, &pSession->connectedInfo );
<API key>( pMac );
}
switch( pCommand->u.roamCmd.roamReason )
{
case <API key>:
case <API key>:
case eCsrHddIssued:
case <API key>:
csrRoamStateChange( pMac, <API key>, sessionId );
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.pBssDesc = pCommand->u.roamCmd.pLastRoamBss;
roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
palCopyMemory(pMac->hHdd, &roamInfo.bssid, &pSession->joinFailStatusCode.bssId, sizeof(tCsrBssid));
#ifdef <API key>
if (<API key>(pMac))
{
<API key>(pMac, (tANI_U8)sessionId, <API key>);
}
#endif
if(pSession->bRefAssocStartCnt > 0)
{
pSession->bRefAssocStartCnt
if(<API key> == Result)
{
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
<API key>,
<API key>);
}
else
{
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
<API key>,
<API key>);
}
}
else
{
csrRoamCallCallback(pMac, sessionId, &roamInfo,
pCommand->u.scanCmd.roamId,
<API key>,
<API key>);
}
smsLog(pMac, LOG1, FL(" roam(reason %d) failed"), pCommand->u.roamCmd.roamReason);
#ifndef <API key>
<API key>((tANI_U8)sessionId, VOS_FALSE);
sme_QosCsrEventInd(pMac, (tANI_U8)sessionId, <API key>, NULL);
#endif
csrRoamCompletion(pMac, sessionId, NULL, pCommand, <API key>, eANI_BOOLEAN_FALSE);
<API key>(pMac);
#ifdef <API key>
if( CSR_IS_WDS_STA(pProfile) )
{
<API key>(pMac, sessionId, <API key>);
}
#endif
break;
case <API key>:
case <API key>:
csrRoamStateChange( pMac, <API key>, sessionId);
csrRoamCallCallback(pMac, sessionId, NULL, pCommand->u.roamCmd.roamId, <API key>, <API key>);
#ifndef <API key>
sme_QosCsrEventInd(pMac, (tANI_U8)sessionId, <API key>, NULL);
#endif
csrRoamCompletion(pMac, sessionId, NULL, pCommand, <API key>, eANI_BOOLEAN_FALSE);
<API key>(pMac);
break;
case eCsrForcedDisassoc:
case eCsrForcedDeauth:
case <API key>:
csrRoamStateChange( pMac, <API key>, sessionId);
if(<API key> == pCommand->u.roamCmd.roamReason)
{
csrRoamCallCallback(pMac, sessionId, NULL, 0, eCSR_ROAM_IBSS_IND, <API key>);
}
else
{
csrRoamCallCallback(pMac, sessionId, NULL,
pCommand->u.roamCmd.roamId,
<API key>, <API key>);
}
#ifndef <API key>
sme_QosCsrEventInd(pMac, (tANI_U8)sessionId, <API key>, NULL);
#endif
csrRoamLinkDown(pMac, sessionId);
if (pMac->roam.deauthRspStatus == <API key>)
{
smsLog(pMac, LOGW, FL("FW still in connected state "));
break;
}
<API key>(pMac);
break;
case eCsrForcedIbssLeave:
csrRoamCallCallback(pMac, sessionId, NULL,
pCommand->u.roamCmd.roamId,
<API key>,
<API key>);
break;
case <API key>:
csrRoamStateChange( pMac, <API key>, sessionId );
csrRoamCallCallback(pMac, sessionId, NULL, pCommand->u.roamCmd.roamId, <API key>, <API key>);
#ifndef <API key>
sme_QosCsrEventInd(pMac, (tANI_U8)sessionId, <API key>, NULL);
#endif
<API key>(pMac);
break;
case eCsrStopBss:
csrRoamCallCallback(pMac, sessionId, NULL,
pCommand->u.roamCmd.roamId,
eCSR_ROAM_INFRA_IND,
<API key>);
break;
case <API key>:
case eCsrForcedDeauthSta:
csrRoamStateChange( pMac, <API key>, sessionId);
if( <API key>(pMac, sessionId) )
{
pSession = CSR_GET_SESSION(pMac, sessionId);
if (!pSession)
break;
if ( CSR_IS_INFRA_AP(&pSession->connectedProfile) )
{
roamInfo.u.pConnectedProfile = &pSession->connectedProfile;
palCopyMemory(pMac->hHdd, roamInfo.peerMac,
pCommand->u.roamCmd.peerMac, sizeof(tSirMacAddr));
roamInfo.reasonCode = <API key>;
roamInfo.statusCode = eSIR_SME_SUCCESS;
status = csrRoamCallCallback(pMac, sessionId,
&roamInfo, pCommand->u.roamCmd.roamId,
eCSR_ROAM_LOSTLINK, <API key>);
}
}
break;
case eCsrLostLink1:
<API key>(pMac, sessionId);
break;
case eCsrLostLink2:
<API key>(pMac, sessionId);
break;
case eCsrLostLink3:
default:
csrRoamStateChange( pMac, <API key>, sessionId );
<API key>(pMac, sessionId);
break;
}
break;
}
}
return ( fReleaseCommand );
}
eHalStatus <API key>(tpAniSirGlobal pMac, <API key> callback, void *pContext)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
return (status);
}
eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile, tCsrRoamProfile *pSrcProfile)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 size = 0;
do
{
palZeroMemory(pMac->hHdd, pDstProfile, sizeof(tCsrRoamProfile));
if(pSrcProfile->BSSIDs.numOfBSSIDs)
{
size = sizeof(tCsrBssid) * pSrcProfile->BSSIDs.numOfBSSIDs;
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->BSSIDs.bssid, size);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->BSSIDs.numOfBSSIDs = pSrcProfile->BSSIDs.numOfBSSIDs;
palCopyMemory(pMac->hHdd, pDstProfile->BSSIDs.bssid, pSrcProfile->BSSIDs.bssid, size);
}
if(pSrcProfile->SSIDs.numOfSSIDs)
{
size = sizeof(tCsrSSIDInfo) * pSrcProfile->SSIDs.numOfSSIDs;
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->SSIDs.SSIDList, size);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->SSIDs.numOfSSIDs = pSrcProfile->SSIDs.numOfSSIDs;
palCopyMemory(pMac->hHdd, pDstProfile->SSIDs.SSIDList, pSrcProfile->SSIDs.SSIDList, size);
}
if(pSrcProfile->nWPAReqIELength)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->pWPAReqIE, pSrcProfile->nWPAReqIELength);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->nWPAReqIELength = pSrcProfile->nWPAReqIELength;
palCopyMemory(pMac->hHdd, pDstProfile->pWPAReqIE, pSrcProfile->pWPAReqIE, pSrcProfile->nWPAReqIELength);
}
if(pSrcProfile->nRSNReqIELength)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->pRSNReqIE, pSrcProfile->nRSNReqIELength);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->nRSNReqIELength = pSrcProfile->nRSNReqIELength;
palCopyMemory(pMac->hHdd, pDstProfile->pRSNReqIE, pSrcProfile->pRSNReqIE, pSrcProfile->nRSNReqIELength);
}
#ifdef FEATURE_WLAN_WAPI
if(pSrcProfile->nWAPIReqIELength)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->pWAPIReqIE, pSrcProfile->nWAPIReqIELength);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->nWAPIReqIELength = pSrcProfile->nWAPIReqIELength;
palCopyMemory(pMac->hHdd, pDstProfile->pWAPIReqIE, pSrcProfile->pWAPIReqIE, pSrcProfile->nWAPIReqIELength);
}
#endif
if(pSrcProfile->nAddIEScanLength)
{
memset(pDstProfile->addIEScan, 0 , <API key>);
if ( <API key> >= pSrcProfile->nAddIEScanLength)
{
vos_mem_copy(pDstProfile->addIEScan, pSrcProfile->addIEScan,
pSrcProfile->nAddIEScanLength);
pDstProfile->nAddIEScanLength = pSrcProfile->nAddIEScanLength;
}
else
{
VOS_TRACE( VOS_MODULE_ID_VOSS, <API key>,
FL(" AddIEScanLength is not valid %u"),
pSrcProfile->nAddIEScanLength);
}
}
if(pSrcProfile->nAddIEAssocLength)
{
status = palAllocateMemory(pMac->hHdd,
(void **)&pDstProfile->pAddIEAssoc, pSrcProfile->nAddIEAssocLength);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->nAddIEAssocLength = pSrcProfile->nAddIEAssocLength;
palCopyMemory(pMac->hHdd, pDstProfile->pAddIEAssoc, pSrcProfile->pAddIEAssoc,
pSrcProfile->nAddIEAssocLength);
}
if(pSrcProfile->ChannelInfo.ChannelList)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->ChannelInfo.ChannelList, pSrcProfile->ChannelInfo.numOfChannels);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->ChannelInfo.numOfChannels = pSrcProfile->ChannelInfo.numOfChannels;
palCopyMemory(pMac->hHdd, pDstProfile->ChannelInfo.ChannelList, pSrcProfile->ChannelInfo.ChannelList, pSrcProfile->ChannelInfo.numOfChannels);
}
pDstProfile->AuthType = pSrcProfile->AuthType;
pDstProfile->EncryptionType = pSrcProfile->EncryptionType;
pDstProfile->mcEncryptionType = pSrcProfile->mcEncryptionType;
pDstProfile-><API key> = pSrcProfile-><API key>;
pDstProfile-><API key> = pSrcProfile-><API key>;
pDstProfile->negotiatedAuthType = pSrcProfile->negotiatedAuthType;
#ifdef WLAN_FEATURE_11W
pDstProfile->MFPEnabled = pSrcProfile->MFPEnabled;
pDstProfile->MFPRequired = pSrcProfile->MFPRequired;
pDstProfile->MFPCapable = pSrcProfile->MFPCapable;
#endif
pDstProfile->BSSType = pSrcProfile->BSSType;
pDstProfile->phyMode = pSrcProfile->phyMode;
pDstProfile->csrPersona = pSrcProfile->csrPersona;
#ifdef FEATURE_WLAN_WAPI
if(csrIsProfileWapi(pSrcProfile))
{
if(pDstProfile->phyMode & eCSR_DOT11_MODE_11n)
{
pDstProfile->phyMode &= ~eCSR_DOT11_MODE_11n;
}
}
#endif
pDstProfile->CBMode = pSrcProfile->CBMode;
pDstProfile->bWPSAssociation = pSrcProfile->bWPSAssociation;
pDstProfile->uapsd_mask = pSrcProfile->uapsd_mask;
pDstProfile->beaconInterval = pSrcProfile->beaconInterval;
pDstProfile->privacy = pSrcProfile->privacy;
pDstProfile->fwdWPSPBCProbeReq = pSrcProfile->fwdWPSPBCProbeReq;
pDstProfile->csr80211AuthType = pSrcProfile->csr80211AuthType;
pDstProfile->dtimPeriod = pSrcProfile->dtimPeriod;
pDstProfile->ApUapsdEnable = pSrcProfile->ApUapsdEnable;
pDstProfile->SSIDs.SSIDList[0].ssidHidden = pSrcProfile->SSIDs.SSIDList[0].ssidHidden;
pDstProfile->protEnabled = pSrcProfile->protEnabled;
pDstProfile->obssProtEnabled = pSrcProfile->obssProtEnabled;
pDstProfile->cfg_protection = pSrcProfile->cfg_protection;
pDstProfile->wps_state = pSrcProfile->wps_state;
pDstProfile->ieee80211d = pSrcProfile->ieee80211d;
palCopyMemory(pMac->hHdd, &pDstProfile->Keys, &pSrcProfile->Keys, sizeof(pDstProfile->Keys));
#ifdef <API key>
if (pSrcProfile->MDID.mdiePresent)
{
pDstProfile->MDID.mdiePresent = 1;
pDstProfile->MDID.mobilityDomain = pSrcProfile->MDID.mobilityDomain;
}
#endif
}while(0);
if(!HAL_STATUS_SUCCESS(status))
{
csrReleaseProfile(pMac, pDstProfile);
pDstProfile = NULL;
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pDstProfile )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> *pSrcProfile = &pMac->roam.roamSession[sessionId].connectedProfile;
do
{
palZeroMemory(pMac->hHdd, pDstProfile, sizeof(tCsrRoamProfile));
if(pSrcProfile->bssid)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->BSSIDs.bssid, sizeof(tCsrBssid));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGE,
FL("failed to allocate memory for BSSID"
"%02x:%02x:%02x:%02x:%02x:%02x"),
pSrcProfile->bssid[0], pSrcProfile->bssid[1], pSrcProfile->bssid[2],
pSrcProfile->bssid[3], pSrcProfile->bssid[4], pSrcProfile->bssid[5]);
break;
}
pDstProfile->BSSIDs.numOfBSSIDs = 1;
palCopyMemory(pMac->hHdd, pDstProfile->BSSIDs.bssid, pSrcProfile->bssid, sizeof(tCsrBssid));
}
if(pSrcProfile->SSID.ssId)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->SSIDs.SSIDList, sizeof(tCsrSSIDInfo));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGE,
FL("failed to allocate memory for SSIDList"
"%02x:%02x:%02x:%02x:%02x:%02x"),
pSrcProfile->bssid[0], pSrcProfile->bssid[1], pSrcProfile->bssid[2],
pSrcProfile->bssid[3], pSrcProfile->bssid[4], pSrcProfile->bssid[5]);
break;
}
pDstProfile->SSIDs.numOfSSIDs = 1;
pDstProfile->SSIDs.SSIDList[0].handoffPermitted = pSrcProfile->handoffPermitted;
pDstProfile->SSIDs.SSIDList[0].ssidHidden = pSrcProfile->ssidHidden;
palCopyMemory(pMac->hHdd, &pDstProfile->SSIDs.SSIDList[0].SSID, &pSrcProfile->SSID, sizeof(tSirMacSSid));
}
if(pSrcProfile->nAddIEAssocLength)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->pAddIEAssoc, pSrcProfile->nAddIEAssocLength);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGE, FL(" failed to allocate memory for additional IEs ") );
break;
}
pDstProfile->nAddIEAssocLength = pSrcProfile->nAddIEAssocLength;
palCopyMemory(pMac->hHdd, pDstProfile->pAddIEAssoc, pSrcProfile->pAddIEAssoc,
pSrcProfile->nAddIEAssocLength);
}
status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->ChannelInfo.ChannelList, 1);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pDstProfile->ChannelInfo.numOfChannels = 1;
pDstProfile->ChannelInfo.ChannelList[0] = pSrcProfile->operationChannel;
pDstProfile->AuthType.numEntries = 1;
pDstProfile->AuthType.authType[0] = pSrcProfile->AuthType;
pDstProfile->negotiatedAuthType = pSrcProfile->AuthType;
pDstProfile->EncryptionType.numEntries = 1;
pDstProfile->EncryptionType.encryptionType[0] = pSrcProfile->EncryptionType;
pDstProfile-><API key> = pSrcProfile->EncryptionType;
pDstProfile->mcEncryptionType.numEntries = 1;
pDstProfile->mcEncryptionType.encryptionType[0] = pSrcProfile->mcEncryptionType;
pDstProfile-><API key> = pSrcProfile->mcEncryptionType;
pDstProfile->BSSType = pSrcProfile->BSSType;
pDstProfile->CBMode = pSrcProfile->CBMode;
palCopyMemory(pMac->hHdd, &pDstProfile->Keys, &pSrcProfile->Keys, sizeof(pDstProfile->Keys));
#ifdef <API key>
if (pSrcProfile->MDID.mdiePresent)
{
pDstProfile->MDID.mdiePresent = 1;
pDstProfile->MDID.mobilityDomain = pSrcProfile->MDID.mobilityDomain;
}
#endif
}while(0);
if(!HAL_STATUS_SUCCESS(status))
{
csrReleaseProfile(pMac, pDstProfile);
pDstProfile = NULL;
}
return (status);
}
eHalStatus csrRoamIssueConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tScanResultHandle hBSSList,
eCsrRoamReason reason, tANI_U32 roamId, tANI_BOOLEAN fImediate,
tANI_BOOLEAN fClearScan)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
pCommand = csrGetCommandBuffer(pMac);
if(NULL == pCommand)
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
}
else
{
if( fClearScan )
{
<API key>(pMac);
<API key>(pMac);
}
pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_FALSE;
if(NULL == pProfile)
{
pCommand->u.roamCmd.roamProfile.AuthType.numEntries = 1;
pCommand->u.roamCmd.roamProfile.AuthType.authType[0] = eCSR_<API key>;
pCommand->u.roamCmd.roamProfile.EncryptionType.numEntries = 1;
pCommand->u.roamCmd.roamProfile.EncryptionType.encryptionType[0] = <API key>;
pCommand->u.roamCmd.roamProfile.csrPersona = VOS_STA_MODE;
}
else
{
status = csrRoamCopyProfile(pMac, &pCommand->u.roamCmd.roamProfile, pProfile);
if(HAL_STATUS_SUCCESS(status))
{
pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_TRUE;
}
}
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.hBSSList = hBSSList;
pCommand->u.roamCmd.roamId = roamId;
pCommand->u.roamCmd.roamReason = reason;
pCommand->u.roamCmd.fReleaseBssList = eANI_BOOLEAN_TRUE;
pCommand->u.roamCmd.<API key> = eANI_BOOLEAN_TRUE;
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
FL("CSR PERSONA=%d"),
pCommand->u.roamCmd.roamProfile.csrPersona);
status = csrQueueSmeCommand(pMac, pCommand, fImediate);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
<API key>( pMac, pCommand );
}
}
return (status);
}
eHalStatus csrRoamIssueReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
<API key> *pMmodProfileFields,
eCsrRoamReason reason, tANI_U32 roamId, tANI_BOOLEAN fImediate)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
pCommand = csrGetCommandBuffer(pMac);
if(NULL == pCommand)
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
}
else
{
<API key>(pMac);
<API key>(pMac);
if(pProfile)
{
pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_FALSE;
status = csrRoamCopyProfile(pMac, &pCommand->u.roamCmd.roamProfile, pProfile);
pCommand->u.roamCmd.<API key> = eANI_BOOLEAN_TRUE;
}
else
{
status = <API key>(pMac, sessionId, &pCommand->u.roamCmd.roamProfile);
pCommand->u.roamCmd.roamProfile.uapsd_mask = pMmodProfileFields->uapsd_mask;
}
if(HAL_STATUS_SUCCESS(status))
{
pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_TRUE;
}
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.roamId = roamId;
pCommand->u.roamCmd.roamReason = reason;
pCommand->u.roamCmd.hBSSList = <API key>;
pCommand->u.roamCmd.fReleaseBssList = eANI_BOOLEAN_FALSE;
pCommand->u.roamCmd.fReassoc = eANI_BOOLEAN_TRUE;
status = csrQueueSmeCommand(pMac, pCommand, fImediate);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
csrRoamCompletion(pMac, sessionId, NULL, pCommand, <API key>, eANI_BOOLEAN_FALSE);
<API key>( pMac, pCommand );
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tpSirBssDescription pBssDescription,
eCsrRoamReason reason, tANI_BOOLEAN fImmediate)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
pCommand = csrGetCommandBuffer(pMac);
if(NULL == pCommand)
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
}
else
{
if(pBssDescription)
{
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.roamReason = reason;
pCommand->u.roamCmd.pLastRoamBss = pBssDescription;
status = csrQueueSmeCommand(pMac, pCommand, fImmediate);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to enqueue preauth command, status = %d"), status );
<API key>( pMac, pCommand );
}
}
else
{
status = <API key>;
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac)
{
tListElem *pEntry;
tSmeCmd *pCommand;
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if ( pEntry )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if ( (eSmeCommandRoam == pCommand->command) &&
(eCsrPerformPreauth == pCommand->u.roamCmd.roamReason))
{
smsLog( pMac, LOG1, FL("DQ-Command = %d, Reason = %d"),
pCommand->command, pCommand->u.roamCmd.roamReason);
if (csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK )) {
<API key>( pMac, pCommand );
}
} else {
smsLog( pMac, LOGE, FL("Command = %d, Reason = %d "),
pCommand->command, pCommand->u.roamCmd.roamReason);
}
}
else {
smsLog( pMac, LOGE, FL("pEntry NULL for <API key>"));
}
<API key>( pMac );
return eHAL_STATUS_SUCCESS;
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tScanResultHandle hBssListIn, tANI_U32 *pRoamId)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tScanResultHandle hBSSList;
tANI_U32 roamId = 0;
status = <API key>(pMac, hBssListIn, &hBSSList);
if(HAL_STATUS_SUCCESS(status))
{
roamId = GET_NEXT_ROAM_ID(&pMac->roam);
if(pRoamId)
{
*pRoamId = roamId;
}
status = csrRoamIssueConnect(pMac, sessionId, pProfile, hBSSList, eCsrHddIssued,
roamId, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("failed to start a join process"));
csrScanResultPurge(pMac, hBSSList);
}
}
return (status);
}
eHalStatus csrRoamConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tScanResultHandle hBssListIn, tANI_U32 *pRoamId)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tScanResultHandle hBSSList;
<API key> *pScanFilter;
tANI_U32 roamId = 0;
tANI_BOOLEAN fCallCallback = eANI_BOOLEAN_FALSE;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (NULL == pProfile)
{
smsLog(pMac, LOGP, FL("No profile specified"));
return eHAL_STATUS_FAILURE;
}
smsLog(pMac, LOG1, FL("called BSSType = %d authtype = %d encryType = %d"),
pProfile->BSSType, pProfile->AuthType.authType[0], pProfile->EncryptionType.encryptionType[0]);
if( CSR_IS_WDS( pProfile ) &&
!HAL_STATUS_SUCCESS( status = csrIsBTAMPAllowed( pMac, pProfile->operationChannel ) ) )
{
smsLog(pMac, LOGE, FL("Request for BT AMP connection failed, channel requested is different than infra = %d"),
pProfile->operationChannel);
return status;
}
<API key>(pMac, sessionId);
<API key>(pMac, sessionId);
<API key>(pMac);
csrScanAbortMacScan(pMac);
if (!<API key>() && (VOS_STA_SAP_MODE == pProfile->csrPersona))
{
csrScanDisable(pMac);
}
<API key>(pMac, sessionId, NULL, eCsrHddIssued);
if(<API key>(pMac, sessionId))
{
if(pProfile->SSIDs.numOfSSIDs && !csrIsSsidInList(pMac, &pSession->connectedProfile.SSID, &pProfile->SSIDs))
{
<API key>(pMac, sessionId, <API key>);
}
}
#ifdef <API key>
pSession->maxRetryCount = <API key>;
#endif
if(<API key> != hBssListIn)
{
smsLog(pMac, LOG1, FL("is called with BSSList"));
status = <API key>(pMac, sessionId, pProfile, hBssListIn, pRoamId);
if(pRoamId)
{
roamId = *pRoamId;
}
if(!HAL_STATUS_SUCCESS(status))
{
fCallCallback = eANI_BOOLEAN_TRUE;
}
}
else
{
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter, sizeof(<API key>));
if(HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, pScanFilter, sizeof(<API key>));
if(NULL == pProfile)
{
pScanFilter->EncryptionType.numEntries = 1;
pScanFilter->EncryptionType.encryptionType[0] = <API key>;
}
else
{
status = <API key>(pMac, pProfile, pScanFilter);
}
roamId = GET_NEXT_ROAM_ID(&pMac->roam);
if(pRoamId)
{
*pRoamId = roamId;
}
if(HAL_STATUS_SUCCESS(status))
{
if(NULL != pProfile)
{
pScanFilter->bWPSAssociation = pProfile->bWPSAssociation;
}
else
{
pScanFilter->bWPSAssociation = 0;
}
do
{
if( (pProfile && CSR_IS_WDS_AP( pProfile ) )
|| (pProfile && CSR_IS_INFRA_AP ( pProfile ))
)
{
status = csrRoamIssueConnect(pMac, sessionId, pProfile, NULL, eCsrHddIssued,
roamId, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL(" CSR failed to issue start BSS command with status = 0x%08X"), status);
fCallCallback = eANI_BOOLEAN_TRUE;
}
else
{
smsLog(pMac, LOG1, FL("Connect request to proceed for AMP/SoftAP mode"));
}
break;
}
status = csrScanGetResult(pMac, pScanFilter, &hBSSList);
smsLog(pMac, LOG1, "************ csrScanGetResult Status ********* %d", status);
if(HAL_STATUS_SUCCESS(status))
{
status = csrRoamIssueConnect(pMac, sessionId, pProfile, hBSSList, eCsrHddIssued,
roamId, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL(" CSR failed to issue connect command with status = 0x%08X"), status);
csrScanResultPurge(pMac, hBSSList);
fCallCallback = eANI_BOOLEAN_TRUE;
}
}
else if(NULL != pProfile)
{
if(CSR_IS_START_IBSS(pProfile))
{
status = csrRoamIssueConnect(pMac, sessionId, pProfile, NULL, eCsrHddIssued,
roamId, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, " CSR failed to issue startIBSS command with status = 0x%08X", status);
fCallCallback = eANI_BOOLEAN_TRUE;
}
}
else
{
status = csrScanForSSID(pMac, sessionId, pProfile, roamId, TRUE);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL(" CSR failed to issue SSID scan command with status = 0x%08X"), status);
fCallCallback = eANI_BOOLEAN_TRUE;
}
else
{
smsLog(pMac, LOG1, FL("SSID scan requested for Infra connect req"));
}
}
}
else
{
fCallCallback = eANI_BOOLEAN_TRUE;
}
} while (0);
if(NULL != pProfile)
{
csrFreeScanFilter(pMac, pScanFilter);
}
}
palFreeMemory(pMac->hHdd, pScanFilter);
}
}
if( fCallCallback )
{
csrRoamCallCallback(pMac, sessionId, NULL, roamId, eCSR_ROAM_FAILED, <API key>);
}
return (status);
}
eHalStatus csrRoamReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
<API key> modProfileFields,
tANI_U32 *pRoamId)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_BOOLEAN fCallCallback = eANI_BOOLEAN_TRUE;
tANI_U32 roamId = 0;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (NULL == pProfile)
{
smsLog(pMac, LOGP, FL("No profile specified"));
return eHAL_STATUS_FAILURE;
}
smsLog(pMac, LOG1, FL("called BSSType = %d authtype = %d encryType = %d"), pProfile->BSSType, pProfile->AuthType.authType[0], pProfile->EncryptionType.encryptionType[0]);
<API key>(pMac, sessionId);
<API key>(pMac, sessionId);
<API key>(pMac);
<API key>(pMac);
<API key>(pMac, sessionId, NULL, <API key>);
if(<API key>(pMac, sessionId))
{
if(pProfile)
{
if(pProfile->SSIDs.numOfSSIDs &&
csrIsSsidInList(pMac, &pSession->connectedProfile.SSID, &pProfile->SSIDs))
{
fCallCallback = eANI_BOOLEAN_FALSE;
}
else
{
smsLog(pMac, LOG1, FL("Not connected to the same SSID asked in the profile"));
}
}
else if(!palEqualMemory(pMac->hHdd, &modProfileFields,
&pSession->connectedProfile.modifyProfileFields,
sizeof(<API key>)))
{
fCallCallback = eANI_BOOLEAN_FALSE;
}
else
{
smsLog(pMac, LOG1, FL("Either the profile is NULL or none of the fields "
"in <API key> got modified"));
}
}
else
{
smsLog(pMac, LOG1, FL("Not connected! No need to reassoc"));
}
if(!fCallCallback)
{
roamId = GET_NEXT_ROAM_ID(&pMac->roam);
if(pRoamId)
{
*pRoamId = roamId;
}
status = csrRoamIssueReassoc(pMac, sessionId, pProfile, &modProfileFields,
<API key>, roamId, eANI_BOOLEAN_FALSE);
}
else
{
status = csrRoamCallCallback(pMac, sessionId, NULL, roamId,
eCSR_ROAM_FAILED, <API key>);
}
return status;
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tScanResultHandle hBSSList = NULL;
<API key> *pScanFilter = NULL;
tANI_U32 roamId;
tCsrRoamProfile *pProfile = NULL;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
do
{
if(pSession->pCurRoamProfile)
{
<API key>(pMac);
<API key>(pMac);
status = palAllocateMemory(pMac->hHdd, (void **)&pProfile, sizeof(tCsrRoamProfile));
if(!HAL_STATUS_SUCCESS(status))
break;
palZeroMemory(pMac->hHdd, pProfile, sizeof(tCsrRoamProfile));
status = csrRoamCopyProfile(pMac, pProfile, pSession->pCurRoamProfile);
if(!HAL_STATUS_SUCCESS(status))
break;
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter, sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
palZeroMemory(pMac->hHdd, pScanFilter, sizeof(<API key>));
status = <API key>(pMac, pProfile, pScanFilter);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
roamId = GET_NEXT_ROAM_ID(&pMac->roam);
status = csrScanGetResult(pMac, pScanFilter, &hBSSList);
if(HAL_STATUS_SUCCESS(status))
{
<API key>(pMac, &pSession->connectedProfile.bssid, hBSSList);
status = csrRoamIssueConnect(pMac, sessionId, pProfile, hBSSList, eCsrHddIssued,
roamId, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE);
if(!HAL_STATUS_SUCCESS(status))
{
csrScanResultPurge(pMac, hBSSList);
break;
}
}
else
{
status = csrScanForSSID(pMac, sessionId, pProfile, roamId, TRUE);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
}
}
else
{
smsLog(pMac, LOGW, FL("cannot find a roaming profile"));
break;
}
}while(0);
if(pScanFilter)
{
csrFreeScanFilter(pMac, pScanFilter);
palFreeMemory(pMac->hHdd, pScanFilter);
}
if(NULL != pProfile)
{
csrReleaseProfile(pMac, pProfile);
palFreeMemory(pMac->hHdd, pProfile);
}
return (status);
}
eHalStatus csrRoamReconnect(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
eHalStatus status = eHAL_STATUS_FAILURE;
if(<API key>(pMac, sessionId))
{
status = <API key>(pMac, sessionId, <API key>);
if(HAL_STATUS_SUCCESS(status))
{
status = <API key>(pMac, sessionId);
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
eHalStatus status = eHAL_STATUS_FAILURE;
smsLog(pMac, LOGW, FL("is called"));
<API key>(pMac, sessionId);
<API key>(pMac, sessionId, NULL, eCsrHddIssued);
if(<API key>(pMac, sessionId))
{
status = <API key>(pMac, sessionId);
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fDisassoc, tANI_BOOLEAN fMICFailure )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_BOOLEAN fComplete = eANI_BOOLEAN_FALSE;
eCsrRoamSubState NewSubstate;
tANI_U32 sessionId = pCommand->sessionId;
csrRoamStateChange( pMac, <API key>, sessionId );
if ( csrIsConnStateIbss( pMac, sessionId ) )
{
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
fComplete = (!HAL_STATUS_SUCCESS(status));
}
else if ( csrIsConnStateInfra( pMac, sessionId ) )
{
smsLog(pMac, LOG1, FL(" restore AC weights (%d-%d-%d-%d)"), pMac->roam.ucACWeights[0], pMac->roam.ucACWeights[1],
pMac->roam.ucACWeights[2], pMac->roam.ucACWeights[3]);
WLANTL_SetACWeights(pMac->roam.gVosContext, pMac->roam.ucACWeights);
NewSubstate = <API key>;
if(<API key> == pCommand->u.roamCmd.roamReason)
{
NewSubstate = <API key>;
}
else
{
#ifdef <API key>
if (csrRoamIs11rAssoc(pMac) &&
(<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
#ifdef FEATURE_WLAN_ESE
if (csrRoamIsESEAssoc(pMac) &&
(<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac, sessionId) &&
(<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
}
if( fDisassoc )
{
status = <API key>( pMac, sessionId, NewSubstate, fMICFailure );
}
else
{
status = csrRoamIssueDeauth( pMac, sessionId, <API key> );
}
fComplete = (!HAL_STATUS_SUCCESS(status));
}
else if ( csrIsConnStateWds( pMac, sessionId ) )
{
if( CSR_IS_WDS_AP( &pMac->roam.roamSession[sessionId].connectedProfile ) )
{
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
fComplete = (!HAL_STATUS_SUCCESS(status));
}
else if( <API key>( pMac, sessionId ) )
{
pCommand->u.roamCmd.fStopWds = eANI_BOOLEAN_TRUE;
if( fDisassoc )
{
status = <API key>( pMac, sessionId,
<API key>, fMICFailure );
fComplete = (!HAL_STATUS_SUCCESS(status));
}
}
} else {
fComplete = eANI_BOOLEAN_TRUE;
status = eHAL_STATUS_FAILURE;
}
if(fComplete)
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
if(HAL_STATUS_SUCCESS(status))
{
if ( csrIsConnStateInfra( pMac, sessionId ) )
{
pMac->roam.roamSession[sessionId].connectState = <API key>;
}
}
else
{
smsLog(pMac, LOGW, FL(" failed with status %d"), status);
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, <API key> reason )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
tANI_BOOLEAN fHighPriority = eANI_BOOLEAN_FALSE;
do
{
smsLog( pMac, LOG1, FL(" reason = %d"), reason );
pCommand = csrGetCommandBuffer( pMac );
if ( !pCommand )
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
break;
}
if( CSR_IS_WAIT_FOR_KEY( pMac, sessionId ) )
{
<API key>( pMac );
<API key>( pMac, <API key>, sessionId);
}
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
switch ( reason )
{
case <API key>:
pCommand->u.roamCmd.roamReason = <API key>;
break;
case <API key>:
pCommand->u.roamCmd.roamReason = eCsrForcedDeauth;
break;
case <API key>:
fHighPriority = eANI_BOOLEAN_TRUE;
pCommand->u.roamCmd.roamReason = <API key>;
break;
case <API key>:
case <API key>:
pCommand->u.roamCmd.roamReason = eCsrForcedDisassoc;
break;
case <API key>:
pCommand->u.roamCmd.roamReason = <API key>;
break;
case <API key>:
pCommand->u.roamCmd.roamReason = eCsrForcedIbssLeave;
break;
default:
break;
}
status = csrQueueSmeCommand(pMac, pCommand, fHighPriority);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
<API key>( pMac, pCommand );
}
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_BOOLEAN fHighPriority )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
pCommand = csrGetCommandBuffer( pMac );
if ( NULL != pCommand )
{
if( CSR_IS_WAIT_FOR_KEY( pMac, sessionId) )
{
<API key>( pMac );
<API key>( pMac, <API key>, sessionId);
}
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.roamReason = eCsrStopBss;
status = csrQueueSmeCommand(pMac, pCommand, fHighPriority);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
<API key>( pMac, pCommand );
}
}
else
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
}
return ( status );
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, <API key> reason)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
#ifdef <API key>
pSession->maxRetryCount = 0;
<API key>(pMac, sessionId);
#endif
if(<API key>(pMac, sessionId) || csrIsBssTypeIBSS(pSession->connectedProfile.BSSType)
|| csrIsBssTypeWDS(pSession->connectedProfile.BSSType)
|| <API key>(pMac, sessionId) )
{
smsLog(pMac, LOG2, FL("called"));
status = <API key>(pMac, sessionId, reason);
}
else
{
smsLog( pMac, LOGE, FL("Roam command is not present"));
}
return (status);
}
eHalStatus csrRoamDisconnect(tpAniSirGlobal pMac, tANI_U32 sessionId, <API key> reason)
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
<API key>(pMac, sessionId);
pSession->ibss_join_pending = FALSE;
<API key>(pMac, sessionId);
<API key>(pMac, sessionId, NULL, eCsrForcedDisassoc);
return (<API key>(pMac, sessionId, reason));
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tDot11fBeaconIEs *pIesTemp = pIes;
tANI_U8 index;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
<API key> *pConnectProfile = &pSession->connectedProfile;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pConnectProfile->pAddIEAssoc)
{
palFreeMemory(pMac->hHdd, pConnectProfile->pAddIEAssoc);
pConnectProfile->pAddIEAssoc = NULL;
}
palZeroMemory(pMac->hHdd, &pSession->connectedProfile, sizeof(<API key>));
pConnectProfile->AuthType = pProfile->negotiatedAuthType;
pConnectProfile->AuthInfo = pProfile->AuthType;
pConnectProfile->CBMode = pProfile->CBMode;
pConnectProfile->EncryptionType = pProfile-><API key>;
pConnectProfile->EncryptionInfo = pProfile->EncryptionType;
pConnectProfile->mcEncryptionType = pProfile-><API key>;
pConnectProfile->mcEncryptionInfo = pProfile->mcEncryptionType;
pConnectProfile->BSSType = pProfile->BSSType;
pConnectProfile->modifyProfileFields.uapsd_mask = pProfile->uapsd_mask;
pConnectProfile->operationChannel = pSirBssDesc->channelId;
pConnectProfile->beaconInterval = pSirBssDesc->beaconInterval;
palCopyMemory(pMac->hHdd, &pConnectProfile->Keys, &pProfile->Keys, sizeof(tCsrKeys));
if(pProfile->nAddIEAssocLength)
{
status = palAllocateMemory(pMac->hHdd,
(void **)&pConnectProfile->pAddIEAssoc, pProfile->nAddIEAssocLength);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("Failed to allocate memory for additional IEs")) ;
return eHAL_STATUS_FAILURE;
}
pConnectProfile->nAddIEAssocLength = pProfile->nAddIEAssocLength;
palCopyMemory(pMac->hHdd, pConnectProfile->pAddIEAssoc, pProfile->pAddIEAssoc,
pProfile->nAddIEAssocLength);
}
csrGetBssIdBssDesc(pMac, pSirBssDesc, &pConnectProfile->bssid);
#ifdef <API key>
if (pSirBssDesc->mdiePresent)
{
pConnectProfile->MDID.mdiePresent = 1;
pConnectProfile->MDID.mobilityDomain = (pSirBssDesc->mdie[1] << 8) | (pSirBssDesc->mdie[0]);
}
#endif
if( NULL == pIesTemp )
{
status = <API key>(pMac, pSirBssDesc, &pIesTemp);
}
#ifdef FEATURE_WLAN_CCX
if ((csrIsProfileCCX(pProfile) ||
((pIesTemp->CCXVersion.present)
&& ((pProfile->negotiatedAuthType == eCSR_<API key>)
|| (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)
|| (pProfile->negotiatedAuthType == <API key>)
|| (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN)
#ifdef WLAN_FEATURE_11W
|| (pProfile->negotiatedAuthType == eCSR_<API key>)
#endif
|| (pProfile->negotiatedAuthType == <API key>))))
&& (pMac->roam.configParam.<API key>))
{
pConnectProfile->isCCXAssoc = 1;
}
#endif
if(HAL_STATUS_SUCCESS(status))
{
if(pIesTemp->SSID.present)
{
pConnectProfile->SSID.length = pIesTemp->SSID.num_ssid;
palCopyMemory(pMac->hHdd, pConnectProfile->SSID.ssId,
pIesTemp->SSID.ssid, pIesTemp->SSID.num_ssid);
}
status = <API key>(pMac, sessionId, pSirBssDesc);
if( CSR_IS_QOS_BSS(pIesTemp) || pIesTemp->HTCaps.present)
{
pConnectProfile->qap = TRUE;
}
else
{
pConnectProfile->qap = FALSE;
}
if ( NULL == pIes )
{
palFreeMemory(pMac->hHdd, pIesTemp);
}
}
pConnectProfile->qosConnection = pMac->roam.roamSession[sessionId].fWMMConnection;
if(!HAL_STATUS_SUCCESS(status))
{
<API key>(pMac, sessionId);
}
for(index = 0; index < pProfile->SSIDs.numOfSSIDs; index++)
{
if((pProfile->SSIDs.SSIDList[index].SSID.length == pConnectProfile->SSID.length) &&
palEqualMemory(pMac->hHdd, pProfile->SSIDs.SSIDList[index].SSID.ssId,
pConnectProfile->SSID.ssId, pConnectProfile->SSID.length))
{
pConnectProfile->handoffPermitted = pProfile->SSIDs.SSIDList[index].handoffPermitted;
break;
}
pConnectProfile->handoffPermitted = FALSE;
}
return (status);
}
static void <API key>( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJoinRsp )
{
tListElem *pEntry = NULL;
tSmeCmd *pCommand = NULL;
pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK);
if(pEntry)
{
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
}
if ( eSIR_SME_SUCCESS == pSmeJoinRsp->statusCode )
{
if(pCommand && <API key> == pCommand->u.roamCmd.roamReason)
{
#ifndef <API key>
sme_QosCsrEventInd(pMac, pSmeJoinRsp->sessionId, <API key>, NULL);
#endif
}
csrRoamComplete( pMac, eCsrJoinSuccess, (void *)pSmeJoinRsp );
}
else
{
tANI_U32 roamId = 0;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pSmeJoinRsp->sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), pSmeJoinRsp->sessionId);
return;
}
if(pCommand)
{
roamId = pCommand->u.roamCmd.roamId;
}
pSession->joinFailStatusCode.statusCode = pSmeJoinRsp->statusCode;
pSession->joinFailStatusCode.reasonCode = pSmeJoinRsp->protStatusCode;
smsLog( pMac, LOGW, "SmeJoinReq failed with statusCode= 0x%08lX [%d]", pSmeJoinRsp->statusCode, pSmeJoinRsp->statusCode );
#if defined <API key>
if (<API key>(pMac))
{
csrRoamCallCallback(pMac, pSmeJoinRsp->sessionId, NULL, roamId, <API key>, <API key>);
<API key>(pMac, pSmeJoinRsp->sessionId, <API key>);
}
#endif
if (pCommand)
{
if(CSR_IS_WDS_STA( &pCommand->u.roamCmd.roamProfile ))
{
pCommand->u.roamCmd.fStopWds = eANI_BOOLEAN_TRUE;
pSession->connectedProfile.BSSType = <API key>;
<API key>(pMac);
}
else if( CSR_IS_WDS( &pCommand->u.roamCmd.roamProfile ) )
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
else
{
csrRoam(pMac, pCommand);
}
}
else
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
}
}
eHalStatus csrRoamIssueJoin( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pSirBssDesc,
tDot11fBeaconIEs *pIes,
tCsrRoamProfile *pProfile, tANI_U32 roamId )
{
eHalStatus status;
smsLog( pMac, LOG1, "Attempting to Join Bssid= %02x-%02x-%02x-%02x-%02x-%02x",
pSirBssDesc->bssId[ 0 ],pSirBssDesc->bssId[ 1 ],pSirBssDesc->bssId[ 2 ],
pSirBssDesc->bssId[ 3 ],pSirBssDesc->bssId[ 4 ],pSirBssDesc->bssId[ 5 ] );
<API key>( pMac, <API key>, sessionId);
status = csrSendJoinReqMsg( pMac, sessionId, pSirBssDesc, pProfile, pIes, eWNI_SME_JOIN_REQ );
return (status);
}
static eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pSirBssDesc,
tDot11fBeaconIEs *pIes, tCsrRoamProfile *pProfile)
{
csrRoamStateChange( pMac, <API key>, sessionId);
<API key>( pMac, <API key>, sessionId );
smsLog(pMac, LOGE, FL(" calling csrSendJoinReqMsg (<API key>)"));
return csrSendJoinReqMsg( pMac, sessionId, pSirBssDesc, pProfile, pIes, <API key>);
}
void <API key>(tpAniSirGlobal pMac)
{
tListElem *pEntry;
tSmeCmd *pCommand;
tCsrRoamInfo roamInfo;
tANI_U32 sessionId;
tCsrRoamSession *pSession;
pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK);
if(pEntry)
{
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
if ( eSmeCommandRoam == pCommand->command )
{
sessionId = pCommand->sessionId;
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if(pSession->bRefAssocStartCnt > 0)
{
pSession->bRefAssocStartCnt
}
if( pCommand->u.roamCmd.fStopWds )
{
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.pBssDesc = pCommand->u.roamCmd.pLastRoamBss;
roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
if (CSR_IS_WDS(&pSession->connectedProfile)){
pSession->connectState = <API key>;
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
eCSR_ROAM_WDS_IND,
<API key>);
}else if (CSR_IS_INFRA_AP(&pSession->connectedProfile)){
pSession->connectState = <API key>;
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId,
eCSR_ROAM_INFRA_IND,
<API key>);
}
if( !HAL_STATUS_SUCCESS( csrRoamIssueStopBss( pMac, sessionId, <API key> ) ) )
{
smsLog(pMac, LOGE, " Failed to reissue stop_bss command for WDS after disassociated");
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
}
else if(eCsrStopRoaming == csrRoamJoinNextBss(pMac, pCommand, eANI_BOOLEAN_TRUE))
{
smsLog(pMac, LOGW, " Failed to reissue join command after disassociated");
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
}
else
{
smsLog(pMac, LOGW, " Command is not roaming after disassociated");
}
}
else
{
smsLog(pMac, LOGE, " Disassoc rsp cannot continue because no command is available");
}
}
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
tListElem *pEntry;
tSmeCmd *pCommand = NULL;
csrLLLock( &pMac->sme.smeCmdActiveList );
pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
if(pEntry)
{
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
if( ( eSmeCommandRoam == pCommand->command ) && ( sessionId == pCommand->sessionId ) )
{
fRet = eANI_BOOLEAN_TRUE;
}
}
if(eANI_BOOLEAN_FALSE == fRet)
{
csrLLLock(&pMac->sme.smeCmdPendingList);
pEntry = csrLLPeekHead(&pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK);
while(pEntry)
{
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
if( ( eSmeCommandRoam == pCommand->command ) && ( sessionId == pCommand->sessionId ) )
{
fRet = eANI_BOOLEAN_TRUE;
break;
}
pEntry = csrLLNext(&pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK);
}
csrLLUnlock(&pMac->sme.smeCmdPendingList);
}
if (eANI_BOOLEAN_FALSE == fRet)
{
csrLLLock(&pMac->roam.roamCmdPendingList);
pEntry = csrLLPeekHead(&pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK);
while (pEntry)
{
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
if (( eSmeCommandRoam == pCommand->command ) && ( sessionId == pCommand->sessionId ) )
{
fRet = eANI_BOOLEAN_TRUE;
break;
}
pEntry = csrLLNext(&pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK);
}
csrLLUnlock(&pMac->roam.roamCmdPendingList);
}
csrLLUnlock( &pMac->sme.smeCmdActiveList );
return (fRet);
}
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac)
{
tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
tANI_U32 i;
for( i = 0; i < <API key>; i++ )
{
if( <API key>( pMac, i ) && ( fRet = <API key>( pMac, i ) ) )
{
break;
}
}
return ( fRet );
}
tANI_BOOLEAN csrIsCommandWaiting(tpAniSirGlobal pMac)
{
tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
csrLLLock( &pMac->sme.smeCmdActiveList );
fRet = csrLLIsListEmpty(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
if(eANI_BOOLEAN_FALSE == fRet)
{
fRet = csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK);
}
csrLLUnlock( &pMac->sme.smeCmdActiveList );
return (fRet);
}
tANI_BOOLEAN <API key>( tpAniSirGlobal pMac )
{
tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
tListElem *pEntry;
tCsrCmd *pCommand;
csrLLLock( &pMac->sme.smeCmdActiveList );
pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
if( pEntry )
{
pCommand = GET_BASE_ADDR(pEntry, tCsrCmd, Link);
if( ( eCsrRoamCommandScan == pCommand->command ) &&
( ( eCsrScanForSsid == pCommand->u.scanCmd.reason ) ||
( <API key> == pCommand->u.scanCmd.reason ) ||
( eCsrScanP2PFindPeer == pCommand->u.scanCmd.reason ) ) )
{
fRet = eANI_BOOLEAN_TRUE;
}
}
csrLLUnlock( &pMac->sme.smeCmdActiveList );
return (fRet);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand = NULL;
tANI_BOOLEAN fHighPriority = eANI_BOOLEAN_TRUE;
tANI_BOOLEAN fRemoveCmd = FALSE;
tListElem *pEntry;
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if ( pEntry )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if ( !pCommand )
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
return <API key>;
}
if ( eSmeCommandRoam == pCommand->command )
{
if (pCommand->u.roamCmd.roamReason == <API key>)
{
fRemoveCmd = csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK );
}
else
{
smsLog( pMac, LOGE, FL(" Unexpected active roam command present ") );
}
if (fRemoveCmd == FALSE)
{
pCommand = NULL;
}
}
}
if(NULL == pCommand)
{
smsLog( pMac, LOGE, FL(" fail to get command buffer as expected based on previous connect roam command") );
return <API key>;
}
do
{
if( CSR_IS_WAIT_FOR_KEY( pMac, sessionId ) )
{
<API key>( pMac );
<API key>( pMac, <API key>, sessionId );
}
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.roamReason = <API key>;
status = csrQueueSmeCommand(pMac, pCommand, fHighPriority);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
<API key>( pMac, pCommand );
}
} while( 0 );
return( status );
}
static void <API key>( tpAniSirGlobal pMac, tANI_U32 result )
{
tListElem *pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK);
tCsrScanResult *pScanResult = NULL;
tSirBssDescription *pBssDesc = NULL;
tSmeCmd *pCommand = NULL;
tANI_U32 sessionId;
tCsrRoamSession *pSession;
if(NULL == pEntry)
{
smsLog(pMac, LOGW, " CFG_CNF with active list empty");
return;
}
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
sessionId = pCommand->sessionId;
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if(CSR_IS_ROAMING(pSession) && pSession->fCancelRoaming)
{
smsLog(pMac, LOGW, FL(" Roam command cancelled"));
csrRoamComplete(pMac, eCsrNothingToJoin, NULL);
}
else if ( !CSR_IS_ROAMING(pSession) && <API key>(pCommand) )
{
smsLog(pMac, LOGW, FL(" Roam command (reason %d) aborted due to roaming completed\n"),
pCommand->u.roamCmd.roamReason);
<API key>( pMac, pCommand );
csrRoamComplete(pMac, eCsrNothingToJoin, NULL);
}
else
{
if ( <API key>(result) )
{
smsLog(pMac, LOG2, "Cfg sequence complete");
if(pCommand->u.roamCmd.pRoamBssEntry)
{
pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link);
pBssDesc = &pScanResult->Result.BssDescriptor;
}
if ( csrIsBssTypeIBSS( pCommand->u.roamCmd.roamProfile.BSSType ) ||
CSR_IS_WDS( &pCommand->u.roamCmd.roamProfile )
|| CSR_IS_INFRA_AP(&pCommand->u.roamCmd.roamProfile)
)
{
if(!HAL_STATUS_SUCCESS(<API key>( pMac, sessionId,
&pSession->bssParams, &pCommand->u.roamCmd.roamProfile,
pBssDesc, pCommand->u.roamCmd.roamId )))
{
smsLog(pMac, LOGW, " CSR start BSS failed");
csrRoamComplete(pMac, eCsrStartBssFailure, NULL);
}
}
else
{
if (!pCommand->u.roamCmd.pRoamBssEntry)
{
smsLog(pMac, LOGW, " pRoamBssEntry is NULL");
csrRoamComplete(pMac, eCsrJoinFailure, NULL);
return;
}
VOS_ASSERT(pScanResult != NULL);
if ( csrIsInfraBssDesc( pBssDesc ) )
{
tDot11fBeaconIEs *pIesLocal = (tDot11fBeaconIEs *)pScanResult->Result.pvIes;
if(pIesLocal || (HAL_STATUS_SUCCESS(<API key>(pMac, pBssDesc, &pIesLocal))) )
{
if( <API key>( pMac, sessionId ) )
{
if ( csrIsSsidEqual( pMac, pSession->pConnectBssDesc, pBssDesc,
pIesLocal ) )
{
pCommand->u.roamCmd.fReassoc = eANI_BOOLEAN_TRUE;
<API key>( pMac, sessionId, pBssDesc, pIesLocal,
&pCommand->u.roamCmd.roamProfile );
}
else
{
if(!HAL_STATUS_SUCCESS(csrRoamIssueJoin( pMac, sessionId, pBssDesc,
pIesLocal,
&pCommand->u.roamCmd.roamProfile, pCommand->u.roamCmd.roamId )))
{
csrRoam( pMac, pCommand );
}
}
}
else
{
eHalStatus status = eHAL_STATUS_SUCCESS;
#ifdef <API key>
if (<API key>(pMac) &&
csrRoamIs11rAssoc(pMac))
{
status = <API key>(pMac, sessionId, pBssDesc,
(tDot11fBeaconIEs *)( pScanResult->Result.pvIes ), &pCommand->u.roamCmd.roamProfile);
}
else
#endif
#ifdef FEATURE_WLAN_CCX
if (<API key>(pMac) &&
csrRoamIsCCXAssoc(pMac))
{
status = <API key>(pMac, sessionId);
}
else
#endif
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac) &&
<API key>(pMac, sessionId))
{
status = <API key>(pMac, sessionId);
}
else
#endif
{
status = csrRoamIssueJoin( pMac, sessionId, pBssDesc,
(tDot11fBeaconIEs *)( pScanResult->Result.pvIes ),
&pCommand->u.roamCmd.roamProfile, pCommand->u.roamCmd.roamId );
}
if(!HAL_STATUS_SUCCESS(status))
{
csrRoam( pMac, pCommand );
}
}
if( !pScanResult->Result.pvIes )
{
palFreeMemory(pMac->hHdd, pIesLocal);
}
}
}
else
{
smsLog(pMac, LOGW, FL(" found BSSType mismatching the one in BSS description"));
}
}
}
else
{
if( pCommand->u.roamCmd.pRoamBssEntry && <API key>( &pCommand->u.roamCmd.roamProfile ) )
{
csrRoam(pMac, pCommand);
}
else
{
if ( csrIsBssTypeIBSS( pCommand->u.roamCmd.roamProfile.BSSType ) )
{
csrRoamComplete(pMac, eCsrStartBssFailure, NULL);
}
else
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
}
}
}
}
static void <API key>( tpAniSirGlobal pMac, tSirSmeAuthRsp *pSmeAuthRsp )
{
smsLog(pMac, LOGW, FL("is no-op"));
if ( eSIR_SME_SUCCESS == pSmeAuthRsp->statusCode )
{
smsLog( pMac, LOGW, "CSR SmeAuthReq Successful" );
}
else {
smsLog( pMac, LOGW, "CSR SmeAuthReq failed with statusCode= 0x%08lX [%d]", pSmeAuthRsp->statusCode, pSmeAuthRsp->statusCode );
}
}
static void <API key>( tpAniSirGlobal pMac, tpSirSmeJoinRsp pSmeJoinRsp )
{
<API key> result;
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
tCsrRoamInfo roamInfo;
tANI_U32 roamId = 0;
if ( eSIR_SME_SUCCESS == pSmeJoinRsp->statusCode )
{
smsLog( pMac, LOGW, "CSR SmeReassocReq Successful" );
result = eCsrReassocSuccess;
#ifdef <API key>
if (<API key>(pMac))
{
sme_QosCsrEventInd(pMac, pSmeJoinRsp->sessionId, <API key>, NULL);
csrRoamComplete( pMac, result, pSmeJoinRsp);
}
else
#endif
{
csrRoamComplete( pMac, result, NULL );
}
}
else
{
smsLog( pMac, LOGW, "CSR SmeReassocReq failed with statusCode= 0x%08lX [%d]", pSmeJoinRsp->statusCode, pSmeJoinRsp->statusCode );
result = eCsrReassocFailure;
#ifdef <API key>
if ((<API key> == pSmeJoinRsp->statusCode) ||
(<API key> == pSmeJoinRsp->statusCode))
{
if (pNeighborRoamInfo)
{
vos_mem_zero(&roamInfo, sizeof(tCsrRoamInfo));
csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId,
&roamInfo, roamId, <API key>, eSIR_SME_SUCCESS);
csrRoamComplete( pMac, eCsrJoinFailure, NULL );
return;
}
}
#endif
if(!HAL_STATUS_SUCCESS(<API key>( pMac, pSmeJoinRsp->sessionId,
<API key>, FALSE )))
{
csrRoamComplete( pMac, eCsrJoinFailure, NULL );
}
}
}
static void <API key>(tpAniSirGlobal pMac, tSirSmeRsp *pSmeRsp)
{
#ifdef <API key>
{
<API key> *pIbssLog;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
pIbssLog->eventId = <API key>;
if(eSIR_SME_SUCCESS != pSmeRsp->statusCode)
{
pIbssLog->status = <API key>;
}
<API key>(pIbssLog);
}
}
#endif
pMac->roam.roamSession[pSmeRsp->sessionId].connectState = <API key>;
if(<API key>( pMac, pSmeRsp->sessionId))
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
else if(<API key>( pMac, pSmeRsp->sessionId))
{
<API key>(pMac);
}
}
void <API key>( tpAniSirGlobal pMac, tSirSmeDisassocRsp *pSmeRsp )
{
tSirResultCodes statusCode;
#if defined <API key>
tScanResultHandle hBSSList;
tANI_BOOLEAN fCallCallback, fRemoveCmd;
eHalStatus status;
tCsrRoamInfo roamInfo;
<API key> *pScanFilter = NULL;
tANI_U32 roamId = 0;
tCsrRoamProfile *pCurRoamProfile = NULL;
tListElem *pEntry = NULL;
tSmeCmd *pCommand = NULL;
#endif
tANI_U32 sessionId;
tCsrRoamSession *pSession;
tSirSmeDisassocRsp SmeDisassocRsp;
<API key>((tANI_U8 *)pSmeRsp, &SmeDisassocRsp);
sessionId = SmeDisassocRsp.sessionId;
statusCode = SmeDisassocRsp.statusCode;
smsLog( pMac, LOG2, "<API key> sessionId %d", sessionId);
if ( csrIsConnStateInfra( pMac, sessionId ) )
{
pMac->roam.roamSession[sessionId].connectState = <API key>;
}
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if ( <API key>( pMac, sessionId ) )
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
else if ( <API key>( pMac, sessionId ) ||
<API key>( pMac, sessionId ) )
{
if ( eSIR_SME_SUCCESS == statusCode )
{
smsLog( pMac, LOG2, "CSR SmeDisassocReq force disassociated Successfully" );
}
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
else if ( <API key>( pMac, sessionId ) )
{
smsLog( pMac, LOGE, "CSR SmeDisassocReq due to HO on session %d", sessionId );
#if defined (<API key>)
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter, sizeof(<API key>));
if(HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, pScanFilter, sizeof(<API key>));
status = <API key>(pMac,
&pMac->roam.neighborRoamInfo.<API key>, pScanFilter);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, "%s: failed to prepare scan filter with status %d",
__func__, status);
goto POST_ROAM_FAILURE;
}
else
{
status = csrScanGetResult(pMac, pScanFilter, &hBSSList);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGE,"%s: csrScanGetResult failed with status %d",
__func__, status);
goto POST_ROAM_FAILURE;
}
}
}
else
{
smsLog( pMac, LOGE,"%s: alloc for pScanFilter failed with status %d",
__func__, status);
goto POST_ROAM_FAILURE;
}
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if ( pEntry )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if ( eSmeCommandRoam == pCommand->command )
{
fRemoveCmd = csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK );
if(pCommand->u.roamCmd.fReleaseProfile)
{
csrReleaseProfile(pMac, &pCommand->u.roamCmd.roamProfile);
pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_FALSE;
}
if( fRemoveCmd )
<API key>( pMac, pCommand );
else
{
smsLog( pMac, LOGE, "%s: fail to remove cmd reason %d",
__func__, pCommand->u.roamCmd.roamReason );
}
}
else
{
smsLog( pMac, LOGE, "%s: roam command not active", __func__ );
}
}
else
{
smsLog( pMac, LOGE, "%s: NO commands are active", __func__ );
}
roamInfo.reasonCode = <API key>;
palCopyMemory(pMac->hHdd, roamInfo.bssid,
pMac->roam.neighborRoamInfo.<API key>.BSSIDs.bssid,
sizeof(tSirMacAddr));
csrRoamCallCallback(pMac,sessionId, &roamInfo, 0,
<API key>, <API key>);
if(HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd,
(void **)&pCurRoamProfile, sizeof(tCsrRoamProfile))))
{
palZeroMemory(pMac->hHdd, pCurRoamProfile, sizeof(tCsrRoamProfile));
csrRoamCopyProfile(pMac, pCurRoamProfile, pSession->pCurRoamProfile);
status = csrRoamIssueConnect(pMac, sessionId, pCurRoamProfile,
hBSSList, <API key>,
roamId, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_FALSE);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGE,"%s: csrRoamIssueConnect failed with status %d",
__func__, status);
fCallCallback = eANI_BOOLEAN_TRUE;
}
sme_QosCsrEventInd(pMac, sessionId, <API key>, NULL);
csrReleaseProfile(pMac, pCurRoamProfile);
palFreeMemory(pMac->hHdd, pCurRoamProfile);
csrFreeScanFilter(pMac, pScanFilter);
palFreeMemory( pMac->hHdd, pScanFilter );
return;
}
POST_ROAM_FAILURE:
if (pScanFilter)
{
csrFreeScanFilter(pMac, pScanFilter);
palFreeMemory( pMac->hHdd, pScanFilter );
}
if (pCurRoamProfile)
palFreeMemory(pMac->hHdd, pCurRoamProfile);
vos_mem_zero(&roamInfo, sizeof(tCsrRoamInfo));
csrRoamCallCallback(pMac, sessionId,
&roamInfo, 0, <API key>, eSIR_SME_SUCCESS);
if (!HAL_STATUS_SUCCESS(<API key>(pMac, sessionId,
<API key>, FALSE)))
{
smsLog( pMac, LOGE,"%s: <API key> failed with status %d",
__func__, status);
csrRoamComplete( pMac, eCsrJoinFailure, NULL );
}
#endif
}
else if ( <API key>( pMac, sessionId ) )
{
csrRoamComplete( pMac, eCsrJoinFailure, NULL );
}
else
{
if ( eSIR_SME_SUCCESS == statusCode )
{
smsLog( pMac, LOG2, "CSR SmeDisassocReq disassociated Successfully" );
}
else
{
smsLog( pMac, LOGE, "SmeDisassocReq failed with statusCode= 0x%08lX", statusCode );
}
<API key>(pMac);
}
}
static void <API key>( tpAniSirGlobal pMac, tSirSmeDeauthRsp *pSmeRsp )
{
tSirResultCodes statusCode;
smsLog(pMac, LOGW, FL("is no-op"));
statusCode = <API key>( pSmeRsp );
pMac->roam.deauthRspStatus = statusCode;
if ( <API key>( pMac, pSmeRsp->sessionId) )
{
csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
}
else
{
if ( eSIR_SME_SUCCESS == statusCode )
{
smsLog( pMac, LOG2, "CSR SmeDeauthReq disassociated Successfully" );
}
else
{
smsLog( pMac, LOGW, "SmeDeauthReq failed with statusCode= 0x%08lX", statusCode );
}
<API key>(pMac);
}
}
static void <API key>( tpAniSirGlobal pMac, tSirSmeStartBssRsp *pSmeStartBssRsp )
{
<API key> result;
if ( eSIR_SME_SUCCESS == pSmeStartBssRsp->statusCode )
{
smsLog( pMac, LOGW, "SmeStartBssReq Successful" );
result = eCsrStartBssSuccess;
}
else
{
smsLog( pMac, LOGW, "SmeStartBssReq failed with statusCode= 0x%08lX", pSmeStartBssRsp->statusCode );
result = eCsrStartBssFailure;
}
csrRoamComplete( pMac, result, pSmeStartBssRsp);
}
void <API key>( tpAniSirGlobal pMac, void *pMsgBuf )
{
tSirSmeRsp *pSmeRsp;
tSmeIbssPeerInd *pIbssPeerInd;
tCsrRoamInfo roamInfo;
tANI_U32 sessionId = 0;
pSmeRsp = (tSirSmeRsp *)pMsgBuf;
smsLog( pMac, LOG2, "Message %d[0x%04X] received in substate %d",
pSmeRsp->messageType, pSmeRsp->messageType,
pMac->roam.curSubState[pSmeRsp->sessionId] );
pSmeRsp->messageType = (pSmeRsp->messageType);
pSmeRsp->length = (pSmeRsp->length);
pSmeRsp->statusCode = (pSmeRsp->statusCode);
switch (pSmeRsp->messageType)
{
case eWNI_SME_JOIN_RSP:
if (<API key>(pMac, pSmeRsp->sessionId))
{
<API key>( pMac, (tSirSmeJoinRsp *)pSmeRsp );
}
break;
case eWNI_SME_AUTH_RSP:
if (<API key>( pMac, pSmeRsp->sessionId) )
{
<API key>( pMac, (tSirSmeAuthRsp *)pSmeRsp );
}
break;
case <API key>:
if (<API key>( pMac, pSmeRsp->sessionId) )
{
<API key>( pMac, (tpSirSmeJoinRsp )pSmeRsp );
}
break;
case <API key>:
{
<API key>(pMac, pSmeRsp);
}
break;
case <API key>:
if ( <API key>( pMac, pSmeRsp->sessionId ) ||
<API key>( pMac, pSmeRsp->sessionId ) ||
<API key>( pMac, pSmeRsp->sessionId ) ||
<API key>( pMac, pSmeRsp->sessionId ) ||
<API key>( pMac, pSmeRsp->sessionId ) ||
<API key>( pMac, pSmeRsp->sessionId ) )
{
smsLog(pMac, LOG1, FL("<API key> subState = %d"), pMac->roam.curSubState[pSmeRsp->sessionId]);
<API key>( pMac, (tSirSmeDisassocRsp *)pSmeRsp );
}
break;
case eWNI_SME_DEAUTH_RSP:
if ( <API key>( pMac, pSmeRsp->sessionId ) )
{
<API key>( pMac, (tSirSmeDeauthRsp *)pSmeRsp );
}
break;
case <API key>:
if (<API key>( pMac, pSmeRsp->sessionId ) )
{
<API key>( pMac, (tSirSmeStartBssRsp *)pSmeRsp );
}
break;
case WNI_CFG_SET_CNF:
if ( <API key>( pMac, pSmeRsp->sessionId ) )
{
<API key>( pMac, ((tCsrCfgSetRsp *)pSmeRsp)->respStatus );
}
break;
case <API key>:
pIbssPeerInd = (tSmeIbssPeerInd*)pSmeRsp;
smsLog(pMac, LOGE, "CSR: Peer departed notification from LIM in joining state");
palZeroMemory( pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo) );
roamInfo.staId = (tANI_U8)pIbssPeerInd->staId;
roamInfo.ucastSig = (tANI_U8)pIbssPeerInd->ucastSig;
roamInfo.bcastSig = (tANI_U8)pIbssPeerInd->bcastSig;
palCopyMemory(pMac->hHdd, &roamInfo.peerMac, pIbssPeerInd->peerAddr, sizeof(tCsrBssid));
csrRoamCallCallback(pMac, sessionId, &roamInfo, 0,
<API key>,
<API key>);
break;
default:
smsLog( pMac, LOG1, "Unexpected message type = %d[0x%X] received in substate %d",
pSmeRsp->messageType, pSmeRsp->messageType,
pMac->roam.curSubState[pSmeRsp->sessionId] );
if(!<API key>(pMac, sessionId))
{
<API key>( pMac, pSmeRsp );
}
break;
}
}
void <API key>( tpAniSirGlobal pMac, void *pMsgBuf )
{
tSirSmeRsp *pSirMsg = (tSirSmeRsp *)pMsgBuf;
switch (pSirMsg->messageType)
{
case <API key>:
smsLog( pMac, LOG2, FL("Stats rsp from PE"));
<API key>( pMac, pSirMsg );
break;
case <API key>:
{
tCsrRoamSession *pSession;
<API key> *pUpperLayerAssocCnf;
tCsrRoamInfo roamInfo;
tCsrRoamInfo *pRoamInfo = NULL;
tANI_U32 sessionId;
eHalStatus status;
smsLog( pMac, LOG1, FL("ASSOCIATION confirmation can be given to upper layer "));
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
pRoamInfo = &roamInfo;
pUpperLayerAssocCnf = (<API key> *)pMsgBuf;
status = <API key>( pMac, (tCsrBssid *)pUpperLayerAssocCnf->bssId, &sessionId );
pSession = CSR_GET_SESSION(pMac, sessionId);
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pRoamInfo->statusCode = eSIR_SME_SUCCESS;
pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
pRoamInfo->staId = (tANI_U8)pUpperLayerAssocCnf->aid;
pRoamInfo->rsnIELen = (tANI_U8)pUpperLayerAssocCnf->rsnIE.length;
pRoamInfo->prsnIE = pUpperLayerAssocCnf->rsnIE.rsnIEdata;
pRoamInfo->addIELen = (tANI_U8)pUpperLayerAssocCnf->addIE.length;
pRoamInfo->paddIE = pUpperLayerAssocCnf->addIE.addIEdata;
palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pUpperLayerAssocCnf->peerMacAddr, sizeof(tSirMacAddr));
palCopyMemory(pMac->hHdd, &pRoamInfo->bssid, pUpperLayerAssocCnf->bssId, sizeof(tCsrBssid));
pRoamInfo->wmmEnabledSta = pUpperLayerAssocCnf->wmmEnabledSta;
if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile) )
{
pMac->roam.roamSession[sessionId].connectState = <API key>;
pRoamInfo->fReassocReq = pUpperLayerAssocCnf->reassocReq;
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_INFRA_IND, <API key>);
}
if(CSR_IS_WDS_AP( pRoamInfo->u.pConnectedProfile))
{
vos_sleep( 100 );
pMac->roam.roamSession[sessionId].connectState = <API key>;
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_WDS_IND, <API key>);
}
}
break;
default:
<API key>( pMac, pSirMsg );
break;
}
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrEncryptionType EncryptType,
tSirBssDescription *pBssDescription,
tSirMacAddr *bssId, tANI_BOOLEAN addKey,
tANI_BOOLEAN fUnicast, tAniKeyDirection aniKeyDirection,
tANI_U8 keyId, tANI_U16 keyLength,
tANI_U8 *pKey, tANI_U8 paeRole )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tAniEdType edType;
if(<API key> == EncryptType)
{
EncryptType = <API key>;
}
edType = <API key>( EncryptType );
if ( <API key>( EncryptType ) ||
addKey )
{
tCsrRoamSetKey setKey;
setKey.encType = EncryptType;
setKey.keyDirection = aniKeyDirection;
palCopyMemory( pMac->hHdd, &setKey.peerMac, bssId, sizeof(tCsrBssid) );
setKey.paeRole = paeRole;
setKey.keyId = keyId;
setKey.keyLength = keyLength;
if( keyLength )
{
palCopyMemory( pMac->hHdd, setKey.Key, pKey, keyLength );
}
status = <API key>( pMac, sessionId, &setKey, 0 );
}
return (status);
}
static eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrRoamSetKey *pSetKey, tANI_U32 roamId )
{
eHalStatus status = <API key>;
tSmeCmd *pCommand = NULL;
#ifdef FEATURE_WLAN_CCX
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
#endif
do
{
pCommand = csrGetCommandBuffer(pMac);
if(NULL == pCommand)
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
break;
}
pCommand->command = eSmeCommandSetKey;
pCommand->sessionId = (tANI_U8)sessionId;
if ( ( <API key> == pSetKey->encType ) ||
( <API key> == pSetKey->encType ) )
{
if( pSetKey->keyLength )
{
if ( pSetKey->keyLength < CSR_WEP40_KEY_LEN )
{
smsLog( pMac, LOGW, "Invalid WEP40 keylength [= %d] in SetContext call", pSetKey->keyLength );
break;
}
pCommand->u.setKeyCmd.keyLength = CSR_WEP40_KEY_LEN;
palCopyMemory( pMac->hHdd, pCommand->u.setKeyCmd.Key, pSetKey->Key, CSR_WEP40_KEY_LEN );
}
}
else if ( ( <API key> == pSetKey->encType ) ||
( <API key> == pSetKey->encType ) )
{
if( pSetKey->keyLength )
{
if ( pSetKey->keyLength < CSR_WEP104_KEY_LEN )
{
smsLog( pMac, LOGW, "Invalid WEP104 keylength [= %d] in SetContext call", pSetKey->keyLength );
break;
}
pCommand->u.setKeyCmd.keyLength = CSR_WEP104_KEY_LEN;
palCopyMemory( pMac->hHdd, pCommand->u.setKeyCmd.Key, pSetKey->Key, CSR_WEP104_KEY_LEN );
}
}
else if ( <API key> == pSetKey->encType )
{
if ( pSetKey->keyLength < CSR_TKIP_KEY_LEN )
{
smsLog( pMac, LOGW, "Invalid TKIP keylength [= %d] in SetContext call", pSetKey->keyLength );
break;
}
pCommand->u.setKeyCmd.keyLength = CSR_TKIP_KEY_LEN;
palCopyMemory( pMac->hHdd, pCommand->u.setKeyCmd.Key, pSetKey->Key, CSR_TKIP_KEY_LEN );
}
else if ( <API key> == pSetKey->encType )
{
if ( pSetKey->keyLength < CSR_AES_KEY_LEN )
{
smsLog( pMac, LOGW, "Invalid AES/CCMP keylength [= %d] in SetContext call", pSetKey->keyLength );
break;
}
pCommand->u.setKeyCmd.keyLength = CSR_AES_KEY_LEN;
palCopyMemory( pMac->hHdd, pCommand->u.setKeyCmd.Key, pSetKey->Key, CSR_AES_KEY_LEN );
}
#ifdef FEATURE_WLAN_WAPI
else if ( <API key> == pSetKey->encType )
{
if ( pSetKey->keyLength < CSR_WAPI_KEY_LEN )
{
smsLog( pMac, LOGW, "Invalid WAPI keylength [= %d] in SetContext call", pSetKey->keyLength );
break;
}
pCommand->u.setKeyCmd.keyLength = CSR_WAPI_KEY_LEN;
palCopyMemory( pMac->hHdd, pCommand->u.setKeyCmd.Key, pSetKey->Key, CSR_WAPI_KEY_LEN );
}
#endif
#ifdef FEATURE_WLAN_CCX
else if ( <API key> == pSetKey->encType )
{
if ( pSetKey->keyLength < CSR_KRK_KEY_LEN )
{
smsLog( pMac, LOGW, "Invalid KRK keylength [= %d] in SetContext call", pSetKey->keyLength );
break;
}
palCopyMemory( pMac->hHdd, pSession->ccxCckmInfo.krk, pSetKey->Key, CSR_KRK_KEY_LEN );
pSession->ccxCckmInfo.reassoc_req_num=1;
pSession->ccxCckmInfo.krk_plumbed = eANI_BOOLEAN_TRUE;
status = eHAL_STATUS_SUCCESS;
break;
}
#endif
#ifdef WLAN_FEATURE_11W
else if (<API key> == pSetKey->encType)
{
if (pSetKey->keyLength < CSR_AES_KEY_LEN)
{
smsLog(pMac, LOGW, "Invalid AES/CCMP keylength [= %d] in SetContext call", pSetKey->keyLength);
break;
}
pCommand->u.setKeyCmd.keyLength = CSR_AES_KEY_LEN;
palCopyMemory(pMac->hHdd, pCommand->u.setKeyCmd.Key, pSetKey->Key, CSR_AES_KEY_LEN);
}
#endif
status = eHAL_STATUS_SUCCESS;
pCommand->u.setKeyCmd.roamId = roamId;
pCommand->u.setKeyCmd.encType = pSetKey->encType;
pCommand->u.setKeyCmd.keyDirection = pSetKey->keyDirection;
palCopyMemory( pMac->hHdd, &pCommand->u.setKeyCmd.peerMac, &pSetKey->peerMac, sizeof(tCsrBssid) );
pCommand->u.setKeyCmd.paeRole = pSetKey->paeRole;
pCommand->u.setKeyCmd.keyId = pSetKey->keyId;
palCopyMemory( pMac->hHdd, pCommand->u.setKeyCmd.keyRsc, pSetKey->keyRsc, CSR_MAX_RSC_LEN );
status = csrQueueSmeCommand(pMac, pCommand, eANI_BOOLEAN_TRUE);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
}
} while (0);
if ( ( NULL != pCommand ) &&
( (!HAL_STATUS_SUCCESS( status ) )
#ifdef FEATURE_WLAN_CCX
|| ( <API key> == pSetKey->encType )
#endif
) )
{
<API key>( pMac, pCommand );
}
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId )
{
eHalStatus status = <API key>;
tSmeCmd *pCommand = NULL;
tANI_BOOLEAN fImediate = eANI_BOOLEAN_TRUE;
do
{
if( !csrIsSetKeyAllowed(pMac, sessionId) )
{
smsLog( pMac, LOGW, FL(" wrong state not allowed to set key") );
status = <API key>;
break;
}
pCommand = csrGetCommandBuffer(pMac);
if(NULL == pCommand)
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
break;
}
pCommand->command = <API key>;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.removeKeyCmd.roamId = roamId;
pCommand->u.removeKeyCmd.encType = pRemoveKey->encType;
palCopyMemory( pMac->hHdd, &pCommand->u.removeKeyCmd.peerMac, &pRemoveKey->peerMac, sizeof(tSirMacAddr) );
pCommand->u.removeKeyCmd.keyId = pRemoveKey->keyId;
if( CSR_IS_WAIT_FOR_KEY( pMac, sessionId ) )
{
fImediate = eANI_BOOLEAN_FALSE;
}
smsLog( pMac, LOGE, FL("keyType=%d, keyId=%d, PeerMac=%02x, %02x, %02x, %02x, %02x, %02x"),
pRemoveKey->encType, pRemoveKey->keyId,
pCommand->u.removeKeyCmd.peerMac[0],
pCommand->u.removeKeyCmd.peerMac[1],
pCommand->u.removeKeyCmd.peerMac[2],
pCommand->u.removeKeyCmd.peerMac[3],
pCommand->u.removeKeyCmd.peerMac[4],
pCommand->u.removeKeyCmd.peerMac[5]);
status = csrQueueSmeCommand(pMac, pCommand, fImediate);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
break;
}
} while (0);
if( !HAL_STATUS_SUCCESS( status ) && ( NULL != pCommand ) )
{
<API key>( pMac, pCommand );
}
return (status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
eHalStatus status;
tANI_U8 numKeys = ( pCommand->u.setKeyCmd.keyLength ) ? 1 : 0;
tAniEdType edType = <API key>( pCommand->u.setKeyCmd.encType );
tANI_BOOLEAN fUnicast = ( pCommand->u.setKeyCmd.peerMac[0] == 0xFF ) ? eANI_BOOLEAN_FALSE : eANI_BOOLEAN_TRUE;
tANI_U32 sessionId = pCommand->sessionId;
#ifdef <API key>
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
<API key>(setKeyEvent, <API key>);
if(eSIR_ED_NONE != edType)
{
palZeroMemory(pMac->hHdd, &setKeyEvent, sizeof(<API key>));
if( *(( tANI_U8 *)&pCommand->u.setKeyCmd.peerMac) & 0x01 )
{
setKeyEvent.eventId = <API key>;
setKeyEvent.<API key> = (v_U8_t)<API key>(pCommand->u.setKeyCmd.encType);
setKeyEvent.<API key> = (v_U8_t)<API key>(pSession->connectedProfile.EncryptionType);
}
else
{
setKeyEvent.eventId = <API key>;
setKeyEvent.<API key> = (v_U8_t)<API key>(pCommand->u.setKeyCmd.encType);
setKeyEvent.<API key> = (v_U8_t)<API key>(pSession->connectedProfile.mcEncryptionType);
}
palCopyMemory( pMac->hHdd, setKeyEvent.bssid, pSession->connectedProfile.bssid, 6 );
if(<API key>(pCommand->u.setKeyCmd.encType))
{
tANI_U32 defKeyId;
if(HAL_STATUS_SUCCESS(ccmCfgGetInt(pMac, <API key>, &defKeyId)))
{
setKeyEvent.keyId = (v_U8_t)defKeyId;
}
}
else
{
setKeyEvent.keyId = pCommand->u.setKeyCmd.keyId;
}
setKeyEvent.authMode = (v_U8_t)<API key>(pSession->connectedProfile.AuthType);
<API key>(&setKeyEvent, EVENT_WLAN_SECURITY);
}
#endif
if( csrIsSetKeyAllowed(pMac, sessionId) )
{
status = <API key>( pMac, sessionId,
( tANI_U8 *)&pCommand->u.setKeyCmd.peerMac,
numKeys, edType, fUnicast, pCommand->u.setKeyCmd.keyDirection,
pCommand->u.setKeyCmd.keyId, pCommand->u.setKeyCmd.keyLength,
pCommand->u.setKeyCmd.Key, pCommand->u.setKeyCmd.paeRole,
pCommand->u.setKeyCmd.keyRsc);
}
else
{
smsLog( pMac, LOGW, FL(" cannot process not connected") );
status = <API key>;
}
if( !HAL_STATUS_SUCCESS(status) )
{
smsLog( pMac, LOGE, FL(" error status %d"), status );
csrRoamCallCallback( pMac, sessionId, NULL, pCommand->u.setKeyCmd.roamId, <API key>, <API key>);
#ifdef <API key>
if(eSIR_ED_NONE != edType)
{
if( *(( tANI_U8 *)&pCommand->u.setKeyCmd.peerMac) & 0x01 )
{
setKeyEvent.eventId = <API key>;
}
else
{
setKeyEvent.eventId = <API key>;
}
setKeyEvent.status = <API key>;
<API key>(&setKeyEvent, EVENT_WLAN_SECURITY);
}
#endif
}
return ( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
eHalStatus status;
<API key> pMsg = NULL;
tANI_U16 wMsgLen = sizeof(tSirSmeRemoveKeyReq);
tANI_U8 *p;
tANI_U32 sessionId = pCommand->sessionId;
#ifdef <API key>
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
<API key>(removeKeyEvent, <API key>);
palZeroMemory(pMac->hHdd, &removeKeyEvent, sizeof(<API key>));
removeKeyEvent.eventId = <API key>;
removeKeyEvent.<API key> = (v_U8_t)<API key>(pSession->connectedProfile.mcEncryptionType);
removeKeyEvent.<API key> = (v_U8_t)<API key>(pSession->connectedProfile.EncryptionType);
palCopyMemory( pMac->hHdd, removeKeyEvent.bssid, pSession->connectedProfile.bssid, 6 );
removeKeyEvent.keyId = pCommand->u.removeKeyCmd.keyId;
removeKeyEvent.authMode = (v_U8_t)<API key>(pSession->connectedProfile.AuthType);
<API key>(&removeKeyEvent, EVENT_WLAN_SECURITY);
#endif
if( csrIsSetKeyAllowed(pMac, sessionId) )
{
status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, wMsgLen );
}
else
{
smsLog( pMac, LOGW, FL(" wrong state not allowed to set key") );
status = <API key>;
}
if( HAL_STATUS_SUCCESS( status ) )
{
palZeroMemory(pMac->hHdd, pMsg, wMsgLen);
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->length = pal_cpu_to_be16(wMsgLen);
pMsg->sessionId = (tANI_U8)sessionId;
pMsg->transactionId = 0;
p = (tANI_U8 *)pMsg + sizeof(pMsg->messageType) + sizeof(pMsg->length) +
sizeof(pMsg->sessionId) + sizeof(pMsg->transactionId);
palCopyMemory( pMac->hHdd, p, &pMac->roam.roamSession[sessionId].connectedProfile.bssid, sizeof(tSirMacAddr) );
p += sizeof(tSirMacAddr);
palCopyMemory( pMac->hHdd, p, pCommand->u.removeKeyCmd.peerMac, sizeof(tSirMacAddr) );
p += sizeof(tSirMacAddr);
*p = (tANI_U8)<API key>( pCommand->u.removeKeyCmd.encType );
p++;
if( ( <API key> == pCommand->u.removeKeyCmd.encType ) ||
( <API key> == pCommand->u.removeKeyCmd.encType ) )
{
*p = (tANI_U8)eSIR_WEP_STATIC;
}
else
{
*p = (tANI_U8)eSIR_WEP_DYNAMIC;
}
p++;
*p = pCommand->u.removeKeyCmd.keyId;
p++;
*p = (pCommand->u.removeKeyCmd.peerMac[0] == 0xFF ) ? 0 : 1;
status = palSendMBMessage(pMac->hHdd, pMsg);
}
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" error status "), status );
#ifdef <API key>
removeKeyEvent.eventId = <API key>;
removeKeyEvent.status = <API key>;
<API key>(&removeKeyEvent, EVENT_WLAN_SECURITY);
#endif
csrRoamCallCallback( pMac, sessionId, NULL, pCommand->u.removeKeyCmd.roamId, <API key>, <API key>);
}
return ( status );
}
eHalStatus csrRoamSetKey( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId )
{
eHalStatus status;
if( !csrIsSetKeyAllowed(pMac, sessionId) )
{
status = <API key>;
}
else
{
status = <API key>( pMac, sessionId, pSetKey, roamId );
}
return ( status );
}
eHalStatus <API key>(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,
<API key> *pScanFilter)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 size = 0;
tANI_U8 index = 0;
do
{
if(pProfile->BSSIDs.numOfBSSIDs)
{
size = sizeof(tCsrBssid) * pProfile->BSSIDs.numOfBSSIDs;
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter->BSSIDs.bssid, size);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
pScanFilter->BSSIDs.numOfBSSIDs = pProfile->BSSIDs.numOfBSSIDs;
palCopyMemory(pMac->hHdd, pScanFilter->BSSIDs.bssid, pProfile->BSSIDs.bssid, size);
}
if(pProfile->SSIDs.numOfSSIDs)
{
if( !CSR_IS_WDS_STA( pProfile ) )
{
pScanFilter->SSIDs.numOfSSIDs = pProfile->SSIDs.numOfSSIDs;
}
else
{
pScanFilter->SSIDs.numOfSSIDs = 1;
}
size = sizeof(tCsrSSIDInfo) * pProfile->SSIDs.numOfSSIDs;
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter->SSIDs.SSIDList, size);
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
palCopyMemory(pMac->hHdd, pScanFilter->SSIDs.SSIDList, pProfile->SSIDs.SSIDList, size);
}
if(!pProfile->ChannelInfo.ChannelList || (pProfile->ChannelInfo.ChannelList[0] == 0) )
{
pScanFilter->ChannelInfo.numOfChannels = 0;
pScanFilter->ChannelInfo.ChannelList = NULL;
}
else if(pProfile->ChannelInfo.numOfChannels)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter->ChannelInfo.ChannelList, sizeof(*pScanFilter->ChannelInfo.ChannelList) * pProfile->ChannelInfo.numOfChannels);
pScanFilter->ChannelInfo.numOfChannels = 0;
if(HAL_STATUS_SUCCESS(status))
{
for(index = 0; index < pProfile->ChannelInfo.numOfChannels; index++)
{
if(<API key>(pMac, pProfile->ChannelInfo.ChannelList[index]))
{
pScanFilter->ChannelInfo.ChannelList[pScanFilter->ChannelInfo.numOfChannels]
= pProfile->ChannelInfo.ChannelList[index];
pScanFilter->ChannelInfo.numOfChannels++;
}
else
{
smsLog(pMac, LOG1, FL("process a channel (%d) that is invalid"), pProfile->ChannelInfo.ChannelList[index]);
}
}
}
else
{
break;
}
}
else
{
smsLog(pMac, LOGW, FL("Channel list empty"));
status = eHAL_STATUS_FAILURE;
break;
}
pScanFilter->uapsd_mask = pProfile->uapsd_mask;
pScanFilter->authType = pProfile->AuthType;
pScanFilter->EncryptionType = pProfile->EncryptionType;
pScanFilter->mcEncryptionType = pProfile->mcEncryptionType;
pScanFilter->BSSType = pProfile->BSSType;
pScanFilter->phyMode = pProfile->phyMode;
#ifdef FEATURE_WLAN_WAPI
if(csrIsProfileWapi(pProfile))
{
if(pScanFilter->phyMode & eCSR_DOT11_MODE_11n)
{
pScanFilter->phyMode &= ~eCSR_DOT11_MODE_11n;
}
if(pScanFilter->phyMode & <API key>)
{
pScanFilter->phyMode &= ~<API key>;
}
if(!pScanFilter->phyMode)
{
pScanFilter->phyMode = eCSR_DOT11_MODE_11g;
}
}
#endif
pScanFilter->bWPSAssociation = pProfile->bWPSAssociation;
if( pProfile->countryCode[0] )
{
palCopyMemory( pMac->hHdd, pScanFilter->countryCode, pProfile->countryCode,
<API key> );
}
#ifdef <API key>
if (pProfile->MDID.mdiePresent)
{
pScanFilter->MDID.mdiePresent = 1;
pScanFilter->MDID.mobilityDomain = pProfile->MDID.mobilityDomain;
}
#endif
}while(0);
if(!HAL_STATUS_SUCCESS(status))
{
csrFreeScanFilter(pMac, pScanFilter);
}
return(status);
}
tANI_BOOLEAN <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
<API key> Type, tSirSmeRsp *pSmeRsp )
{
tANI_BOOLEAN fCommandQueued = eANI_BOOLEAN_FALSE;
tSmeCmd *pCommand;
do
{
if ( ( eCsrDisassociated != Type ) && ( eCsrDeauthenticated != Type ) ) break;
pCommand = csrGetCommandBuffer( pMac );
if ( !pCommand )
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
break;
}
if( CSR_IS_WAIT_FOR_KEY( pMac, sessionId ) )
{
<API key>( pMac );
<API key>( pMac, <API key>, sessionId);
}
pCommand->command = <API key>;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.wmStatusChangeCmd.Type = Type;
if ( eCsrDisassociated == Type )
{
palCopyMemory( pMac->hHdd, &pCommand->u.wmStatusChangeCmd.u.DisassocIndMsg, pSmeRsp,
sizeof( pCommand->u.wmStatusChangeCmd.u.DisassocIndMsg ) );
}
else
{
palCopyMemory( pMac->hHdd, &pCommand->u.wmStatusChangeCmd.u.DeauthIndMsg, pSmeRsp,
sizeof( pCommand->u.wmStatusChangeCmd.u.DeauthIndMsg ) );
}
if( HAL_STATUS_SUCCESS( csrQueueSmeCommand(pMac, pCommand, eANI_BOOLEAN_TRUE) ) )
{
fCommandQueued = eANI_BOOLEAN_TRUE;
}
else
{
smsLog( pMac, LOGE, FL(" fail to send message ") );
<API key>( pMac, pCommand );
}
<API key>( pMac );
} while( 0 );
return( fCommandQueued );
}
static void csrUpdateRssi(tpAniSirGlobal pMac, void* pMsg)
{
v_S7_t rssi = 0;
tAniGetRssiReq *pGetRssiReq = (tAniGetRssiReq*)pMsg;
if(pGetRssiReq)
{
if(NULL != pGetRssiReq->pVosContext)
{
WLANTL_GetRssi(pGetRssiReq->pVosContext, pGetRssiReq->staId, &rssi);
}
else
{
smsLog( pMac, LOGE, FL("pGetRssiReq->pVosContext is NULL"));
return;
}
if(NULL != pGetRssiReq->rssiCallback)
{
((tCsrRssiCallback)(pGetRssiReq->rssiCallback))(rssi, pGetRssiReq->staId, pGetRssiReq->pDevContext);
}
else
{
smsLog( pMac, LOGE, FL("pGetRssiReq->rssiCallback is NULL"));
return;
}
}
else
{
smsLog( pMac, LOGE, FL("pGetRssiReq is NULL"));
}
return;
}
static void csrUpdateSnr(tpAniSirGlobal pMac, void* pMsg)
{
tANI_S8 snr = 0;
tAniGetSnrReq *pGetSnrReq = (tAniGetSnrReq*)pMsg;
if (pGetSnrReq)
{
if (VOS_STATUS_SUCCESS !=
WDA_GetSnr(pGetSnrReq->staId, &snr))
{
smsLog(pMac, LOGE, FL("Error in WLANTL_GetSnr"));
return;
}
if (pGetSnrReq->snrCallback)
{
((tCsrSnrCallback)(pGetSnrReq->snrCallback))(snr, pGetSnrReq->staId,
pGetSnrReq->pDevContext);
}
else
{
smsLog(pMac, LOGE, FL("pGetSnrReq->snrCallback is NULL"));
return;
}
}
else
{
smsLog(pMac, LOGE, FL("pGetSnrReq is NULL"));
}
return;
}
#if defined <API key> || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
void <API key>(tpAniSirGlobal pMac, void* pMsg)
{
tAniGetRoamRssiRsp* pRoamRssiRsp = (tAniGetRoamRssiRsp*)pMsg;
if (NULL != pRoamRssiRsp)
{
tpAniGetRssiReq reqBkp = (tAniGetRssiReq*)pRoamRssiRsp->rssiReq;
v_S7_t rssi = pRoamRssiRsp->rssi;
if ((NULL != reqBkp) && (NULL != reqBkp->rssiCallback))
{
((tCsrRssiCallback)(reqBkp->rssiCallback))(rssi, pRoamRssiRsp->staId, reqBkp->pDevContext);
reqBkp->rssiCallback = NULL;
vos_mem_free(reqBkp);
}
else
{
smsLog( pMac, LOGE, FL("reqBkp->rssiCallback is NULL"));
if (NULL != reqBkp)
{
vos_mem_free(reqBkp);
}
}
}
else
{
smsLog( pMac, LOGE, FL("pRoamRssiRsp is NULL"));
}
return;
}
#endif
#if defined(FEATURE_WLAN_CCX) && defined(<API key>)
void <API key>(tpAniSirGlobal pMac, void* pMsg)
{
tAniGetTsmStatsRsp* pTsmStatsRsp = (tAniGetTsmStatsRsp*)pMsg;
if (NULL != pTsmStatsRsp)
{
tpAniGetTsmStatsReq reqBkp = (tAniGetTsmStatsReq*)pTsmStatsRsp->tsmStatsReq;
if (NULL != reqBkp)
{
if (NULL != reqBkp->tsmStatsCallback)
{
((<API key>)(reqBkp->tsmStatsCallback))(pTsmStatsRsp->tsmMetrics,
pTsmStatsRsp->staId, reqBkp->pDevContext);
reqBkp->tsmStatsCallback = NULL;
}
vos_mem_free(reqBkp);
}
else
{
smsLog( pMac, LOGE, FL("reqBkp is NULL"));
if (NULL != reqBkp)
{
vos_mem_free(reqBkp);
}
}
}
else
{
smsLog( pMac, LOGE, FL("pTsmStatsRsp is NULL"));
}
return;
}
void <API key>(tpAniSirGlobal pMac, tCsrRoamSession *pSession)
{
tANI_U32 roamTS2 = 0;
tCsrRoamInfo roamInfo;
tpPESession pSessionEntry = NULL;
tANI_U8 sessionId = <API key>;
if (NULL == pSession)
{
smsLog(pMac, LOGE, FL("pSession is NULL"));
return;
}
roamTS2 = <API key>();
roamInfo.tsmRoamDelay = roamTS2 - pSession->roamTS1;
smsLog(pMac, LOG1, "Bssid(%02X:%02X:%02X:%02X:%02X:%02X) Roaming Delay(%u ms)",
pSession->connectedProfile.bssid[0], pSession->connectedProfile.bssid[1],
pSession->connectedProfile.bssid[2], pSession->connectedProfile.bssid[3],
pSession->connectedProfile.bssid[4], pSession->connectedProfile.bssid[5],
roamInfo.tsmRoamDelay);
pSessionEntry = <API key>(pMac, pSession->connectedProfile.bssid, &sessionId);
if (NULL == pSessionEntry)
{
smsLog(pMac, LOGE, FL("session %d not found"), sessionId);
return;
}
pSessionEntry->ccxContext.tsm.tsmMetrics.RoamingDly = roamInfo.tsmRoamDelay;
csrRoamCallCallback(pMac, pSession->sessionId, &roamInfo,
0, <API key>, 0);
}
#endif
static void csrRoamRssiIndHdlr(tpAniSirGlobal pMac, void* pMsg)
{
<API key> *pTlRssiInd = (<API key>*)pMsg;
if(pTlRssiInd)
{
if(NULL != pTlRssiInd->tlCallback)
{
((<API key>)(pTlRssiInd->tlCallback))
(pTlRssiInd->pAdapter, pTlRssiInd->rssiNotification, pTlRssiInd->pUserCtxt, pTlRssiInd->avgRssi);
}
else
{
smsLog( pMac, LOGE, FL("pTlRssiInd->tlCallback is NULL"));
}
}
else
{
smsLog( pMac, LOGE, FL("pTlRssiInd is NULL"));
}
return;
}
eHalStatus <API key>(tpAniSirGlobal pMac, tSirMacAddr *bssId)
{
<API key> pMsg;
tANI_U16 len;
eHalStatus status = eHAL_STATUS_SUCCESS;
len = sizeof(<API key>);
status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, len );
if (HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, pMsg, sizeof(<API key>) );
pMsg->messageType = <API key>;
pMsg->length = len;
palCopyMemory( pMac->hHdd, pMsg->bssId, bssId, sizeof(tSirMacAddr) );
smsLog( pMac, LOG1, FL("CSR reset caps change for Bssid= %02x-%02x-%02x-%02x-%02x-%02x"),
pMsg->bssId[ 0 ], pMsg->bssId[ 1 ], pMsg->bssId[ 2 ],
pMsg->bssId[ 3 ], pMsg->bssId[ 4 ], pMsg->bssId[ 5 ]);
status = palSendMBMessage(pMac->hHdd, pMsg);
}
else
{
smsLog( pMac, LOGE, FL("Memory allocation failed\n"));
}
return status;
}
void <API key>( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg )
{
tSirSmeAssocInd *pAssocInd;
tSirSmeDisassocInd *pDisassocInd;
tSirSmeDeauthInd *pDeauthInd;
<API key> *pStatusChangeMsg;
tSirSmeNewBssInfo *pNewBss;
tSmeIbssPeerInd *pIbssPeerInd;
tSirMacAddr Broadcastaddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
tSirSmeApNewCaps *pApNewCaps;
eCsrRoamResult result = <API key>;
eRoamCmdStatus roamStatus = eCSR_ROAM_FAILED;
tCsrRoamInfo *pRoamInfo = NULL;
tCsrRoamInfo roamInfo;
eHalStatus status;
tANI_U32 sessionId = <API key>;
tCsrRoamSession *pSession = NULL;
<API key> pSwitchChnInd;
tSmeMaxAssocInd *pSmeMaxAssocInd;
pSirMsg->messageType = (pSirMsg->messageType);
pSirMsg->length = (pSirMsg->length);
pSirMsg->statusCode = (pSirMsg->statusCode);
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(roamInfo));
switch( pSirMsg->messageType )
{
case eWNI_SME_ASSOC_IND:
{
tCsrRoamSession *pSession;
smsLog( pMac, LOG1, FL("ASSOCIATION Indication from SME"));
pAssocInd = (tSirSmeAssocInd *)pSirMsg;
status = <API key>( pMac, (tCsrBssid *)pAssocInd->bssId, &sessionId );
if( HAL_STATUS_SUCCESS( status ) )
{
pSession = CSR_GET_SESSION(pMac, sessionId);
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pRoamInfo = &roamInfo;
pRoamInfo->assocReqLength = pAssocInd->assocReqLength;
pRoamInfo->assocReqPtr = pAssocInd->assocReqPtr;
pRoamInfo->beaconPtr = pAssocInd->beaconPtr;
pRoamInfo->beaconLength = pAssocInd->beaconLength;
pRoamInfo->statusCode = eSIR_SME_SUCCESS;
pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
pRoamInfo->staId = (tANI_U8)pAssocInd->staId;
pRoamInfo->rsnIELen = (tANI_U8)pAssocInd->rsnIE.length;
pRoamInfo->prsnIE = pAssocInd->rsnIE.rsnIEdata;
pRoamInfo->addIELen = (tANI_U8)pAssocInd->addIE.length;
pRoamInfo->paddIE = pAssocInd->addIE.addIEdata;
palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pAssocInd->peerMacAddr, sizeof(tSirMacAddr));
palCopyMemory(pMac->hHdd, &pRoamInfo->bssid, pAssocInd->bssId, sizeof(tCsrBssid));
pRoamInfo->wmmEnabledSta = pAssocInd->wmmEnabledSta;
if(CSR_IS_WDS_AP( pRoamInfo->u.pConnectedProfile))
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_WDS_IND, <API key>);
if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile))
{
if( <API key>( pSession->pCurRoamProfile-><API key> ))
{
<API key>( pMac, sessionId, pSession->pCurRoamProfile-><API key>,
pSession->pConnectBssDesc,
&(pRoamInfo->peerMac),
FALSE, TRUE, eSIR_TX_RX, 0, 0, NULL, 0 );
pRoamInfo->fAuthRequired = FALSE;
}
else
{
pRoamInfo->fAuthRequired = TRUE;
}
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_INFRA_IND, <API key>);
if (!HAL_STATUS_SUCCESS(status))
pRoamInfo->statusCode = <API key>;
}
status = csrSendAssocCnfMsg( pMac, pAssocInd, status );
if(CSR_IS_WDS_AP( pRoamInfo->u.pConnectedProfile))
{
status = <API key>(pMac, pAssocInd, status, sessionId);
}
else if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile) && (pRoamInfo->statusCode != <API key>))
{
pRoamInfo->fReassocReq = pAssocInd->reassocReq;
status = <API key>(pMac, pAssocInd, status, sessionId);
}
}
}
break;
case <API key>:
{
tSmeCmd *pCommand;
pDisassocInd = (tSirSmeDisassocInd *)pSirMsg;
status = <API key>( pMac,
(tCsrBssid *)pDisassocInd->bssId, &sessionId );
if( HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL("DISASSOCIATION Indication from MAC"
" for session %d "), sessionId);
smsLog( pMac, LOGE, FL("DISASSOCIATION from peer ="
MAC_ADDRESS_STR " "
" reason = %d status = %d "),
MAC_ADDR_ARRAY(pDisassocInd->peerMacAddr),
pDisassocInd->reasonCode,
pDisassocInd->statusCode);
#ifdef <API key>
if (csrRoamIs11rAssoc(pMac) && (<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
#ifdef FEATURE_WLAN_CCX
if (csrRoamIsCCXAssoc(pMac) && (<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac, sessionId) && (<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
pSession = CSR_GET_SESSION( pMac, sessionId );
if (!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if ( csrIsConnStateInfra( pMac, sessionId ) )
{
pSession->connectState = <API key>;
}
#ifndef <API key>
sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, <API key>, NULL);
#endif
csrRoamLinkDown(pMac, sessionId);
<API key>( pMac, sessionId, eCsrDisassociated, pSirMsg );
if (CSR_IS_INFRA_AP(&pSession->connectedProfile))
{
pCommand = csrGetCommandBuffer(pMac);
if (NULL == pCommand)
{
smsLog( pMac, LOGE, FL(" fail to get command buffer") );
status = <API key>;
}
pRoamInfo = &roamInfo;
pRoamInfo->statusCode = pDisassocInd->statusCode;
pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
pRoamInfo->staId = (tANI_U8)pDisassocInd->staId;
vos_mem_copy(pRoamInfo->peerMac, pDisassocInd->peerMacAddr,
sizeof(tSirMacAddr));
vos_mem_copy(&pRoamInfo->bssid, pDisassocInd->bssId,
sizeof(tCsrBssid));
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0,
eCSR_ROAM_INFRA_IND, <API key>);
pCommand->command = eSmeCommandRoam;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.roamCmd.roamReason = eCsrForcedDeauthSta;
vos_mem_copy(pCommand->u.roamCmd.peerMac,
pDisassocInd->peerMacAddr,
sizeof(tSirMacAddr));
<API key>(pMac, sessionId, pCommand, eCsrForcedDeauthSta);
csrReleaseCommand( pMac, pCommand );
}
}
else
{
smsLog(pMac, LOGE, FL(" Session Id not found for BSSID " MAC_ADDRESS_STR),
MAC_ADDR_ARRAY(pDisassocInd->bssId));
}
}
break;
case eWNI_SME_DEAUTH_IND:
pDeauthInd = (tpSirSmeDeauthInd)pSirMsg;
smsLog( pMac, LOGE, FL("DEAUTHENTICATION Indication from MAC: *:%02x:%02x:%02x"),pDeauthInd->bssId[3],pDeauthInd->bssId[4],pDeauthInd->bssId[5]);
status = <API key>( pMac, (tCsrBssid *)pDeauthInd->bssId, &sessionId );
if( HAL_STATUS_SUCCESS( status ) )
{
#ifdef <API key>
if (csrRoamIs11rAssoc(pMac) && (<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
#ifdef FEATURE_WLAN_CCX
if (csrRoamIsCCXAssoc(pMac) && (<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac, sessionId) && (<API key>(pMac)))
{
<API key><API key>(pMac);
}
#endif
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if ( csrIsConnStateInfra( pMac, sessionId ) )
{
pSession->connectState = <API key>;
}
#ifndef <API key>
sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, <API key>, NULL);
#endif
csrRoamLinkDown(pMac, sessionId);
<API key>( pMac, sessionId, eCsrDeauthenticated, pSirMsg );
if(CSR_IS_INFRA_AP(&pSession->connectedProfile))
{
pRoamInfo = &roamInfo;
pRoamInfo->statusCode = pDeauthInd->statusCode;
pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
pRoamInfo->staId = (tANI_U8)pDeauthInd->staId;
palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pDeauthInd->peerMacAddr, sizeof(tSirMacAddr));
palCopyMemory(pMac->hHdd, &pRoamInfo->bssid, pDeauthInd->bssId, sizeof(tCsrBssid));
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_INFRA_IND, <API key>);
}
}
break;
case <API key>:
smsLog( pMac, LOGW, FL("<API key> from SME"));
pSwitchChnInd = (<API key>)pSirMsg;
status = <API key>( pMac, (tCsrBssid *)pSwitchChnInd->bssId, &sessionId );
if( HAL_STATUS_SUCCESS( status ) )
{
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pSession->connectedProfile.operationChannel = (tANI_U8)pSwitchChnInd->newChannelId;
if(pSession->pConnectBssDesc)
{
pSession->pConnectBssDesc->channelId = (tANI_U8)pSwitchChnInd->newChannelId;
}
}
break;
case eWNI_SME_DEAUTH_RSP:
smsLog( pMac, LOGW, FL("eWNI_SME_DEAUTH_RSP from SME"));
{
tSirSmeDeauthRsp* pDeauthRsp = (tSirSmeDeauthRsp *)pSirMsg;
sessionId = pDeauthRsp->sessionId;
if( <API key>(pMac, sessionId) )
{
pSession = CSR_GET_SESSION(pMac, sessionId);
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if ( CSR_IS_INFRA_AP(&pSession->connectedProfile) )
{
pRoamInfo = &roamInfo;
pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pDeauthRsp->peerMacAddr, sizeof(tSirMacAddr));
pRoamInfo->reasonCode = <API key>;
pRoamInfo->statusCode = pDeauthRsp->statusCode;
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_LOSTLINK, <API key>);
}
}
}
break;
case <API key>:
smsLog( pMac, LOGW, FL("<API key> from SME "));
{
tSirSmeDisassocRsp *pDisassocRsp = (tSirSmeDisassocRsp *)pSirMsg;
sessionId = pDisassocRsp->sessionId;
if( <API key>(pMac, sessionId) )
{
pSession = CSR_GET_SESSION(pMac, sessionId);
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if ( CSR_IS_INFRA_AP(&pSession->connectedProfile) )
{
pRoamInfo = &roamInfo;
pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pDisassocRsp->peerMacAddr, sizeof(tSirMacAddr));
pRoamInfo->reasonCode = <API key>;
pRoamInfo->statusCode = pDisassocRsp->statusCode;
status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_LOSTLINK, <API key>);
}
}
}
break;
case <API key>:
{
<API key> pMicInd = (<API key>)pSirMsg;
tCsrRoamInfo roamInfo, *pRoamInfo = NULL;
eCsrRoamResult result = <API key>;
status = <API key>( pMac, (tCsrBssid *)pMicInd->bssId, &sessionId );
if( HAL_STATUS_SUCCESS( status ) )
{
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.u.pMICFailureInfo = &pMicInd->info;
pRoamInfo = &roamInfo;
if(pMicInd->info.multicast)
{
result = <API key>;
}
else
{
result = <API key>;
}
csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, <API key>, result);
}
#ifdef <API key>
{
<API key>(secEvent, <API key>);
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
palZeroMemory(pMac->hHdd, &secEvent, sizeof(<API key>));
secEvent.eventId = <API key>;
secEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.mcEncryptionType);
secEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.EncryptionType);
secEvent.authMode =
(v_U8_t)<API key>(pSession->connectedProfile.AuthType);
palCopyMemory( pMac->hHdd, secEvent.bssid, pSession->connectedProfile.bssid, 6 );
<API key>(&secEvent, EVENT_WLAN_SECURITY);
}
#endif
}
break;
case <API key>:
{
tpSirSmeProbeReqInd pProbeReqInd = (tpSirSmeProbeReqInd)pSirMsg;
tCsrRoamInfo roamInfo;
smsLog( pMac, LOG1, FL("WPS PBC Probe request Indication from SME"));
status = <API key>( pMac, (tCsrBssid *)pProbeReqInd->bssId, &sessionId );
if( HAL_STATUS_SUCCESS( status ) )
{
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.u.pWPSPBCProbeReq = &pProbeReqInd->WPSPBCProbeReq;
csrRoamCallCallback(pMac, sessionId, &roamInfo, 0, <API key>,
<API key>);
}
}
break;
case <API key>:
pStatusChangeMsg = (<API key> *)pSirMsg;
switch( pStatusChangeMsg->statusChangeCode )
{
case <API key>:
sessionId = csrFindIbssSession( pMac );
if( <API key> != sessionId )
{
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pSession->connectState = <API key>;
if(pSession->pConnectBssDesc)
{
palCopyMemory(pMac->hHdd, &roamInfo.bssid, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
roamInfo.u.pConnectedProfile = &pSession->connectedProfile;
pRoamInfo = &roamInfo;
}
else
{
smsLog(pMac, LOGE, " CSR <API key> connected BSS is empty");
}
result = <API key>;
roamStatus = <API key>;
}
break;
case <API key>:
sessionId = csrFindIbssSession( pMac );
if( <API key> != sessionId )
{
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pSession->connectState = <API key>;
result = <API key>;
roamStatus = <API key>;
}
break;
case <API key>:
sessionId = csrFindIbssSession( pMac );
if( <API key> != sessionId )
{
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pNewBss = &pStatusChangeMsg->statusChangeInfo.newBssInfo;
#ifdef <API key>
{
<API key> *pIbssLog;
tANI_U32 bi;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
pIbssLog->eventId = <API key>;
if(pNewBss)
{
palCopyMemory(pMac->hHdd, pIbssLog->bssid, pNewBss->bssId, 6);
if(pNewBss->ssId.length)
{
palCopyMemory(pMac->hHdd, pIbssLog->ssid, pNewBss->ssId.ssId, pNewBss->ssId.length);
}
pIbssLog->operatingChannel = pNewBss->channelNumber;
}
if(HAL_STATUS_SUCCESS(ccmCfgGetInt(pMac, <API key>, &bi)))
{
pIbssLog->beaconInterval = (v_U8_t)bi;
}
<API key>(pIbssLog);
}
}
#endif
<API key>( pMac, sessionId, pNewBss );
if ((<API key> ==
pSession->connectedProfile.EncryptionType ))
{
<API key>( pMac, sessionId,
pSession->connectedProfile.EncryptionType,
pSession->pConnectBssDesc,
&Broadcastaddr,
FALSE, FALSE, eSIR_TX_RX, 0, 0, NULL, 0 );
}
result = <API key>;
roamStatus = eCSR_ROAM_IBSS_IND;
palCopyMemory(pMac->hHdd, &roamInfo.bssid, &pNewBss->bssId, sizeof(tCsrBssid));
pRoamInfo = &roamInfo;
if(pSession->pConnectBssDesc)
{
palCopyMemory(pMac->hHdd, pSession->pConnectBssDesc->bssId, &pNewBss->bssId, sizeof(tCsrBssid));
}
if(pSession->ibss_join_pending)
{
pSession->ibss_join_pending = FALSE;
<API key>(pMac, sessionId);
result = <API key>;
}
}
smsLog(pMac, LOGW, "CSR: <API key> received from PE");
break;
case <API key>:
pApNewCaps = &pStatusChangeMsg->statusChangeInfo.apNewCaps;
smsLog(pMac, LOGW, "CSR handling <API key>");
status = <API key>( pMac, (tCsrBssid *)pApNewCaps->bssId, &sessionId );
if( HAL_STATUS_SUCCESS( status ) )
{
if ((<API key> == pMac->roam.curState[sessionId]) &&
((<API key> == pMac->roam.curSubState[sessionId]) ||
(<API key> == pMac->roam.curSubState[sessionId]) ||
(<API key> == pMac->roam.curSubState[sessionId]) ||
(<API key> == pMac->roam.curSubState[sessionId]))
)
{
smsLog(pMac, LOGW, "Calling <API key>");
<API key>(pMac, sessionId, <API key>);
}
else
{
smsLog(pMac, LOGW,
"Skipping <API key> as "
"CSR is in state %d and sub-state %d",
pMac->roam.curState[sessionId],
pMac->roam.curSubState[sessionId]);
<API key>(pMac, &pApNewCaps->bssId);
}
}
break;
default:
roamStatus = eCSR_ROAM_FAILED;
result = <API key>;
break;
}
if(<API key> != result)
{
csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, roamStatus, result);
}
break;
case <API key>:
pIbssPeerInd = (tSmeIbssPeerInd *)pSirMsg;
#ifdef <API key>
{
<API key> *pIbssLog;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
pIbssLog->eventId = <API key>;
palCopyMemory(pMac->hHdd, pIbssLog->peerMacAddr, &pIbssPeerInd->peerAddr, 6);
<API key>(pIbssLog);
}
}
#endif
sessionId = csrFindIbssSession( pMac );
if( <API key> != sessionId )
{
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if(pSession->pConnectBssDesc)
{
palCopyMemory(pMac->hHdd, &roamInfo.peerMac, pIbssPeerInd->peerAddr, sizeof(tCsrBssid));
palCopyMemory(pMac->hHdd, &roamInfo.bssid, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
if(pIbssPeerInd->mesgLen > sizeof(tSmeIbssPeerInd))
{
status = palAllocateMemory(pMac->hHdd, (void **)&roamInfo.pbFrames,
(pIbssPeerInd->mesgLen - sizeof(tSmeIbssPeerInd)));
if(HAL_STATUS_SUCCESS(status))
{
roamInfo.nBeaconLength = (pIbssPeerInd->mesgLen - sizeof(tSmeIbssPeerInd));
palCopyMemory(pMac->hHdd, roamInfo.pbFrames, ((tANI_U8 *)pIbssPeerInd) + sizeof(tSmeIbssPeerInd),
roamInfo.nBeaconLength);
}
roamInfo.staId = (tANI_U8)pIbssPeerInd->staId;
roamInfo.ucastSig = (tANI_U8)pIbssPeerInd->ucastSig;
roamInfo.bcastSig = (tANI_U8)pIbssPeerInd->bcastSig;
status = palAllocateMemory(pMac->hHdd, (void **)&roamInfo.pBssDesc,
pSession->pConnectBssDesc->length);
if(HAL_STATUS_SUCCESS(status))
{
palCopyMemory(pMac->hHdd, roamInfo.pBssDesc, pSession->pConnectBssDesc,
pSession->pConnectBssDesc->length);
}
if(HAL_STATUS_SUCCESS(status))
{
pRoamInfo = &roamInfo;
}
else
{
if(roamInfo.pbFrames)
{
palFreeMemory(pMac->hHdd, roamInfo.pbFrames);
}
if(roamInfo.pBssDesc)
{
palFreeMemory(pMac->hHdd, roamInfo.pBssDesc);
}
}
}
else
{
pRoamInfo = &roamInfo;
}
if ((<API key> ==
pSession->connectedProfile.EncryptionType ))
{
<API key>( pMac, sessionId,
pSession->connectedProfile.EncryptionType,
pSession->pConnectBssDesc,
&(pIbssPeerInd->peerAddr),
FALSE, TRUE, eSIR_TX_RX, 0, 0, NULL, 0 );
}
}
else
{
smsLog(pMac, LOGW, " CSR <API key> connected BSS is empty");
}
if (pRoamInfo)
{
pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
}
csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0,
<API key>, <API key>);
if(pRoamInfo)
{
if(roamInfo.pbFrames)
{
palFreeMemory(pMac->hHdd, roamInfo.pbFrames);
}
if(roamInfo.pBssDesc)
{
palFreeMemory(pMac->hHdd, roamInfo.pBssDesc);
}
}
}
break;
case <API key>:
pIbssPeerInd = (tSmeIbssPeerInd*)pSirMsg;
sessionId = csrFindIbssSession( pMac );
if( <API key> != sessionId )
{
#ifdef <API key>
{
<API key> *pIbssLog;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
pIbssLog->eventId = <API key>;
if(pIbssPeerInd)
{
palCopyMemory(pMac->hHdd, pIbssLog->peerMacAddr, &pIbssPeerInd->peerAddr, 6);
}
<API key>(pIbssLog);
}
}
#endif
smsLog(pMac, LOGW, "CSR: Peer departed notification from LIM");
roamInfo.staId = (tANI_U8)pIbssPeerInd->staId;
roamInfo.ucastSig = (tANI_U8)pIbssPeerInd->ucastSig;
roamInfo.bcastSig = (tANI_U8)pIbssPeerInd->bcastSig;
palCopyMemory(pMac->hHdd, &roamInfo.peerMac, pIbssPeerInd->peerAddr, sizeof(tCsrBssid));
csrRoamCallCallback(pMac, sessionId, &roamInfo, 0,
<API key>, <API key>);
}
break;
case <API key>:
{
<API key> *pRsp = (<API key> *)pSirMsg;
tListElem *pEntry;
tSmeCmd *pCommand;
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if ( pEntry )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if ( eSmeCommandSetKey == pCommand->command )
{
sessionId = pCommand->sessionId;
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
#ifdef <API key>
if(<API key> != pSession->connectedProfile.EncryptionType)
{
<API key>(setKeyEvent, <API key>);
palZeroMemory(pMac->hHdd, &setKeyEvent, sizeof(<API key>));
if( pRsp->peerMacAddr[0] & 0x01 )
{
setKeyEvent.eventId = <API key>;
}
else
{
setKeyEvent.eventId = <API key>;
}
setKeyEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.mcEncryptionType);
setKeyEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.EncryptionType);
palCopyMemory( pMac->hHdd, setKeyEvent.bssid, pSession->connectedProfile.bssid, 6 );
setKeyEvent.authMode =
(v_U8_t)<API key>(pSession->connectedProfile.AuthType);
if( eSIR_SME_SUCCESS != pRsp->statusCode )
{
setKeyEvent.status = <API key>;
}
<API key>(&setKeyEvent, EVENT_WLAN_SECURITY);
}
#endif
if( CSR_IS_WAIT_FOR_KEY( pMac, sessionId) )
{
<API key>( pMac );
<API key>( pMac, <API key>, sessionId);
if( <API key>(pMac, sessionId) )
{
csrRoamLinkUp(pMac, pSession->connectedProfile.bssid);
}
}
if( eSIR_SME_SUCCESS == pRsp->statusCode )
{
palCopyMemory( pMac, &roamInfo.peerMac, &pRsp->peerMacAddr, sizeof(tCsrBssid) );
if( palEqualMemory( pMac->hHdd, &Broadcastaddr, pRsp->peerMacAddr,
sizeof(tSirMacAddr) ) )
{
#ifdef <API key>
if(<API key>)
{
<API key> pMsg;
palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof(<API key>));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->length = pal_cpu_to_be16(sizeof( tANI_U8));
pMsg->seesionId = sessionId;
status = palSendMBMessage(pMac->hHdd, pMsg );
}
#endif
result = <API key>;
}
else
{
result = <API key>;
}
pRoamInfo = &roamInfo;
}
else
{
result = <API key>;
smsLog( pMac, LOGE, "CSR: Roam Completion setkey command failed(%d) PeerMac %02X-%02X-%02X-%02X-%02X-%02X...",
pRsp->statusCode, pRsp->peerMacAddr[0], pRsp->peerMacAddr[1], pRsp->peerMacAddr[2],
pRsp->peerMacAddr[3], pRsp->peerMacAddr[4], pRsp->peerMacAddr[5] );
}
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.setKeyCmd.roamId,
<API key>, result);
sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, <API key>, NULL);
#ifdef FEATURE_WLAN_CCX
if (result == <API key> &&
pSession->isPrevApInfoValid &&
pSession->connectedProfile.isCCXAssoc)
{
#ifdef <API key>
<API key>(pMac, pSession);
#else
<API key>(pMac, pSession);
#endif
pSession->isPrevApInfoValid = FALSE;
}
#endif
if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) )
{
<API key>( pMac, pCommand );
}
}
else
{
smsLog( pMac, LOGE, "CSR: Roam Completion called but setkey command is not ACTIVE ..." );
}
}
else
{
smsLog( pMac, LOGE, "CSR: SetKey Completion called but NO commands are ACTIVE ..." );
}
<API key>( pMac );
}
break;
case <API key>:
{
tSirSmeRemoveKeyRsp *pRsp = (tSirSmeRemoveKeyRsp *)pSirMsg;
tListElem *pEntry;
tSmeCmd *pCommand;
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if ( pEntry )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if ( <API key> == pCommand->command )
{
sessionId = pCommand->sessionId;
pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
#ifdef <API key>
{
<API key>(removeKeyEvent, <API key>);
palZeroMemory(pMac->hHdd, &removeKeyEvent, sizeof(<API key>));
removeKeyEvent.eventId = <API key>;
removeKeyEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.mcEncryptionType);
removeKeyEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.EncryptionType);
palCopyMemory( pMac->hHdd, removeKeyEvent.bssid, pSession->connectedProfile.bssid, 6 );
removeKeyEvent.authMode =
(v_U8_t)<API key>(pSession->connectedProfile.AuthType);
if( eSIR_SME_SUCCESS != pRsp->statusCode )
{
removeKeyEvent.status = <API key>;
}
<API key>(&removeKeyEvent, EVENT_WLAN_SECURITY);
}
#endif
if( eSIR_SME_SUCCESS == pRsp->statusCode )
{
palCopyMemory( pMac, &roamInfo.peerMac, &pRsp->peerMacAddr, sizeof(tCsrBssid) );
result = <API key>;
pRoamInfo = &roamInfo;
}
else
{
result = <API key>;
}
csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.setKeyCmd.roamId,
<API key>, result);
if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) )
{
<API key>( pMac, pCommand );
}
}
else
{
smsLog( pMac, LOGW, "CSR: Roam Completion called but setkey command is not ACTIVE ..." );
}
}
else
{
smsLog( pMac, LOGW, "CSR: SetKey Completion called but NO commands are ACTIVE ..." );
}
<API key>( pMac );
}
break;
case <API key>:
smsLog( pMac, LOG2, FL("Stats rsp from PE"));
<API key>( pMac, pSirMsg );
break;
#if defined <API key> || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
case <API key>:
smsLog( pMac, LOG2, FL("Stats rsp from PE"));
<API key>( pMac, pSirMsg );
break;
#endif
#if defined(FEATURE_WLAN_CCX) && defined(<API key>)
case <API key>:
smsLog( pMac, LOG2, FL("TSM Stats rsp from PE"));
<API key>( pMac, pSirMsg );
break;
#endif
case <API key>:
smsLog( pMac, LOG2, FL("GetRssiReq from self"));
csrUpdateRssi( pMac, pSirMsg );
break;
case <API key>:
smsLog( pMac, LOG2, FL("GetSnrReq from self"));
csrUpdateSnr(pMac, pSirMsg);
break;
#ifdef <API key>
case <API key>:
<API key>( pMac, (tpSirFTPreAuthRsp)pSirMsg );
break;
#endif
case <API key>:
pSmeMaxAssocInd = (tSmeMaxAssocInd*)pSirMsg;
smsLog( pMac, LOG1, FL("send indication that max assoc have been reached and the new peer cannot be accepted"));
sessionId = pSmeMaxAssocInd->sessionId;
roamInfo.sessionId = sessionId;
palCopyMemory(pMac->hHdd, &roamInfo.peerMac, pSmeMaxAssocInd->peerMac, sizeof(tCsrBssid));
csrRoamCallCallback(pMac, sessionId, &roamInfo, 0,
eCSR_ROAM_INFRA_IND, <API key>);
break;
case <API key>:
smsLog( pMac, LOG1, FL("Establish logical link req from HCI serialized through MC thread"));
<API key>( pSirMsg );
break;
case eWNI_SME_RSSI_IND:
smsLog( pMac, LOG1, FL("RSSI indication from TL serialized through MC thread"));
csrRoamRssiIndHdlr( pMac, pSirMsg );
break;
#ifdef <API key>
case <API key>:
smsLog( pMac, LOG2, FL("Candidate found indication from PE"));
<API key>( pMac, pSirMsg );
break;
case <API key>:
smsLog( pMac, LOG2, FL("Handoff Req from self"));
<API key>( pMac, pSirMsg );
break;
#endif
default:
break;
}
}
void <API key>(tpAniSirGlobal pMac, tCsrRoamSession *pSession,
tCsrRoamInfo *pRoamInfo, tANI_U32 roamId, eCsrRoamResult roamResult)
{
if(pSession)
{
if(pSession->bRefAssocStartCnt)
{
pSession->bRefAssocStartCnt
VOS_ASSERT( pSession->bRefAssocStartCnt == 0);
csrRoamCallCallback(pMac, pSession->sessionId, NULL, roamId,
<API key>,
<API key>);
}
csrRoamCallCallback(pMac, pSession->sessionId, pRoamInfo, roamId, <API key>, roamResult);
}
else
{
smsLog(pMac, LOGW, FL(" pSession is NULL"));
}
}
eHalStatus csrRoamStartRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamingReason roamingReason)
{
eHalStatus status = eHAL_STATUS_FAILURE;
if(<API key>(roamingReason) &&
(eANI_BOOLEAN_FALSE == pMac->roam.roamSession[sessionId].fCancelRoaming))
{
status = <API key>( pMac, sessionId );
}
return(status);
}
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId,
tANI_BOOLEAN fForce, eCsrRoamResult roamResult)
{
tANI_BOOLEAN fCompleted = eANI_BOOLEAN_TRUE;
tANI_TIMESTAMP roamTime = (tANI_TIMESTAMP)(pMac->roam.configParam.nRoamingTime * <API key>);
tANI_TIMESTAMP curTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd);
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eANI_BOOLEAN_FALSE;
}
if(pSession->fCancelRoaming || fForce ||
((curTime - pSession->roamingStartTime) > roamTime) ||
eCsrReassocRoaming == pSession->roamingReason ||
eCsrDynamicRoaming == pSession->roamingReason)
{
smsLog(pMac, LOGW, FL(" indicates roaming completion"));
if(pSession->fCancelRoaming && <API key>(pSession->roamingReason))
{
if(eSIR_BEACON_MISSED == pSession->roamingStatusCode)
{
roamResult = <API key>;
}
else if(<API key> == pSession->roamingReason)
{
roamResult = <API key>;
}
else if(<API key> == pSession->roamingReason)
{
roamResult = <API key>;
}
else
{
roamResult = <API key>;
}
}
<API key>(pMac, pSession, NULL, 0, roamResult);
pSession->roamingReason = eCsrNotRoaming;
}
else
{
pSession->roamResult = roamResult;
if(!HAL_STATUS_SUCCESS(<API key>(pMac, sessionId, <API key>)))
{
<API key>(pMac, pSession, NULL, 0, roamResult);
pSession->roamingReason = eCsrNotRoaming;
}
else
{
fCompleted = eANI_BOOLEAN_FALSE;
}
}
return(fCompleted);
}
void <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if(CSR_IS_ROAMING(pSession))
{
smsLog(pMac, LOGW, " Cancelling roaming");
pSession->fCancelRoaming = eANI_BOOLEAN_TRUE;
if(CSR_IS_ROAM_JOINING(pMac, sessionId) && <API key>(pMac, sessionId))
{
}
else
{
eCsrRoamResult roamResult = <API key>(pSession->roamingReason) ?
<API key> : <API key>;
<API key>(pMac, sessionId, eANI_BOOLEAN_TRUE, roamResult);
csrScanAbortMacScan(pMac);
<API key>(pMac, sessionId);
}
}
}
void <API key>(void *pv)
{
tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv;
tpAniSirGlobal pMac = pInfo->pMac;
tANI_U32 sessionId = pInfo->sessionId;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if(eANI_BOOLEAN_FALSE == pSession->fCancelRoaming)
{
if(!HAL_STATUS_SUCCESS(csrRoamStartRoaming(pMac, sessionId, pSession->roamingReason)))
{
<API key>(pMac, pSession, NULL, 0, pSession->roamResult);
pSession->roamingReason = eCsrNotRoaming;
}
}
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval)
{
eHalStatus status;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found"), sessionId);
return eHAL_STATUS_FAILURE;
}
smsLog(pMac, LOG1, " <API key>");
pSession->roamingTimerInfo.sessionId = (tANI_U8)sessionId;
status = vos_timer_start(&pSession->hTimerRoaming, interval/<API key>);
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
return (vos_timer_stop(&pMac->roam.roamSession[sessionId].hTimerRoaming));
}
void <API key>(void *pv)
{
tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv;
tpAniSirGlobal pMac = pInfo->pMac;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pInfo->sessionId );
eHalStatus status = eHAL_STATUS_FAILURE;
smsLog(pMac, LOGW, "WaitForKey timer expired in state=%d sub-state=%d",
pMac->roam.neighborRoamInfo.neighborRoamState,
pMac->roam.curSubState[pInfo->sessionId]);
if( CSR_IS_WAIT_FOR_KEY( pMac, pInfo->sessionId ) )
{
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac))
{
smsLog(pMac, LOG2, "Enabling HB timer after WaitKey expiry"
" (nHBCount=%d)",
pMac->roam.configParam.HeartbeatThresh24);
ccmCfgSetInt(pMac, <API key>,
pMac->roam.configParam.HeartbeatThresh24,
NULL, eANI_BOOLEAN_FALSE);
}
#endif
smsLog(pMac, LOGW, " SME pre-auth state timeout. ");
if (<API key> > pInfo->sessionId)
{
<API key>(pMac, <API key>,
pInfo->sessionId);
}
if (pSession)
{
if( <API key>(pMac, pInfo->sessionId) )
{
csrRoamLinkUp(pMac, pSession->connectedProfile.bssid);
<API key>(pMac);
if( (pSession->connectedProfile.AuthType ==
eCSR_<API key>) &&
( (pSession->connectedProfile.EncryptionType ==
<API key>) ||
(pSession->connectedProfile.EncryptionType ==
<API key>) ))
{
status = <API key>( &pMac->sme );
if ( HAL_STATUS_SUCCESS( status ) )
{
csrRoamDisconnect( pMac, pInfo->sessionId,
<API key> );
<API key>( &pMac->sme );
}
}
}
else
{
smsLog(pMac, LOGW, "%s: could not post link up",
__func__);
}
}
else
{
smsLog(pMac, LOGW, "%s: session not found", __func__);
}
}
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 interval)
{
eHalStatus status;
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac))
{
smsLog(pMac, LOG2, "%s: disabling HB timer in state=%d sub-state=%d",
__func__,
pMac->roam.neighborRoamInfo.neighborRoamState,
pMac->roam.curSubState[pMac->roam.WaitForKeyTimerInfo.sessionId]);
ccmCfgSetInt(pMac, <API key>, 0, NULL, eANI_BOOLEAN_FALSE);
}
#endif
smsLog(pMac, LOG1, " <API key>");
status = vos_timer_start(&pMac->roam.hTimerWaitForKey, interval/<API key>);
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac)
{
smsLog(pMac, LOG2, "WaitForKey timer stopped in state=%d sub-state=%d",
pMac->roam.neighborRoamInfo.neighborRoamState,
pMac->roam.curSubState[pMac->roam.WaitForKeyTimerInfo.sessionId]);
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac))
{
smsLog(pMac, LOG2, "Enabling HB timer after WaitKey stop"
" (nHBCount=%d)",
pMac->roam.configParam.HeartbeatThresh24);
ccmCfgSetInt(pMac, <API key>,
pMac->roam.configParam.HeartbeatThresh24,
NULL, eANI_BOOLEAN_FALSE);
}
#endif
return (vos_timer_stop(&pMac->roam.hTimerWaitForKey));
}
void <API key>(void *pv)
{
tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv;
tpAniSirGlobal pMac = pInfo->pMac;
<API key> reason = <API key>;
tANI_U32 sessionId = pInfo->sessionId;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pSession->ibss_join_pending = FALSE;
<API key>(pMac, sessionId, reason);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval)
{
eHalStatus status;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
smsLog(pMac, LOG1, " <API key>");
pSession->ibssJoinTimerInfo.sessionId = (tANI_U8)sessionId;
status = vos_timer_start(&pSession->hTimerIbssJoining, interval/<API key>);
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
return (vos_timer_stop(&pMac->roam.roamSession[sessionId].hTimerIbssJoining));
}
void csrRoamCompletion(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamInfo *pRoamInfo, tSmeCmd *pCommand,
eCsrRoamResult roamResult, tANI_BOOLEAN fSuccess)
{
eRoamCmdStatus roamStatus = <API key>(pMac, sessionId);
tANI_U32 roamId = 0;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if(pCommand)
{
roamId = pCommand->u.roamCmd.roamId;
VOS_ASSERT( sessionId == pCommand->sessionId );
}
if(<API key> == roamStatus)
{
<API key>(pMac, sessionId, fSuccess, roamResult);
}
else
{
VOS_ASSERT(pSession->bRefAssocStartCnt == 0);
smsLog(pMac, LOGW, FL(" indicates association completion. roamResult = %d"), roamResult);
csrRoamCallCallback(pMac, sessionId, pRoamInfo, roamId, roamStatus, roamResult);
}
}
eHalStatus csrRoamLostLink( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 type, tSirSmeRsp *pSirMsg)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirSmeDeauthInd *pDeauthIndMsg = NULL;
tSirSmeDisassocInd *pDisassocIndMsg = NULL;
eCsrRoamResult result = <API key>;
tCsrRoamInfo *pRoamInfo = NULL;
tCsrRoamInfo roamInfo;
tANI_BOOLEAN fToRoam;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
smsLog(pMac, LOGE, FL("type (%d) session ID %d"), (int)type,(int)sessionId);
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
fToRoam = <API key>(&pSession->connectedProfile);
pSession->fCancelRoaming = eANI_BOOLEAN_FALSE;
if ( <API key> == type )
{
result = <API key>;
pDisassocIndMsg = (tSirSmeDisassocInd *)pSirMsg;
pSession->roamingStatusCode = pDisassocIndMsg->statusCode;
pSession->joinFailStatusCode.reasonCode = pDisassocIndMsg->reasonCode;
}
else if ( eWNI_SME_DEAUTH_IND == type )
{
result = <API key>;
pDeauthIndMsg = (tSirSmeDeauthInd *)pSirMsg;
pSession->roamingStatusCode = pDeauthIndMsg->statusCode;
pSession->joinFailStatusCode.reasonCode =
(pDeauthIndMsg->reasonCode == eSIR_BEACON_MISSED) ?
<API key> : pDeauthIndMsg->reasonCode;
}
else
{
smsLog(pMac, LOGW, FL("gets an unknown type (%d)"), type);
result = <API key>;
pSession->joinFailStatusCode.reasonCode = 1;
}
smsLog(pMac, LOGE, FL("pSession->joinFailStatusCode.reasonCode (%d) pSession->roamingStatusCode %d"), pSession->joinFailStatusCode.reasonCode,pSession->roamingStatusCode);
if(!CSR_IS_INFRA_AP(&pSession->connectedProfile))
{
smsLog(pMac, LOGE, FL(" call csrRoamCallCallback"));
csrRoamCallCallback(pMac, sessionId, NULL, 0, <API key>, result);
}
if ( <API key> == type )
{
status = <API key>(pMac, pDisassocIndMsg);
}
else if ( eWNI_SME_DEAUTH_IND == type )
{
status = <API key>(pMac, pDeauthIndMsg);
}
if(!HAL_STATUS_SUCCESS(status))
{
fToRoam = eANI_BOOLEAN_FALSE;
}
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
roamInfo.statusCode = (tSirResultCodes)pSession->roamingStatusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
if( <API key> == type)
{
palCopyMemory(pMac->hHdd, roamInfo.peerMac, pDisassocIndMsg->peerMacAddr, sizeof(tSirMacAddr));
roamInfo.staId = (tANI_U8)pDisassocIndMsg->staId;
}
else if( eWNI_SME_DEAUTH_IND == type )
{
palCopyMemory(pMac->hHdd, roamInfo.peerMac, pDeauthIndMsg->peerMacAddr, sizeof(tSirMacAddr));
roamInfo.staId = (tANI_U8)pDeauthIndMsg->staId;
}
smsLog(pMac, LOGE, FL("roamInfo.staId (%d) MAC : *:%02x:%02x:%02x"), roamInfo.staId,roamInfo.peerMac[3],roamInfo.peerMac[4],roamInfo.peerMac[5]);
if(fToRoam)
{
<API key>(pMac, &pSession->connectedProfile);
if( pMac->roam.configParam.nRoamingTime )
{
if(HAL_STATUS_SUCCESS(status = csrRoamStartRoaming(pMac, sessionId,
( eWNI_SME_DEAUTH_IND == type ) ?
<API key><API key>)))
{
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
if(csrIsBssTypeIBSS(pSession->connectedProfile.BSSType))
{
roamInfo.u.pConnectedProfile = &pSession->connectedProfile;
roamInfo.statusCode = (tSirResultCodes)pSession->roamingStatusCode;
roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
}
else
{
roamInfo.reasonCode = <API key>;
}
pRoamInfo = &roamInfo;
pSession->roamingReason = ( eWNI_SME_DEAUTH_IND == type ) ?
<API key><API key>;
pSession->roamingStartTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd);
csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, <API key>, <API key>);
}
else
{
smsLog(pMac, LOGW, " %s Fail to start roaming, status = %d", __func__, status);
fToRoam = eANI_BOOLEAN_FALSE;
}
}
else
{
fToRoam = eANI_BOOLEAN_FALSE;
}
}
if(!fToRoam)
{
if(!CSR_IS_INFRA_AP(&pSession->connectedProfile))
{
csrRoamCallCallback(pMac, sessionId, &roamInfo, 0, eCSR_ROAM_LOSTLINK, result);
}
if(<API key>(&pSession->connectedProfile))
{
<API key>(pMac);
}
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac,tANI_U32 sessionId)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tListElem *pEntry = NULL;
tSmeCmd *pCommand = NULL;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
pSession->fCancelRoaming = eANI_BOOLEAN_FALSE;
<API key>(pMac, &pSession->connectedProfile);
if(pMac->roam.configParam.nRoamingTime)
{
if(HAL_STATUS_SUCCESS(status = csrRoamStartRoaming(pMac,sessionId, pSession->roamingReason)))
{
pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK);
if(pEntry)
{
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
}
if(pCommand)
{
if (( eSmeCommandRoam == pCommand->command ) &&
( <API key> == pCommand->u.roamCmd.roamReason))
{
if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) )
{
<API key>( pMac, pCommand );
}
}
}
smsLog( pMac, LOGW, "Lost link roaming started ...");
}
}
else
{
status = eHAL_STATUS_FAILURE;
}
return (status);
}
void <API key>( tpAniSirGlobal pMac )
{
tListElem *pEntry;
tSmeCmd *pCommand;
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if ( pEntry )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if ( <API key> == pCommand->command )
{
if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) )
{
<API key>( pMac, pCommand );
}
else
{
smsLog( pMac, LOGE, " ******<API key> fail to release command");
}
}
else
{
smsLog( pMac, LOGW, "CSR: WmStatusChange Completion called but LOST LINK command is not ACTIVE ..." );
}
}
else
{
smsLog( pMac, LOGW, "CSR: WmStatusChange Completion called but NO commands are ACTIVE ..." );
}
<API key>( pMac );
}
void <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
eHalStatus status = eHAL_STATUS_FAILURE;
tSirSmeRsp *pSirSmeMsg;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pCommand->sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), pCommand->sessionId);
return;
}
smsLog(pMac, LOGE, FL(" pCommand->u.wmStatusChangeCmd.Type = %d pCommand->sessionId = %d"), pCommand->u.wmStatusChangeCmd.Type,pCommand->sessionId);
switch ( pCommand->u.wmStatusChangeCmd.Type )
{
case eCsrDisassociated:
pSirSmeMsg = (tSirSmeRsp *)&pCommand->u.wmStatusChangeCmd.u.DisassocIndMsg;
status = csrRoamLostLink(pMac, pCommand->sessionId, <API key>, pSirSmeMsg);
break;
case eCsrDeauthenticated:
pSirSmeMsg = (tSirSmeRsp *)&pCommand->u.wmStatusChangeCmd.u.DeauthIndMsg;
status = csrRoamLostLink(pMac, pCommand->sessionId, eWNI_SME_DEAUTH_IND, pSirSmeMsg);
break;
default:
smsLog(pMac, LOGW, FL("gets an unknown command %d"), pCommand->u.wmStatusChangeCmd.Type);
break;
}
if( CSR_IS_CONN_WDS(&pSession->connectedProfile) )
{
if( !HAL_STATUS_SUCCESS(<API key>( pMac, pCommand->sessionId, eANI_BOOLEAN_TRUE )) )
{
smsLog(pMac, LOGE, FL(" failed to issue stopBSS command"));
}
}
<API key>( pMac );
}
static eCsrCfgDot11Mode <API key>( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,
tANI_U8 operationChn, eCsrBand *pBand )
{
eCsrPhyMode phyModeIn = (eCsrPhyMode)pProfile->phyMode;
eCsrCfgDot11Mode cfgDot11Mode = <API key>(pProfile, phyModeIn,
pMac->roam.configParam.<API key>);
eCsrBand eBand;
if( ((!CSR_IS_INFRA_AP(pProfile )&& !CSR_IS_WDS(pProfile )) &&
((<API key> == pMac->roam.configParam.uCfgDot11Mode) ||
(<API key> == pMac->roam.configParam.uCfgDot11Mode))) ||
(<API key> == cfgDot11Mode) || (<API key> == cfgDot11Mode) )
{
switch( pMac->roam.configParam.uCfgDot11Mode )
{
case <API key>:
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_5G;
break;
case <API key>:
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_24;
break;
case <API key>:
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_24;
break;
case <API key>:
cfgDot11Mode = <API key>;
eBand = <API key>(operationChn) ? eCSR_BAND_24 : eCSR_BAND_5G;
break;
#ifdef WLAN_FEATURE_11AC
case <API key>:
if (<API key>(DOT11AC))
{
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_5G;
}
else
{
cfgDot11Mode = <API key>;
eBand = <API key>(operationChn) ? eCSR_BAND_24 : eCSR_BAND_5G;
}
break;
case <API key>:
if (<API key>(DOT11AC))
{
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_5G;
}
else
{
eBand = <API key>(operationChn) ? eCSR_BAND_24 : eCSR_BAND_5G;
cfgDot11Mode = <API key>;
}
break;
#endif
case <API key>:
eBand = pMac->roam.configParam.eBand;
if (eCSR_BAND_24 == eBand)
{
cfgDot11Mode = <API key>;
}
else
{
#ifdef WLAN_FEATURE_11AC
if (<API key>(DOT11AC))
{
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_5G;
}
else
{
cfgDot11Mode = <API key>;
eBand = <API key>(operationChn) ? eCSR_BAND_24 : eCSR_BAND_5G;
}
#else
cfgDot11Mode = <API key>;
eBand = <API key>(operationChn) ? eCSR_BAND_24 : eCSR_BAND_5G;
#endif
}
break;
default:
if ( <API key> == operationChn )
{
eBand = pMac->roam.configParam.eBand;
if(eCSR_BAND_24 == eBand)
{
cfgDot11Mode = <API key>;
}
else
{
eBand = eCSR_BAND_5G;
cfgDot11Mode = <API key>;
}
}
else if ( <API key>(operationChn) )
{
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_24;
}
else
{
cfgDot11Mode = <API key>;
eBand = eCSR_BAND_5G;
}
break;
}
}
else
{
if ( <API key> == operationChn )
{
eBand = pMac->roam.configParam.eBand;
if(eCSR_BAND_ALL == eBand)
{
eBand = eCSR_BAND_5G;
}
}
else if ( <API key>(operationChn) )
{
eBand = eCSR_BAND_24;
}
else
{
eBand = eCSR_BAND_5G;
}
}
if(pBand)
{
*pBand = eBand;
}
if (operationChn == 14){
smsLog(pMac, LOGE, FL(" Switching to Dot11B mode "));
cfgDot11Mode = <API key>;
}
if( (!CSR_IS_11n_ALLOWED(pProfile->EncryptionType.encryptionType[0] ) || ((pProfile->privacy == 1) && (pProfile->EncryptionType.encryptionType[0] == <API key>)) ) &&
((<API key> == cfgDot11Mode) ||
#ifdef WLAN_FEATURE_11AC
(<API key> == cfgDot11Mode) ||
#endif
(<API key> == cfgDot11Mode)) )
{
if ( <API key>(operationChn) )
{
cfgDot11Mode = <API key>;
}
else
{
cfgDot11Mode = <API key>;
}
}
return( cfgDot11Mode );
}
eHalStatus csrRoamIssueStopBss( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamSubState NewSubstate )
{
eHalStatus status;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
#ifdef <API key>
{
<API key> *pIbssLog;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
pIbssLog->eventId = <API key>;
<API key>(pIbssLog);
}
}
#endif
pSession->ibss_join_pending = FALSE;
<API key>(pMac, sessionId );
<API key>( pMac, NewSubstate, sessionId );
status = <API key>( pMac, sessionId );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, FL("<API key> failed with status %d"), status);
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U8 *pChannels, tANI_U32 *pNumChan)
{
return (ccmCfgGetStr(pMac, <API key>,
(tANI_U8 *)pChannels,
pNumChan));
}
tPowerdBm csrGetCfgMaxTxPower (tpAniSirGlobal pMac, tANI_U8 channel)
{
tANI_U32 cfgLength = 0;
tANI_U16 cfgId = 0;
tPowerdBm maxTxPwr = 0;
tANI_U8 *pCountryInfo = NULL;
eHalStatus status;
tANI_U8 count = 0;
tANI_U8 firstChannel;
tANI_U8 maxChannels;
if (CSR_IS_CHANNEL_5GHZ(channel))
{
cfgId = <API key>;
cfgLength = <API key>;
}
else if (<API key>(channel))
{
cfgId = <API key>;
cfgLength = <API key>;
}
else
return maxTxPwr;
status = palAllocateMemory(pMac->hHdd, (void **)&pCountryInfo, cfgLength);
if (status != eHAL_STATUS_SUCCESS)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
FL("%s: palAllocateMemory() failed, status = %d"),
__FUNCTION__, status);
goto error;
}
status = ccmCfgGetStr(pMac, cfgId, (tANI_U8 *)pCountryInfo, &cfgLength);
if (status != eHAL_STATUS_SUCCESS)
{
goto error;
}
while (count <= (cfgLength - (sizeof(tSirMacChanInfo))))
{
firstChannel = pCountryInfo[count++];
maxChannels = pCountryInfo[count++];
maxTxPwr = pCountryInfo[count++];
if ((channel >= firstChannel) &&
(channel < (firstChannel + maxChannels)))
{
break;
}
}
error:
if (NULL != pCountryInfo)
palFreeMemory(pMac->hHdd, pCountryInfo);
return maxTxPwr;
}
tANI_BOOLEAN <API key>( tpAniSirGlobal pMac, tANI_U8 channel )
{
tANI_BOOLEAN fValid = FALSE;
tANI_U32 idxValidChannels;
tANI_U32 len = sizeof(pMac->roam.validChannelList);
if (HAL_STATUS_SUCCESS(<API key>(pMac, pMac->roam.validChannelList, &len)))
{
for ( idxValidChannels = 0; ( idxValidChannels < len ); idxValidChannels++ )
{
if ( channel == pMac->roam.validChannelList[ idxValidChannels ] )
{
fValid = TRUE;
break;
}
}
}
pMac->roam.numValidChannels = len;
return fValid;
}
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac, tANI_U8 channel)
{
tANI_BOOLEAN fValid = eANI_BOOLEAN_FALSE;
tANI_U8 i;
for(i = 0; i < pMac->scan.base40MHzChannels.numChannels; i++)
{
if(channel == pMac->scan.base40MHzChannels.channelList[i])
{
fValid = eANI_BOOLEAN_TRUE;
break;
}
}
return (fValid);
}
static ePhyChanBondState csrGetCBModeFromIes(tpAniSirGlobal pMac, tANI_U8 primaryChn, tDot11fBeaconIEs *pIes)
{
ePhyChanBondState eRet = <API key>;
tANI_U8 centerChn;
tANI_U32 ChannelBondingMode;
if(<API key>(primaryChn))
{
ChannelBondingMode = pMac->roam.configParam.<API key>;
}
else
{
ChannelBondingMode = pMac->roam.configParam.<API key>;
}
if(<API key> != ChannelBondingMode)
{
if(pIes->HTCaps.present && (<API key> == pIes->HTCaps.<API key>))
{
if(pIes->HTInfo.present)
{
smsLog(pMac, LOG1, "scws %u rtws %u sco %u",
pIes->HTCaps.<API key>,
pIes->HTInfo.<API key>,
pIes->HTInfo.<API key>);
if (pIes->HTInfo.<API key> == <API key>)
eRet = (ePhyChanBondState)pIes->HTInfo.<API key>;
else
eRet = <API key>;
switch (eRet) {
case <API key>:
centerChn = primaryChn + <API key>;
break;
case <API key>:
centerChn = primaryChn - <API key>;
break;
case <API key>:
default:
centerChn = primaryChn;
break;
}
if((<API key> != eRet) && !<API key>(pMac, centerChn))
{
smsLog(pMac, LOGE, " Invalid center channel (%d), disable 40MHz mode", centerChn);
}
}
}
}
return eRet;
}
tANI_BOOLEAN <API key>( tpAniSirGlobal pMac, tCsrEncryptionList *pCipherList, eCsrEncryptionType encryptionType )
{
tANI_BOOLEAN fFound = FALSE;
tANI_U32 idx;
for( idx = 0; idx < pCipherList->numEntries; idx++ )
{
if( pCipherList->encryptionType[idx] == encryptionType )
{
fFound = TRUE;
break;
}
}
return fFound;
}
tANI_BOOLEAN csrIsAuthInList( tpAniSirGlobal pMac, tCsrAuthList *pAuthList, eCsrAuthType authType )
{
tANI_BOOLEAN fFound = FALSE;
tANI_U32 idx;
for( idx = 0; idx < pAuthList->numEntries; idx++ )
{
if( pAuthList->authType[idx] == authType )
{
fFound = TRUE;
break;
}
}
return fFound;
}
tANI_BOOLEAN csrIsSameProfile(tpAniSirGlobal pMac, <API key> *pProfile1, tCsrRoamProfile *pProfile2)
{
tANI_BOOLEAN fCheck = eANI_BOOLEAN_FALSE;
<API key> *pScanFilter = NULL;
eHalStatus status = eHAL_STATUS_SUCCESS;
if(pProfile1 && pProfile2)
{
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter, sizeof(<API key>));
if(HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, pScanFilter, sizeof(<API key>));
status = <API key>(pMac, pProfile2, pScanFilter);
if(HAL_STATUS_SUCCESS(status))
{
fCheck = eANI_BOOLEAN_FALSE;
do
{
tANI_U32 i;
for(i = 0; i < pScanFilter->SSIDs.numOfSSIDs; i++)
{
fCheck = csrIsSsidMatch( pMac, pScanFilter->SSIDs.SSIDList[i].SSID.ssId,
pScanFilter->SSIDs.SSIDList[i].SSID.length,
pProfile1->SSID.ssId, pProfile1->SSID.length, eANI_BOOLEAN_FALSE );
if ( fCheck ) break;
}
if(!fCheck)
{
break;
}
if( !csrIsAuthInList( pMac, &pProfile2->AuthType, pProfile1->AuthType)
|| pProfile2->BSSType != pProfile1->BSSType
|| !<API key>( pMac, &pProfile2->EncryptionType, pProfile1->EncryptionType )
)
{
fCheck = eANI_BOOLEAN_FALSE;
break;
}
#ifdef <API key>
if (pProfile1->MDID.mdiePresent || pProfile2->MDID.mdiePresent)
{
if (pProfile1->MDID.mobilityDomain != pProfile2->MDID.mobilityDomain)
{
fCheck = eANI_BOOLEAN_FALSE;
break;
}
}
#endif
fCheck = eANI_BOOLEAN_TRUE;
}while(0);
csrFreeScanFilter(pMac, pScanFilter);
}
palFreeMemory(pMac->hHdd, pScanFilter);
}
}
return (fCheck);
}
tANI_BOOLEAN <API key>(tpAniSirGlobal pMac, <API key> *pConnProfile, tCsrRoamProfile *pProfile2)
{
tANI_BOOLEAN fCheck = eANI_BOOLEAN_FALSE;
int i;
do
{
if(!<API key>(pMac, &pProfile2->EncryptionType, <API key>) &&
!<API key>(pMac, &pProfile2->EncryptionType, <API key>))
{
fCheck = eANI_BOOLEAN_TRUE;
break;
}
if(!<API key>(pMac, &pProfile2->EncryptionType, pConnProfile->EncryptionType)) break;
if(pConnProfile->Keys.defaultIndex != pProfile2->Keys.defaultIndex) break;
for(i = 0; i < CSR_MAX_NUM_KEY; i++)
{
if(pConnProfile->Keys.KeyLength[i] != pProfile2->Keys.KeyLength[i]) break;
if(!palEqualMemory(pMac->hHdd, &pConnProfile->Keys.KeyMaterial[i],
&pProfile2->Keys.KeyMaterial[i], pProfile2->Keys.KeyLength[i]))
{
break;
}
}
if( i == CSR_MAX_NUM_KEY)
{
fCheck = eANI_BOOLEAN_TRUE;
}
}while(0);
return (fCheck);
}
tANI_U8 <API key>( tpAniSirGlobal pMac )
{
tANI_U8 channel = 0;
tANI_U32 idx;
tANI_U32 idxValidChannels;
tANI_BOOLEAN fFound = FALSE;
tANI_U32 len = sizeof(pMac->roam.validChannelList);
if(<API key> != pMac->roam.configParam.AdHocChannel5G)
{
channel = pMac->roam.configParam.AdHocChannel5G;
if(!<API key>(pMac, channel))
{
channel = 0;
}
}
if (0 == channel && HAL_STATUS_SUCCESS(<API key>(pMac, (tANI_U8 *)pMac->roam.validChannelList, &len)))
{
for ( idx = 0; ( idx < <API key> ) && !fFound; idx++ )
{
for ( idxValidChannels = 0; ( idxValidChannels < len ) && !fFound; idxValidChannels++ )
{
if ( <API key>[ idx ] == pMac->roam.validChannelList[ idxValidChannels ] )
{
fFound = TRUE;
channel = <API key>[ idx ];
}
}
}
if (!fFound)
{
for ( idxValidChannels = 0; idxValidChannels < len ; idxValidChannels++ )
{
if ( CSR_IS_CHANNEL_5GHZ(pMac->roam.validChannelList[ idx ]) )
{
channel = <API key>[ idx ];
break;
}
}
}
}
return( channel );
}
tANI_U8 <API key>( tpAniSirGlobal pMac )
{
tANI_U8 channel = 1;
tANI_U32 idx;
tANI_U32 idxValidChannels;
tANI_BOOLEAN fFound = FALSE;
tANI_U32 len = sizeof(pMac->roam.validChannelList);
if(<API key> != pMac->roam.configParam.AdHocChannel24)
{
channel = pMac->roam.configParam.AdHocChannel24;
if(!<API key>(pMac, channel))
{
channel = 0;
}
}
if (0 == channel && HAL_STATUS_SUCCESS(<API key>(pMac, (tANI_U8 *)pMac->roam.validChannelList, &len)))
{
for ( idx = 0; ( idx < <API key> ) && !fFound; idx++ )
{
for ( idxValidChannels = 0; ( idxValidChannels < len ) && !fFound; idxValidChannels++ )
{
if ( <API key>[ idx ] == pMac->roam.validChannelList[ idxValidChannels ] )
{
fFound = TRUE;
channel = <API key>[ idx ];
}
}
}
}
return( channel );
}
static void <API key>( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,
<API key> *pParam )
{
eCsrCfgDot11Mode cfgDot11Mode;
eCsrBand eBand;
tANI_U8 channel = 0;
tSirNwType nwType;
tANI_U8 operationChannel = 0;
if(pProfile->ChannelInfo.numOfChannels && pProfile->ChannelInfo.ChannelList)
{
operationChannel = pProfile->ChannelInfo.ChannelList[0];
}
cfgDot11Mode = <API key>( pMac, pProfile, operationChannel, &eBand );
if( ( (pProfile->csrPersona == VOS_P2P_CLIENT_MODE) ||
(pProfile->csrPersona == VOS_P2P_GO_MODE) )
&& ( cfgDot11Mode == <API key>)
)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
FL("For P2PClient/P2P-GO (persona %d) cfgDot11Mode is 11B"),
pProfile->csrPersona);
VOS_ASSERT(0);
}
switch( cfgDot11Mode )
{
case <API key>:
nwType = eSIR_11G_NW_TYPE;
break;
case <API key>:
nwType = eSIR_11B_NW_TYPE;
break;
case <API key>:
nwType = eSIR_11A_NW_TYPE;
break;
default:
case <API key>:
case <API key>:
if(eCSR_BAND_24 == eBand)
{
nwType = eSIR_11G_NW_TYPE;
}
else
{
nwType = eSIR_11A_NW_TYPE;
}
break;
}
pParam->extendedRateSet.numRates = 0;
switch ( nwType )
{
default:
smsLog(pMac, LOGE, FL("sees an unknown pSirNwType (%d)"), nwType);
case eSIR_11A_NW_TYPE:
pParam->operationalRateSet.numRates = 8;
pParam->operationalRateSet.rate[0] = SIR_MAC_RATE_6 | <API key>;
pParam->operationalRateSet.rate[1] = SIR_MAC_RATE_9;
pParam->operationalRateSet.rate[2] = SIR_MAC_RATE_12 | <API key>;
pParam->operationalRateSet.rate[3] = SIR_MAC_RATE_18;
pParam->operationalRateSet.rate[4] = SIR_MAC_RATE_24 | <API key>;
pParam->operationalRateSet.rate[5] = SIR_MAC_RATE_36;
pParam->operationalRateSet.rate[6] = SIR_MAC_RATE_48;
pParam->operationalRateSet.rate[7] = SIR_MAC_RATE_54;
if ( <API key> == operationChannel )
{
channel = <API key>( pMac );
if( 0 == channel &&
<API key>(pProfile->phyMode) &&
<API key>(pMac->roam.configParam.phyMode)
)
{
nwType = eSIR_11B_NW_TYPE;
channel = <API key>( pMac );
pParam->operationalRateSet.numRates = 4;
pParam->operationalRateSet.rate[0] = SIR_MAC_RATE_1 | <API key>;
pParam->operationalRateSet.rate[1] = SIR_MAC_RATE_2 | <API key>;
pParam->operationalRateSet.rate[2] = SIR_MAC_RATE_5_5 | <API key>;
pParam->operationalRateSet.rate[3] = SIR_MAC_RATE_11 | <API key>;
}
}
else
{
channel = operationChannel;
}
break;
case eSIR_11B_NW_TYPE:
pParam->operationalRateSet.numRates = 4;
pParam->operationalRateSet.rate[0] = SIR_MAC_RATE_1 | <API key>;
pParam->operationalRateSet.rate[1] = SIR_MAC_RATE_2 | <API key>;
pParam->operationalRateSet.rate[2] = SIR_MAC_RATE_5_5 | <API key>;
pParam->operationalRateSet.rate[3] = SIR_MAC_RATE_11 | <API key>;
if ( <API key> == operationChannel )
{
channel = <API key>( pMac );
}
else
{
channel = operationChannel;
}
break;
case eSIR_11G_NW_TYPE:
if( (pProfile->csrPersona == VOS_P2P_CLIENT_MODE) ||
(pProfile->csrPersona == VOS_P2P_GO_MODE)
)
{
pParam->operationalRateSet.numRates = 8;
pParam->operationalRateSet.rate[0] = SIR_MAC_RATE_6 | <API key>;
pParam->operationalRateSet.rate[1] = SIR_MAC_RATE_9;
pParam->operationalRateSet.rate[2] = SIR_MAC_RATE_12 | <API key>;
pParam->operationalRateSet.rate[3] = SIR_MAC_RATE_18;
pParam->operationalRateSet.rate[4] = SIR_MAC_RATE_24 | <API key>;
pParam->operationalRateSet.rate[5] = SIR_MAC_RATE_36;
pParam->operationalRateSet.rate[6] = SIR_MAC_RATE_48;
pParam->operationalRateSet.rate[7] = SIR_MAC_RATE_54;
}
else
{
pParam->operationalRateSet.numRates = 4;
pParam->operationalRateSet.rate[0] = SIR_MAC_RATE_1 | <API key>;
pParam->operationalRateSet.rate[1] = SIR_MAC_RATE_2 | <API key>;
pParam->operationalRateSet.rate[2] = SIR_MAC_RATE_5_5 | <API key>;
pParam->operationalRateSet.rate[3] = SIR_MAC_RATE_11 | <API key>;
pParam->extendedRateSet.numRates = 8;
pParam->extendedRateSet.rate[0] = SIR_MAC_RATE_6;
pParam->extendedRateSet.rate[1] = SIR_MAC_RATE_9;
pParam->extendedRateSet.rate[2] = SIR_MAC_RATE_12;
pParam->extendedRateSet.rate[3] = SIR_MAC_RATE_18;
pParam->extendedRateSet.rate[4] = SIR_MAC_RATE_24;
pParam->extendedRateSet.rate[5] = SIR_MAC_RATE_36;
pParam->extendedRateSet.rate[6] = SIR_MAC_RATE_48;
pParam->extendedRateSet.rate[7] = SIR_MAC_RATE_54;
}
if ( <API key> == operationChannel )
{
channel = <API key>( pMac );
}
else
{
channel = operationChannel;
}
break;
}
pParam->operationChn = channel;
pParam->sirNwType = nwType;
}
static void <API key>( tpAniSirGlobal pMac, tSirBssDescription *pBssDesc,
tDot11fBeaconIEs *pIes, <API key> *pParam )
{
if( pParam )
{
pParam->sirNwType = pBssDesc->nwType;
pParam->cbMode = <API key>;
pParam->operationChn = pBssDesc->channelId;
palCopyMemory( pMac->hHdd, &pParam->bssid, pBssDesc->bssId, sizeof(tCsrBssid) );
if( pIes )
{
if(pIes->SuppRates.present)
{
pParam->operationalRateSet.numRates = pIes->SuppRates.num_rates;
if(pIes->SuppRates.num_rates > <API key>)
{
smsLog(pMac, LOGE, FL("num_rates :%d is more than <API key>, resetting to <API key>"),
pIes->SuppRates.num_rates);
pIes->SuppRates.num_rates = <API key>;
}
palCopyMemory(pMac->hHdd, pParam->operationalRateSet.rate, pIes->SuppRates.rates,
sizeof(*pIes->SuppRates.rates) * pIes->SuppRates.num_rates);
}
if( pIes->SSID.present )
{
pParam->ssId.length = pIes->SSID.num_ssid;
palCopyMemory(pMac->hHdd, pParam->ssId.ssId, pIes->SSID.ssid, pParam->ssId.length);
}
pParam->cbMode = csrGetCBModeFromIes(pMac, pParam->operationChn, pIes);
}
else
{
pParam->ssId.length = 0;
pParam->operationalRateSet.numRates = 0;
}
}
}
static void <API key>( tpAniSirGlobal pMac, tSirMacRateSet *pSirRateSet )
{
tANI_U8 MaxRate = 0;
tANI_U32 i;
tANI_U8 *pRate;
pRate = pSirRateSet->rate;
for ( i = 0; i < pSirRateSet->numRates; i++ )
{
MaxRate = CSR_MAX( MaxRate, ( pRate[ i ] & (~<API key>) ) );
}
return;
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, <API key> *pParam,
tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc, tANI_U32 roamId )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
eCsrBand eBand;
<API key>( pMac, <API key>, sessionId );
#ifdef <API key>
if( CSR_IS_IBSS( pProfile ) )
{
<API key> *pIbssLog;
<API key>(pIbssLog, <API key>, LOG_WLAN_IBSS_C);
if(pIbssLog)
{
if(pBssDesc)
{
pIbssLog->eventId = <API key>;
palCopyMemory(pMac->hHdd, pIbssLog->bssid, pBssDesc->bssId, 6);
}
else
{
pIbssLog->eventId = <API key>;
}
palCopyMemory(pMac->hHdd, pIbssLog->ssid, pParam->ssId.ssId,
pParam->ssId.length);
if(pProfile->ChannelInfo.numOfChannels == 0)
{
pIbssLog->channelSetting = AUTO_PICK;
}
else
{
pIbssLog->channelSetting = SPECIFIED;
}
pIbssLog->operatingChannel = pParam->operationChn;
<API key>(pIbssLog);
}
}
#endif
pParam->nRSNIELength = (tANI_U16)pProfile->nRSNReqIELength;
pParam->pRSNIE = pProfile->pRSNReqIE;
pParam->privacy = pProfile->privacy;
pParam->fwdWPSPBCProbeReq = pProfile->fwdWPSPBCProbeReq;
pParam->authType = pProfile->csr80211AuthType;
pParam->beaconInterval = pProfile->beaconInterval;
pParam->dtimPeriod = pProfile->dtimPeriod;
pParam->ApUapsdEnable = pProfile->ApUapsdEnable;
pParam->ssidHidden = pProfile->SSIDs.SSIDList[0].ssidHidden;
if (CSR_IS_INFRA_AP(pProfile)&& (pParam->operationChn != 0))
{
if (csrIsValidChannel(pMac, pParam->operationChn) != eHAL_STATUS_SUCCESS)
{
pParam->operationChn = <API key>;
}
}
pParam->protEnabled = pProfile->protEnabled;
pParam->obssProtEnabled = pProfile->obssProtEnabled;
pParam->ht_protection = pProfile->cfg_protection;
pParam->wps_state = pProfile->wps_state;
pParam->uCfgDot11Mode = <API key>(pMac, pProfile, pParam->operationChn ,
&eBand);
pParam->bssPersona = pProfile->csrPersona;
status = <API key>( pMac, sessionId, pProfile->BSSType, pParam, pBssDesc );
return (status);
}
static void <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig, tDot11fBeaconIEs *pIes)
{
tANI_U8 Channel;
ePhyChanBondState cbMode = <API key>;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if( pBssDesc )
{
<API key>( pMac, pBssDesc, pIes, &pSession->bssParams );
if( CSR_IS_WDS_STA( pProfile ) )
{
palCopyMemory(pMac->hHdd, &pSession->bssParams.bssid, &pSession->selfMacAddr, sizeof(tCsrBssid));
}
}
else
{
<API key>(pMac, pProfile, &pSession->bssParams);
if(pProfile->SSIDs.numOfSSIDs)
{
palCopyMemory(pMac->hHdd, &pSession->bssParams.ssId, pProfile->SSIDs.SSIDList, sizeof(tSirMacSSid));
}
if( CSR_IS_WDS_STA( pProfile ) )
{
palCopyMemory(pMac->hHdd, &pSession->bssParams.bssid, &pSession->selfMacAddr, sizeof(tCsrBssid));
}
else if( pProfile->BSSIDs.numOfBSSIDs )
{
palCopyMemory(pMac->hHdd, &pSession->bssParams.bssid, pProfile->BSSIDs.bssid, sizeof(tCsrBssid));
}
else
{
palZeroMemory( pMac->hHdd, &pSession->bssParams.bssid, sizeof(tCsrBssid) );
}
}
Channel = pSession->bssParams.operationChn;
pProfile->operationChannel = Channel;
if(Channel == 0)
{
smsLog(pMac, LOGW, " CSR cannot find a channel to start IBSS");
}
else
{
<API key>( pMac, &pSession->bssParams.operationalRateSet );
if (CSR_IS_INFRA_AP(pProfile) || CSR_IS_START_IBSS( pProfile ) )
{
if(<API key>(Channel) )
{
cbMode = pMac->roam.configParam.<API key>;
}
else
{
cbMode = pMac->roam.configParam.<API key>;
}
smsLog(pMac, LOG1, "## cbMode %d", cbMode);
pBssConfig->cbMode = cbMode;
pSession->bssParams.cbMode = cbMode;
}
}
}
static eHalStatus csrRoamStartIbss( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
tANI_BOOLEAN *pfSameIbss )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_BOOLEAN fSameIbss = FALSE;
if ( csrIsConnStateIbss( pMac, sessionId ) )
{
if ( csrIsSameProfile( pMac, &pMac->roam.roamSession[sessionId].connectedProfile, pProfile ) )
{
fSameIbss = TRUE;
}
else
{
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
}
}
else if ( <API key>( pMac, sessionId ) )
{
status = <API key>( pMac, sessionId, <API key>, FALSE );
}
else
{
tBssConfigParam *pBssConfig;
status = palAllocateMemory(pMac->hHdd, (void **)&pBssConfig, sizeof(tBssConfigParam));
if(HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, pBssConfig, sizeof(tBssConfigParam));
status = <API key>(pMac, pProfile, pBssConfig, NULL);
if(HAL_STATUS_SUCCESS(status))
{
pMac->roam.roamSession[sessionId].bssParams.uCfgDot11Mode = pBssConfig->uCfgDot11Mode;
<API key>(pMac, sessionId, pProfile, NULL, pBssConfig, NULL);
status = <API key>(pMac, sessionId, pProfile,
NULL, pBssConfig,
NULL, eANI_BOOLEAN_FALSE);
}
palFreeMemory(pMac->hHdd, pBssConfig);
}
}
if(pfSameIbss)
{
*pfSameIbss = fSameIbss;
}
return( status );
}
static void <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tSirSmeNewBssInfo *pNewBss )
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if( pNewBss )
{
pSession->connectedProfile.operationChannel = pNewBss->channelNumber;
palCopyMemory( pMac->hHdd, &pSession->connectedProfile.bssid,
&(pNewBss->bssId), sizeof( tCsrBssid ) );
}
return;
}
#ifdef FEATURE_WLAN_WAPI
eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
tANI_U32 numItems )
{
eHalStatus status = <API key>;
tCsrRoamSession *pSession;
if(!<API key>( pMac, sessionId ))
{
smsLog(pMac, LOGE, FL(" Invalid session ID"));
return status;
}
smsLog(pMac, LOGW, "csrRoamSetBKIDCache called, numItems = %d", numItems);
pSession = CSR_GET_SESSION( pMac, sessionId );
if(numItems <= <API key>)
{
status = eHAL_STATUS_SUCCESS;
pSession->NumBkidCache = (tANI_U16)numItems;
if(numItems && pBKIDCache)
{
status = palCopyMemory( pMac->hHdd, pSession->BkidCacheInfo, pBKIDCache,
sizeof(tBkidCacheInfo) * numItems );
}
}
return (status);
}
eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
tBkidCacheInfo *pBkidCache)
{
eHalStatus status = <API key>;
tCsrRoamSession *pSession;
if(!<API key>( pMac, sessionId ))
{
smsLog(pMac, LOGE, FL(" Invalid session ID"));
return status;
}
pSession = CSR_GET_SESSION( pMac, sessionId );
if(pNum && pBkidCache)
{
if(pSession->NumBkidCache == 0)
{
*pNum = 0;
status = eHAL_STATUS_SUCCESS;
}
else if(*pNum >= pSession->NumBkidCache)
{
if(pSession->NumBkidCache > <API key>)
{
smsLog(pMac, LOGE, FL("NumPmkidCache :%d is more than <API key>, resetting to <API key>"),
pSession->NumBkidCache);
pSession->NumBkidCache = <API key>;
}
palCopyMemory( pMac->hHdd, pBkidCache, pSession->BkidCacheInfo,
sizeof(tBkidCacheInfo) * pSession->NumBkidCache );
*pNum = pSession->NumBkidCache;
status = eHAL_STATUS_SUCCESS;
}
}
return (status);
}
tANI_U32 <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
return (pMac->roam.roamSession[sessionId].NumBkidCache);
}
#endif
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tPmkidCacheInfo *pPMKIDCache, tANI_U32 numItems )
{
eHalStatus status = <API key>;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
smsLog(pMac, LOGW, "<API key> called, numItems = %d", numItems);
if(numItems <= <API key>)
{
#ifdef <API key>
{
<API key>(secEvent, <API key>);
palZeroMemory(pMac->hHdd, &secEvent, sizeof(<API key>));
secEvent.eventId = <API key>;
secEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.mcEncryptionType);
secEvent.<API key> =
(v_U8_t)<API key>(pSession->connectedProfile.EncryptionType);
palCopyMemory( pMac->hHdd, secEvent.bssid, pSession->connectedProfile.bssid, 6 );
secEvent.authMode =
(v_U8_t)<API key>(pSession->connectedProfile.AuthType);
<API key>(&secEvent, EVENT_WLAN_SECURITY);
}
#endif
status = eHAL_STATUS_SUCCESS;
pSession->NumPmkidCache = (tANI_U16)numItems;
if(numItems && pPMKIDCache)
{
status = palCopyMemory( pMac->hHdd, pSession->PmkidCacheInfo, pPMKIDCache,
sizeof(tPmkidCacheInfo) * numItems );
}
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tANI_U8 *pBSSId )
{
eHalStatus status = eHAL_STATUS_FAILURE;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tANI_BOOLEAN fMatchFound = FALSE;
tANI_U32 Index;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
do
{
for( Index=0; Index < pSession->NumPmkidCache; Index++ )
{
smsLog(pMac, LOGW, "Delete PMKID for %02X-%02X-%02X-%02X-%02X-%02X ",
pBSSId[0], pBSSId[1], pBSSId[2], pBSSId[3], pBSSId[4], pBSSId[5]);
if( palEqualMemory( pMac->hHdd, pBSSId, pSession->PmkidCacheInfo[Index].BSSID, sizeof(tCsrBssid) ) )
{
fMatchFound = TRUE;
break;
}
}
if( !fMatchFound ) break;
palZeroMemory( pMac->hHdd, pSession->PmkidCacheInfo[Index].BSSID, sizeof(tPmkidCacheInfo));
status = eHAL_STATUS_SUCCESS;
}
while( 0 );
smsLog(pMac, LOGW, "csrDelPMKID called return match = %d Status = %d",
fMatchFound, status);
return status;
}
tANI_U32 <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
return (pMac->roam.roamSession[sessionId].NumPmkidCache);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum, tPmkidCacheInfo *pPmkidCache)
{
eHalStatus status = <API key>;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pNum && pPmkidCache)
{
if(pSession->NumPmkidCache == 0)
{
*pNum = 0;
status = eHAL_STATUS_SUCCESS;
}
else if(*pNum >= pSession->NumPmkidCache)
{
if(pSession->NumPmkidCache > <API key>)
{
smsLog(pMac, LOGE, FL("NumPmkidCache :%d is more than <API key>, resetting to <API key>"),
pSession->NumPmkidCache);
pSession->NumPmkidCache = <API key>;
}
palCopyMemory( pMac->hHdd, pPmkidCache, pSession->PmkidCacheInfo,
sizeof(tPmkidCacheInfo) * pSession->NumPmkidCache );
*pNum = pSession->NumPmkidCache;
status = eHAL_STATUS_SUCCESS;
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
{
eHalStatus status = <API key>;
tANI_U32 len;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pLen)
{
len = *pLen;
*pLen = pSession->nWpaRsnReqIeLength;
if(pBuf)
{
if(len >= pSession->nWpaRsnReqIeLength)
{
status = palCopyMemory(pMac->hHdd, pBuf, pSession->pWpaRsnReqIE, pSession->nWpaRsnReqIeLength);
}
}
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
{
eHalStatus status = <API key>;
tANI_U32 len;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pLen)
{
len = *pLen;
*pLen = pSession->nWpaRsnRspIeLength;
if(pBuf)
{
if(len >= pSession->nWpaRsnRspIeLength)
{
status = palCopyMemory(pMac->hHdd, pBuf, pSession->pWpaRsnRspIE, pSession->nWpaRsnRspIeLength);
}
}
}
return (status);
}
#ifdef FEATURE_WLAN_WAPI
eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
{
eHalStatus status = <API key>;
tANI_U32 len;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pLen)
{
len = *pLen;
*pLen = pSession->nWapiReqIeLength;
if(pBuf)
{
if(len >= pSession->nWapiReqIeLength)
{
status = palCopyMemory(pMac->hHdd, pBuf, pSession->pWapiReqIE, pSession->nWapiReqIeLength);
}
}
}
return (status);
}
eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
{
eHalStatus status = <API key>;
tANI_U32 len;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(pLen)
{
len = *pLen;
*pLen = pSession->nWapiRspIeLength;
if(pBuf)
{
if(len >= pSession->nWapiRspIeLength)
{
status = palCopyMemory(pMac->hHdd, pBuf, pSession->pWapiRspIE, pSession->nWapiRspIeLength);
}
}
}
return (status);
}
#endif
eRoamCmdStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
eRoamCmdStatus retStatus = <API key>;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return (retStatus);
}
if(CSR_IS_ROAMING(pSession))
{
retStatus = <API key>;
pSession->fRoaming = eANI_BOOLEAN_FALSE;
}
return (retStatus);
}
eHalStatus <API key>(tpAniSirGlobal pMac,
<API key> *pConnProfile)
{
eHalStatus status = eHAL_STATUS_FAILURE;
<API key> *pScanFilter = NULL;
tListElem *pEntry;
tCsrScanResult *pResult;
tDot11fBeaconIEs *pIes;
tANI_BOOLEAN fMatch;
if(!(csrIsMacAddressZero(pMac, &pConnProfile->bssid) ||
<API key>(pMac, &pConnProfile->bssid)))
{
do
{
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter, sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status)) break;
palZeroMemory(pMac->hHdd, pScanFilter, sizeof(<API key>));
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter->BSSIDs.bssid, sizeof(tCsrBssid));
if(!HAL_STATUS_SUCCESS(status)) break;
palCopyMemory(pMac->hHdd, pScanFilter->BSSIDs.bssid, &pConnProfile->bssid, sizeof(tCsrBssid));
pScanFilter->BSSIDs.numOfBSSIDs = 1;
if(!csrIsNULLSSID(pConnProfile->SSID.ssId, pConnProfile->SSID.length))
{
status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter->SSIDs.SSIDList, sizeof(tCsrSSIDInfo));
if(!HAL_STATUS_SUCCESS(status)) break;
palCopyMemory(pMac->hHdd, &pScanFilter->SSIDs.SSIDList[0].SSID, &pConnProfile->SSID, sizeof(tSirMacSSid));
}
pScanFilter->authType.numEntries = 1;
pScanFilter->authType.authType[0] = pConnProfile->AuthType;
pScanFilter->BSSType = pConnProfile->BSSType;
pScanFilter->EncryptionType.numEntries = 1;
pScanFilter->EncryptionType.encryptionType[0] = pConnProfile->EncryptionType;
pScanFilter->mcEncryptionType.numEntries = 1;
pScanFilter->mcEncryptionType.encryptionType[0] = pConnProfile->mcEncryptionType;
pScanFilter->ChannelInfo.numOfChannels = 0;
pScanFilter->uapsd_mask = 0;
pScanFilter->bWPSAssociation = eANI_BOOLEAN_FALSE;
pScanFilter->countryCode[0] = 0;
pScanFilter->phyMode = <API key>;
csrLLLock(&pMac->scan.scanResultList);
pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_NOLOCK );
while( pEntry )
{
pResult = GET_BASE_ADDR( pEntry, tCsrScanResult, Link );
pIes = (tDot11fBeaconIEs *)( pResult->Result.pvIes );
fMatch = csrMatchBSS(pMac, &pResult->Result.BssDescriptor,
pScanFilter, NULL, NULL, NULL, &pIes);
if( !pResult->Result.pvIes )
{
palFreeMemory(pMac->hHdd, pIes);
}
if(fMatch)
{
if( csrLLRemoveEntry(&pMac->scan.scanResultList, pEntry, LL_ACCESS_NOLOCK) )
{
<API key>( pMac, pResult );
}
break;
}
pEntry = csrLLNext(&pMac->scan.scanResultList, pEntry, LL_ACCESS_NOLOCK);
}
csrLLUnlock(&pMac->scan.scanResultList);
}while(0);
if(pScanFilter)
{
csrFreeScanFilter(pMac, pScanFilter);
palFreeMemory(pMac->hHdd, pScanFilter);
}
}
return (status);
}
eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 sessionId;
for( sessionId = 0; sessionId < <API key>; sessionId++ )
{
if( <API key>( pMac, sessionId ) )
{
if( csrIsConnStateIbss( pMac, sessionId ) || csrIsBTAMP( pMac, sessionId ) )
{
smsLog( pMac, LOGW, " BTAMP is not allowed due to IBSS/BT-AMP exist in session %d", sessionId );
status = <API key>;
break;
}
if( csrIsConnStateInfra( pMac, sessionId ) )
{
if( chnId &&
( (tANI_U8)chnId != pMac->roam.roamSession[sessionId].connectedProfile.operationChannel ) )
{
smsLog( pMac, LOGW, " BTAMP is not allowed due to channel (%d) diff than infr channel (%d)",
chnId, pMac->roam.roamSession[sessionId].connectedProfile.operationChannel );
status = <API key>;
break;
}
}
}
}
return ( status );
}
static eHalStatus csrRoamStartWds( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tBssConfigParam bssConfig;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if ( csrIsConnStateIbss( pMac, sessionId ) )
{
status = csrRoamIssueStopBss( pMac, sessionId, <API key> );
}
else if ( <API key>( pMac, sessionId ) )
{
status = <API key>( pMac, sessionId, <API key>, FALSE );
}
else
{
VOS_ASSERT( !csrIsConnStateWds( pMac, sessionId ) );
palZeroMemory(pMac->hHdd, &bssConfig, sizeof(tBssConfigParam));
palCopyMemory( pMac->hHdd, &pSession->bssParams.bssid, pProfile->BSSIDs.bssid[0], sizeof(tCsrBssid) );
status = <API key>(pMac, pProfile, &bssConfig, pBssDesc);
if(HAL_STATUS_SUCCESS(status))
{
csrFreeRoamProfile( pMac, sessionId );
if (HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd,
(void **)&pSession->pCurRoamProfile,
sizeof(tCsrRoamProfile))))
{
palZeroMemory(pMac->hHdd, pSession->pCurRoamProfile, sizeof(tCsrRoamProfile));
csrRoamCopyProfile(pMac, pSession->pCurRoamProfile, pProfile);
}
<API key>(pMac, sessionId, pProfile, NULL, &bssConfig, NULL);
status = <API key>(pMac, sessionId, pProfile,
NULL, &bssConfig,
NULL, eANI_BOOLEAN_FALSE);
}
}
return( status );
}
static void <API key>( tpAniSirGlobal pMac,
tSirBssDescription *pBssDescription,
tANI_U8 *pBuf, tANI_U8 uapsdMask)
{
tCsrChannelSet channelGroup;
<API key> *pAP_capabilityInfo;
tAniBool fTmp;
tANI_BOOLEAN found = FALSE;
tANI_U32 size = 0;
tANI_S8 pwrLimit = 0;
tANI_U16 i;
*pBuf++ = (tANI_U8)FALSE;
*pBuf++ = (tANI_U8)FALSE;
*pBuf++ = (tANI_U8)FALSE;
pAP_capabilityInfo = (<API key> *)&pBssDescription->capabilityInfo;
if ( csrIs11hSupported( pMac ) && pAP_capabilityInfo->spectrumMgt && eSIR_11A_NW_TYPE == pBssDescription->nwType )
{
fTmp = (tAniBool)pal_cpu_to_be32(1);
}
else
fTmp = (tAniBool)0;
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&fTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
*pBuf++ = MIN_STA_PWR_CAP_DBM;
found = <API key>(pMac, pBssDescription, &channelGroup);
pwrLimit = csrGetCfgMaxTxPower (pMac, pBssDescription->channelId);
if (0 != pwrLimit)
{
*pBuf++ = pwrLimit;
}
else
{
*pBuf++ = MAX_STA_PWR_CAP_DBM;
}
size = sizeof(pMac->roam.validChannelList);
if(HAL_STATUS_SUCCESS(<API key>(pMac, (tANI_U8 *)pMac->roam.validChannelList, &size)))
{
*pBuf++ = (tANI_U8)size;
for ( i = 0; i < size; i++)
{
*pBuf++ = pMac->roam.validChannelList[ i ];
}
}
else
{
smsLog(pMac, LOGE, FL("can not find any valid channel"));
*pBuf++ = 0;
}
#ifndef <API key>
if( btcIsReadyForUapsd(pMac) )
#endif
{
*pBuf++ = uapsdMask;
}
#ifndef <API key>
else
{
smsLog(pMac, LOGE, FL(" BTC doesn't allow UAPSD for uapsd_mask(0x%X)"), uapsdMask);
*pBuf++ = 0;
}
#endif
palCopyMemory( pMac->hHdd, pBuf, pBssDescription,
pBssDescription->length + sizeof( pBssDescription->length ) );
pBuf += pBssDescription->length + sizeof( pBssDescription->length );
}
eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pBssDescription,
tCsrRoamProfile *pProfile, tDot11fBeaconIEs *pIes, tANI_U16 messageType )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirSmeJoinReq *pMsg;
tANI_U8 *pBuf;
v_U8_t acm_mask = 0, uapsd_mask;
tANI_U16 msgLen, wTmp, ieLen;
tSirMacRateSet OpRateSet;
tSirMacRateSet ExRateSet;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tANI_U32 dwTmp;
tANI_U8 wpaRsnIE[<API key>];
tANI_U32 ucDot11Mode = 0;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if (NULL == pBssDescription)
{
smsLog(pMac, LOGE, FL(" pBssDescription is NULL"));
return eHAL_STATUS_FAILURE;
}
do {
pSession->joinFailStatusCode.statusCode = eSIR_SME_SUCCESS;
pSession->joinFailStatusCode.reasonCode = 0;
memcpy (&pSession->joinFailStatusCode.bssId, &pBssDescription->bssId, sizeof(tSirMacAddr));
msgLen = sizeof( tSirSmeJoinReq ) - sizeof( *pBssDescription ) +
pBssDescription->length + sizeof( pBssDescription->length ) +
sizeof( tCsrWpaIe ) + sizeof( tCsrWpaAuthIe ) + sizeof( tANI_U16 );
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, msgLen);
pMsg->messageType = pal_cpu_to_be16((tANI_U16)messageType);
pMsg->length = pal_cpu_to_be16(msgLen);
pBuf = &pMsg->sessionId;
*pBuf = (tANI_U8)sessionId;
pBuf++;
*pBuf = 0;
*( pBuf + 1 ) = 0;
pBuf += sizeof(tANI_U16);
if( pIes->SSID.present && pIes->SSID.num_ssid )
{
*pBuf = pIes->SSID.num_ssid;
pBuf++;
palCopyMemory( pMac->hHdd, pBuf, pIes->SSID.ssid, pIes->SSID.num_ssid );
pBuf += pIes->SSID.num_ssid;
}
else
{
*pBuf = 0;
pBuf++;
}
palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, &pSession->selfMacAddr, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
dwTmp = pal_cpu_to_be32( <API key>( pProfile->BSSType ) );
if (dwTmp == eSIR_BTAMP_STA_MODE) dwTmp = eSIR_BTAMP_AP_MODE;
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tSirBssType) );
pBuf += sizeof(tSirBssType);
ucDot11Mode = <API key>( pMac, pSession->bssParams.uCfgDot11Mode );
if (pBssDescription->channelId <= 14 &&
FALSE == pMac->roam.configParam.enableVhtFor24GHz &&
<API key> == ucDot11Mode)
{
ucDot11Mode = <API key>;
}
*pBuf = (tANI_U8)ucDot11Mode;
pBuf++;
*pBuf = (tANI_U8)pProfile->csrPersona;
pBuf++;
*pBuf = (tANI_U8)pSession->bssParams.cbMode;
pBuf++;
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
FL("CSR PERSONA=%d CSR CbMode %d"), pProfile->csrPersona, pSession->bssParams.cbMode);
*pBuf = pProfile->uapsd_mask;
pBuf++;
status = csrGetRateSet(pMac, pProfile, (eCsrPhyMode)pProfile->phyMode, pBssDescription, pIes, &OpRateSet, &ExRateSet);
if (HAL_STATUS_SUCCESS(status) )
{
if (OpRateSet.numRates) {
*pBuf++ = OpRateSet.numRates;
palCopyMemory(pMac->hHdd, pBuf, OpRateSet.rate, OpRateSet.numRates);
pBuf += OpRateSet.numRates;
} else *pBuf++ = 0;
if (ExRateSet.numRates) {
*pBuf++ = ExRateSet.numRates;
palCopyMemory(pMac->hHdd, pBuf, ExRateSet.rate, ExRateSet.numRates);
pBuf += ExRateSet.numRates;
} else *pBuf++ = 0;
}
else
{
*pBuf++ = 0;
*pBuf++ = 0;
}
if ( csrIsProfileWpa( pProfile ) )
{
ieLen = csrRetrieveWpaIe( pMac, pProfile, pBssDescription, pIes,
(tCsrWpaIe *)( wpaRsnIE ) );
}
else if( csrIsProfileRSN( pProfile ) )
{
ieLen = csrRetrieveRsnIe( pMac, sessionId, pProfile, pBssDescription, pIes,
(tCsrRSNIe *)( wpaRsnIE ) );
}
#ifdef FEATURE_WLAN_WAPI
else if( csrIsProfileWapi( pProfile ) )
{
ieLen = csrRetrieveWapiIe( pMac, sessionId, pProfile, pBssDescription, pIes,
(tCsrWapiIe *)( wpaRsnIE ) );
}
#endif
else
{
ieLen = 0;
}
if( ieLen )
{
if(ieLen > <API key>)
{
smsLog(pMac, LOGE, FL(" WPA RSN IE length :%d is more than <API key>, resetting to %d"), ieLen, <API key>);
ieLen = <API key>;
}
#ifdef FEATURE_WLAN_WAPI
if( csrIsProfileWapi( pProfile ) )
{
if(ieLen > pSession->nWapiReqIeLength)
{
if(pSession->pWapiReqIE && pSession->nWapiReqIeLength)
{
palFreeMemory(pMac->hHdd, pSession->pWapiReqIE);
}
status = palAllocateMemory(pMac->hHdd, (void **)&pSession->pWapiReqIE, ieLen);
if(!HAL_STATUS_SUCCESS(status)) break;
}
pSession->nWapiReqIeLength = ieLen;
palCopyMemory(pMac->hHdd, pSession->pWapiReqIE, wpaRsnIE, ieLen);
wTmp = pal_cpu_to_be16( ieLen );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof(tANI_U16);
palCopyMemory( pMac->hHdd, pBuf, wpaRsnIE, ieLen );
pBuf += ieLen;
}
else
#endif
{
if(ieLen > pSession->nWpaRsnReqIeLength)
{
if(pSession->pWpaRsnReqIE && pSession->nWpaRsnReqIeLength)
{
palFreeMemory(pMac->hHdd, pSession->pWpaRsnReqIE);
}
status = palAllocateMemory(pMac->hHdd, (void **)&pSession->pWpaRsnReqIE, ieLen);
if(!HAL_STATUS_SUCCESS(status)) break;
}
pSession->nWpaRsnReqIeLength = ieLen;
palCopyMemory(pMac->hHdd, pSession->pWpaRsnReqIE, wpaRsnIE, ieLen);
wTmp = pal_cpu_to_be16( ieLen );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof(tANI_U16);
palCopyMemory( pMac->hHdd, pBuf, wpaRsnIE, ieLen );
pBuf += ieLen;
}
}
else
{
pSession->nWpaRsnReqIeLength = 0;
if(pSession->pWpaRsnReqIE)
{
palFreeMemory(pMac->hHdd, pSession->pWpaRsnReqIE);
pSession->pWpaRsnReqIE = NULL;
}
#ifdef FEATURE_WLAN_WAPI
pSession->nWapiReqIeLength = 0;
if(pSession->pWapiReqIE)
{
palFreeMemory(pMac->hHdd, pSession->pWapiReqIE);
pSession->pWapiReqIE = NULL;
}
#endif
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += 2;
}
#ifdef FEATURE_WLAN_CCX
if( eWNI_SME_JOIN_REQ == messageType )
{
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += 2;
}
else if(<API key> == messageType )
{
if( csrIsProfileCCX( pProfile ) )
{
#ifdef <API key>
ieLen = pSession->suppCckmIeInfo.cckmIeLen;
palCopyMemory(pMac->hHdd, (void *) (wpaRsnIE),
pSession->suppCckmIeInfo.cckmIe, ieLen);
#else
ieLen = <API key>( pMac,
pSession,
pProfile,
pBssDescription,
pSession->pWpaRsnReqIE,
pSession->nWpaRsnReqIeLength,
(void *)( wpaRsnIE ) );
#endif
}
else
{
ieLen = 0;
}
if( ieLen )
{
wTmp = pal_cpu_to_be16( ieLen );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof(tANI_U16);
palCopyMemory( pMac->hHdd, pBuf, wpaRsnIE, ieLen );
pBuf += ieLen;
}
else
{
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += 2;
}
}
#endif
if (pProfile->nAddIEScanLength)
{
ieLen = pProfile->nAddIEScanLength;
memset(pSession->addIEScan, 0 , pSession->nAddIEScanLength);
pSession->nAddIEScanLength = ieLen;
vos_mem_copy(pSession->addIEScan, pProfile->addIEScan, ieLen);
wTmp = pal_cpu_to_be16( ieLen );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof(tANI_U16);
vos_mem_copy(pBuf, pProfile->addIEScan, ieLen);
pBuf += ieLen;
}
else
{
memset(pSession->addIEScan, 0, pSession->nAddIEScanLength);
pSession->nAddIEScanLength = 0;
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += 2;
}
if(pProfile->nAddIEAssocLength && pProfile->pAddIEAssoc)
{
ieLen = pProfile->nAddIEAssocLength;
if(ieLen > pSession->nAddIEAssocLength)
{
if(pSession->pAddIEAssoc && pSession->nAddIEAssocLength)
{
palFreeMemory(pMac->hHdd, pSession->pAddIEAssoc);
}
status = palAllocateMemory(pMac->hHdd,
(void **)&pSession->pAddIEAssoc, ieLen);
if(!HAL_STATUS_SUCCESS(status)) break;
}
pSession->nAddIEAssocLength = ieLen;
palCopyMemory(pMac->hHdd, pSession->pAddIEAssoc,
pProfile->pAddIEAssoc, ieLen);
wTmp = pal_cpu_to_be16( ieLen );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof(tANI_U16);
palCopyMemory( pMac->hHdd, pBuf, pProfile->pAddIEAssoc, ieLen );
pBuf += ieLen;
}
else
{
pSession->nAddIEAssocLength = 0;
if(pSession->pAddIEAssoc)
{
palFreeMemory(pMac->hHdd, pSession->pAddIEAssoc);
pSession->pAddIEAssoc = NULL;
}
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += 2;
}
if(<API key> == messageType )
{
uapsd_mask = (v_U8_t)pProfile->uapsd_mask;
if( uapsd_mask && ( NULL != pBssDescription ) )
{
if( CSR_IS_QOS_BSS(pIes) && CSR_IS_UAPSD_BSS(pIes) )
{
#ifndef <API key>
acm_mask = sme_QosGetACMMask(pMac, pBssDescription, pIes);
#endif
uapsd_mask &= ~(acm_mask);
}
else
{
uapsd_mask = 0;
}
}
}
dwTmp = pal_cpu_to_be32( <API key>( pProfile-><API key>) );
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tANI_U32) );
pBuf += sizeof(tANI_U32);
dwTmp = pal_cpu_to_be32( <API key>( pProfile-><API key>) );
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tANI_U32) );
pBuf += sizeof(tANI_U32);
#ifdef WLAN_FEATURE_11W
if (pProfile->MFPEnabled)
{
dwTmp = pal_cpu_to_be32(<API key>);
}
else
{
dwTmp = pal_cpu_to_be32(eSIR_ED_NONE);
}
palCopyMemory(pMac->hHdd, pBuf, &dwTmp, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
#endif
#ifdef <API key>
pProfile->MDID.mdiePresent = pBssDescription->mdiePresent;
if (csrIsProfile11r( pProfile )
#ifdef FEATURE_WLAN_CCX
&& !((pProfile->negotiatedAuthType == eCSR_<API key>) &&
(pIes->CCXVersion.present) && (pMac->roam.configParam.<API key>))
#endif
)
{
dwTmp = pal_cpu_to_be32(TRUE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
else
{
dwTmp = pal_cpu_to_be32(FALSE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
#endif
#ifdef FEATURE_WLAN_CCX
if (TRUE == pMac->roam.configParam.<API key>)
{
dwTmp = pal_cpu_to_be32(TRUE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
else
{
dwTmp = pal_cpu_to_be32(FALSE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
if ((csrIsProfileCCX(pProfile) ||
((pIes->CCXVersion.present)
&& ((pProfile->negotiatedAuthType == eCSR_<API key>)
|| (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)
|| (pProfile->negotiatedAuthType == <API key>)
|| (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN)
#ifdef WLAN_FEATURE_11W
|| (pProfile->negotiatedAuthType == eCSR_<API key>)
#endif
|| (pProfile->negotiatedAuthType == <API key>))))
&& (pMac->roam.configParam.<API key>))
{
dwTmp = pal_cpu_to_be32(TRUE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
else
{
dwTmp = pal_cpu_to_be32(FALSE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
if (eWNI_SME_JOIN_REQ == messageType)
{
tCCXTspecInfo ccxTspec;
palZeroMemory(pMac->hHdd, &ccxTspec, sizeof(tCCXTspecInfo));
palCopyMemory( pMac->hHdd, pBuf, &ccxTspec, sizeof(tCCXTspecInfo));
pBuf += sizeof(tCCXTspecInfo);
}
else if (<API key> == messageType)
{
if ((csrIsProfileCCX(pProfile) ||
((pIes->CCXVersion.present)
&& ((pProfile->negotiatedAuthType == eCSR_<API key>)
|| (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)
|| (pProfile->negotiatedAuthType == <API key>)
|| (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN)
#ifdef WLAN_FEATURE_11W
|| (pProfile->negotiatedAuthType == eCSR_<API key>)
#endif
|| (pProfile->negotiatedAuthType == <API key>))))
&& (pMac->roam.configParam.<API key>))
{
tCCXTspecInfo ccxTspec;
palZeroMemory(pMac->hHdd, &ccxTspec, sizeof(tCCXTspecInfo));
ccxTspec.numTspecs = <API key>(pMac, sessionId, (tTspecInfo *) &ccxTspec.tspec[0]);
*pBuf = ccxTspec.numTspecs;
pBuf += sizeof(tANI_U8);
if (ccxTspec.numTspecs) {
palCopyMemory(pMac->hHdd, pBuf, (void*)&ccxTspec.tspec[0], (ccxTspec.numTspecs*sizeof(tTspecInfo)));
}
pBuf += sizeof(ccxTspec.tspec);
}
else
{
tCCXTspecInfo ccxTspec;
palZeroMemory(pMac->hHdd, &ccxTspec, sizeof(tCCXTspecInfo));
palCopyMemory( pMac->hHdd, pBuf, &ccxTspec, sizeof(tCCXTspecInfo));
pBuf += sizeof(tCCXTspecInfo);
}
}
#endif
#if defined <API key> || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
if (pMac->roam.configParam.<API key>
#ifdef FEATURE_WLAN_LFR
|| <API key>(pMac, sessionId)
#endif
)
{
dwTmp = pal_cpu_to_be32(TRUE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
else
{
dwTmp = pal_cpu_to_be32(FALSE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
#endif
#ifdef FEATURE_WLAN_LFR
if(<API key>(pMac, sessionId))
{
dwTmp = pal_cpu_to_be32(TRUE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
else
{
dwTmp = pal_cpu_to_be32(FALSE);
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
pBuf += sizeof(tAniBool);
}
#endif
*pBuf = (tANI_U8)pMac->roam.configParam.txLdpcEnable;
pBuf++;
if ((csrIs11hSupported (pMac)) && (CSR_IS_CHANNEL_5GHZ(pBssDescription->channelId)) &&
(pIes->Country.present) && (!pMac->roam.configParam.<API key>))
{
<API key>( pMac, pIes->Country.num_triplets * sizeof(tSirMacChanInfo),
(tSirMacChanInfo *)(&pIes->Country.triplets[0]) );
<API key>(pMac);
}
#ifdef WLAN_FEATURE_11AC
*pBuf = (tANI_U8)pMac->roam.configParam.txBFEnable;
pBuf++;
*pBuf = (tANI_U8)pMac->roam.configParam.txBFCsnValue;
pBuf++;
#endif
*pBuf = (tANI_U8)pMac->roam.configParam.<API key>;
pBuf++;
if(pMac->roam.roamSession[sessionId].fWMMConnection)
{
dwTmp = pal_cpu_to_be32(TRUE);
vos_mem_copy(pBuf, &dwTmp, sizeof(tAniBool));
pBuf += sizeof(tAniBool);
}
else
{
dwTmp = pal_cpu_to_be32(FALSE);
vos_mem_copy(pBuf, &dwTmp, sizeof(tAniBool));
pBuf += sizeof(tAniBool);
}
if(pMac->roam.roamSession[sessionId].fQOSConnection)
{
dwTmp = pal_cpu_to_be32(TRUE);
vos_mem_copy(pBuf, &dwTmp, sizeof(tAniBool));
pBuf += sizeof(tAniBool);
}
else
{
dwTmp = pal_cpu_to_be32(FALSE);
vos_mem_copy(pBuf, &dwTmp, sizeof(tAniBool));
pBuf += sizeof(tAniBool);
}
<API key>( pMac, pBssDescription, pBuf,
(tANI_U8)pProfile->uapsd_mask);
status = palSendMBMessage(pMac->hHdd, pMsg );
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
else
{
#ifndef <API key>
if (eWNI_SME_JOIN_REQ == messageType)
{
sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, <API key>, NULL);
}
else if (<API key> == messageType)
{
sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, <API key>, NULL);
}
#endif
}
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirSmeDisassocReq *pMsg;
tANI_U8 *pBuf;
tANI_U16 wTmp;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (!<API key>( pMac, sessionId ))
return eHAL_STATUS_FAILURE;
do {
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDisassocReq ));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeDisassocReq ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeDisassocReq ));
pBuf = &pMsg->sessionId;
*pBuf++ = (tANI_U8)sessionId;
*pBuf = 0;
*( pBuf + 1 ) = 0;
pBuf += sizeof(tANI_U16);
if ( (pSession->pCurRoamProfile != NULL) &&
((CSR_IS_INFRA_AP(pSession->pCurRoamProfile)) ||
(CSR_IS_WDS_AP(pSession->pCurRoamProfile))) )
{
status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, pSession->selfMacAddr, sizeof( tSirMacAddr ) );
pBuf = pBuf + sizeof ( tSirMacAddr );
status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( tSirMacAddr ) );
pBuf = pBuf + sizeof ( tSirMacAddr );
}
else
{
status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( tSirMacAddr ) );
pBuf = pBuf + sizeof ( tSirMacAddr );
status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( pMsg->bssId ) );
pBuf = pBuf + sizeof ( tSirMacAddr );
}
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
wTmp = pal_cpu_to_be16(reasonCode);
status = palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
pBuf += sizeof(tANI_U16);
if ( <API key>(pMac, sessionId)
#ifdef <API key>
&& csrRoamIs11rAssoc(pMac)
#endif
)
{
*pBuf = <API key>;
}
pBuf += sizeof(tANI_U8);
status = palSendMBMessage( pMac->hHdd, pMsg );
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_BOOLEAN bEnable, tSirMacAddr bssId )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> *pMsg;
tANI_U8 *pBuf;
do
{
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( <API key> ));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( <API key> ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( <API key> ));
pBuf = &pMsg->sessionId;
*pBuf++ = (tANI_U8)sessionId;
*pBuf = 0;
*( pBuf + 1 ) = 0;
pBuf += sizeof(tANI_U16);
status = palCopyMemory( pMac->hHdd, pMsg->bssId, bssId, sizeof( tSirMacAddr ) );
pBuf = pBuf + sizeof ( tSirMacAddr );
*pBuf = (tANI_BOOLEAN)bEnable;
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
status = palSendMBMessage( pMac->hHdd, pMsg );
} while( 0 );
return( status );
}
eHalStatus
<API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
VOS_MODULE_ID modId, tSirMacAddr bssId,
void *pUsrContext, void *pfnSapEventCallback,
tANI_U8 *pAssocStasBuf )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> *pMsg;
tANI_U8 *pBuf = NULL, *wTmpBuf = NULL;
tANI_U32 dwTmp;
do
{
status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof( <API key> ) );
if (!HAL_STATUS_SUCCESS(status)) break;
palZeroMemory( pMac->hHdd, pMsg, sizeof( <API key> ) );
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pBuf = (tANI_U8 *)&pMsg->bssId;
wTmpBuf = pBuf;
palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
dwTmp = pal_cpu_to_be16((tANI_U16)modId);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U16));
pBuf += sizeof(tANI_U16);
dwTmp = pal_cpu_to_be32((tANI_U32)pUsrContext);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
dwTmp = pal_cpu_to_be32((tANI_U32)pfnSapEventCallback);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
dwTmp = pal_cpu_to_be32((tANI_U32)pAssocStasBuf);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)));
status = palSendMBMessage( pMac->hHdd, pMsg );
} while( 0 );
return( status );
}
eHalStatus
<API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tSirMacAddr bssId, void *pUsrContext, void *pfnSapEventCallback,v_MACADDR_t pRemoveMac)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> *pMsg;
tANI_U8 *pBuf = NULL, *wTmpBuf = NULL;
tANI_U32 dwTmp;
do
{
status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof(<API key>) );
if (!HAL_STATUS_SUCCESS(status)) break;
palZeroMemory( pMac->hHdd, pMsg, sizeof( <API key> ) );
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pBuf = (tANI_U8 *)&pMsg->pUsrContext;
VOS_ASSERT(pBuf);
wTmpBuf = pBuf;
dwTmp = pal_cpu_to_be32((tANI_U32)pUsrContext);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
dwTmp = pal_cpu_to_be32((tANI_U32)pfnSapEventCallback);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, pRemoveMac.bytes, sizeof(v_MACADDR_t));
pBuf += sizeof(v_MACADDR_t);
pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)));
status = palSendMBMessage( pMac->hHdd, pMsg );
} while( 0 );
return( status );
}
eHalStatus
<API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
tpSirChangeBIParams pMsg;
tANI_U16 len = 0;
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
if(!pMac->roam.roamSession[sessionId].bssParams.<API key> )
return eHAL_STATUS_SUCCESS;
pMac->roam.roamSession[sessionId].bssParams.<API key> = eANI_BOOLEAN_FALSE;
len = sizeof(tSirChangeBIParams);
status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, len );
if(HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, pMsg, sizeof(tSirChangeBIParams) );
pMsg->messageType = <API key>;
pMsg->length = len;
palCopyMemory( pMac->hHdd, (tSirMacAddr *)pMsg->bssId, &pSession->selfMacAddr, sizeof(tSirMacAddr) );
smsLog( pMac, LOG1, FL("CSR Attempting to change BI for Bssid= %02x-%02x-%02x-%02x-%02x-%02x "),
pMsg->bssId[ 0 ], pMsg->bssId[ 1 ], pMsg->bssId[ 2 ],
pMsg->bssId[ 3 ], pMsg->bssId[ 4 ], pMsg->bssId[ 5 ] );
pMsg->sessionId = sessionId;
smsLog(pMac, LOG1, FL(" session %d BeaconInterval %d"), sessionId, pMac->roam.roamSession[sessionId].bssParams.beaconInterval);
pMsg->beaconInterval = pMac->roam.roamSession[sessionId].bssParams.beaconInterval;
status = palSendMBMessage(pMac->hHdd, pMsg);
}
return status;
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirSmeDeauthReq *pMsg;
tANI_U8 *pBuf;
tANI_U16 wTmp;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (!<API key>( pMac, sessionId ))
return eHAL_STATUS_FAILURE;
do {
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDeauthReq ));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeDeauthReq ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_DEAUTH_REQ);
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeDeauthReq ));
pBuf = &pMsg->sessionId;
*pBuf++ = (tANI_U8)sessionId;
*pBuf = 0;
*(pBuf + 1 ) = 0;
pBuf += sizeof(tANI_U16);
if ((pSession->pCurRoamProfile != NULL) && (
(CSR_IS_INFRA_AP(pSession->pCurRoamProfile)) ||
(CSR_IS_WDS_AP(pSession->pCurRoamProfile)))){
status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, pSession->selfMacAddr, sizeof( pMsg->peerMacAddr ) );
pBuf = pBuf + sizeof(tSirMacAddr);
}
else
{
status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( pMsg->peerMacAddr ) );
pBuf = pBuf + sizeof(tSirMacAddr);
}
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
status = palCopyMemory( pMac->hHdd, (tSirMacAddr *) pBuf, bssId, sizeof( pMsg->peerMacAddr ) );
pBuf = pBuf + sizeof(tSirMacAddr);
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
wTmp = pal_cpu_to_be16(reasonCode);
status = palCopyMemory( pMac->hHdd, pBuf, &wTmp,sizeof( tANI_U16 ) );
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
status = palSendMBMessage( pMac->hHdd, pMsg );
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tpSirSmeDisassocInd pDisassocInd )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirSmeDisassocCnf *pMsg;
do {
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDisassocCnf ));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeDisassocCnf ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->statusCode = (tSirResultCodes)pal_cpu_to_be32(eSIR_SME_SUCCESS);
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeDisassocCnf ));
status = palCopyMemory(pMac->hHdd, pMsg->peerMacAddr, pDisassocInd->peerMacAddr, sizeof(pMsg->peerMacAddr));
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
status = palCopyMemory(pMac->hHdd, pMsg->bssId, pDisassocInd->bssId, sizeof(pMsg->peerMacAddr));
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
status = palSendMBMessage( pMac->hHdd, pMsg );
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tpSirSmeDeauthInd pDeauthInd )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirSmeDeauthCnf *pMsg;
do {
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDeauthCnf ));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeDeauthCnf ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_DEAUTH_CNF);
pMsg->statusCode = (tSirResultCodes)pal_cpu_to_be32(eSIR_SME_SUCCESS);
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeDeauthCnf ));
status = palCopyMemory(pMac->hHdd, pMsg->bssId, pDeauthInd->bssId, sizeof(pMsg->bssId));
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
status = palCopyMemory(pMac->hHdd, pMsg->peerMacAddr, pDeauthInd->peerMacAddr, sizeof(pMsg->peerMacAddr));
if(!HAL_STATUS_SUCCESS(status))
{
palFreeMemory(pMac->hHdd, pMsg);
break;
}
status = palSendMBMessage( pMac->hHdd, pMsg );
} while( 0 );
return( status );
}
eHalStatus csrSendAssocCnfMsg( tpAniSirGlobal pMac, tpSirSmeAssocInd pAssocInd, eHalStatus Halstatus )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSirSmeAssocCnf *pMsg;
tANI_U8 *pBuf;
tSirResultCodes statusCode;
tANI_U16 wTmp;
do {
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeAssocCnf ));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeAssocCnf ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_ASSOC_CNF);
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeAssocCnf ));
pBuf = (tANI_U8 *)&pMsg->statusCode;
if(HAL_STATUS_SUCCESS(Halstatus))
statusCode = (tSirResultCodes)pal_cpu_to_be32(eSIR_SME_SUCCESS);
else
statusCode = (tSirResultCodes)pal_cpu_to_be32(<API key>);
palCopyMemory( pMac->hHdd, pBuf, &statusCode, sizeof(tSirResultCodes) );
pBuf += sizeof(tSirResultCodes);
status = palCopyMemory(pMac->hHdd, (tSirMacAddr *)pBuf, pAssocInd->bssId, sizeof(tSirMacAddr));
pBuf += sizeof (tSirMacAddr);
status = palCopyMemory(pMac->hHdd, (tSirMacAddr *)pBuf, pAssocInd->peerMacAddr, sizeof(tSirMacAddr));
pBuf += sizeof (tSirMacAddr);
wTmp = pal_cpu_to_be16(pAssocInd->aid);
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof (tANI_U16);
status = palCopyMemory(pMac->hHdd, (tSirMacAddr *)pBuf, pAssocInd->bssId, sizeof(tSirMacAddr));
pBuf += sizeof (tSirMacAddr);
*pBuf = 11;
status = palSendMBMessage( pMac->hHdd, pMsg );
if(!HAL_STATUS_SUCCESS(status))
{
break;
}
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac,
tpSirSmeAssocInd pAssocInd,
eHalStatus Halstatus,
tANI_U8 sessionId)
{
tSirMsgQ msgQ;
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> *pMsg;
tANI_U8 *pBuf;
tSirResultCodes statusCode;
tANI_U16 wTmp;
do {
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( <API key> ));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( <API key> ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( <API key> ));
pMsg->sessionId = sessionId;
pBuf = (tANI_U8 *)&pMsg->statusCode;
if(HAL_STATUS_SUCCESS(Halstatus))
statusCode = (tSirResultCodes)pal_cpu_to_be32(eSIR_SME_SUCCESS);
else
statusCode = (tSirResultCodes)pal_cpu_to_be32(<API key>);
palCopyMemory( pMac->hHdd, pBuf, &statusCode, sizeof(tSirResultCodes) );
pBuf += sizeof(tSirResultCodes);
status = palCopyMemory(pMac->hHdd, (tSirMacAddr *)pBuf, pAssocInd->bssId, sizeof(tSirMacAddr));
pBuf += sizeof (tSirMacAddr);
status = palCopyMemory(pMac->hHdd, (tSirMacAddr *)pBuf, pAssocInd->peerMacAddr, sizeof(tSirMacAddr));
pBuf += sizeof (tSirMacAddr);
wTmp = pal_cpu_to_be16(pAssocInd->staId);
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof (tANI_U16);
status = palCopyMemory(pMac->hHdd, (tSirMacAddr *)pBuf, pAssocInd->bssId, sizeof(tSirMacAddr));
pBuf += sizeof (tSirMacAddr);
*pBuf = 11;
pBuf += sizeof (tANI_U8);
*pBuf = pAssocInd->wmmEnabledSta;
pBuf += sizeof (tANI_U8);
status = palCopyMemory(pMac->hHdd, (tSirRSNie *)pBuf, &pAssocInd->rsnIE, sizeof(tSirRSNie));
pBuf += sizeof (tSirRSNie);
status = palCopyMemory(pMac->hHdd, (void *)pBuf, &pAssocInd->addIE, sizeof(tSirAddie));
pBuf += sizeof (tSirAddie);
*pBuf = pAssocInd->reassocReq;
pBuf += sizeof (tANI_U8);
msgQ.type = <API key>;
msgQ.bodyptr = pMsg;
msgQ.bodyval = 0;
SysProcessMmhMsg(pMac, &msgQ);
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId,
tSirMacAddr peerMacAddr, tANI_U8 numKeys, tAniEdType edType,
tANI_BOOLEAN fUnicast, tAniKeyDirection aniKeyDirection,
tANI_U8 keyId, tANI_U8 keyLength, tANI_U8 *pKey, tANI_U8 paeRole,
tANI_U8 *pKeyRsc )
{
<API key> *pMsg;
tANI_U16 msgLen;
eHalStatus status = eHAL_STATUS_FAILURE;
tAniEdType tmpEdType;
tAniKeyDirection tmpDirection;
tANI_U8 *pBuf = NULL;
tANI_U8 *p = NULL;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
do {
if( ( 1 != numKeys ) && ( 0 != numKeys ) ) break;
msgLen = sizeof( tANI_U16) + sizeof( tANI_U16 ) + sizeof( tSirMacAddr ) +
sizeof( tSirMacAddr ) + 1 + sizeof(tANI_U16) +
sizeof( pMsg->keyMaterial.length ) + sizeof( pMsg->keyMaterial.edType ) + sizeof( pMsg->keyMaterial.numKeys ) +
( sizeof( pMsg->keyMaterial.key ) );
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, msgLen);
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->length = pal_cpu_to_be16(msgLen);
pBuf = &pMsg->sessionId;
*pBuf = (tANI_U8)sessionId;
pBuf++;
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += sizeof(tANI_U16);
palCopyMemory( pMac->hHdd, pBuf,
(tANI_U8 *)peerMacAddr, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
palCopyMemory( pMac->hHdd, pBuf,
(tANI_U8 *)&pSession->connectedProfile.bssid, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
p = pBuf;
p = pal_set_U16( p, pal_cpu_to_be16((tANI_U16)( sizeof( pMsg->keyMaterial.numKeys ) + ( numKeys * sizeof( pMsg->keyMaterial.key ) ) )) );
tmpEdType = (tAniEdType)pal_cpu_to_be32(edType);
palCopyMemory( pMac->hHdd, p, (tANI_U8 *)&tmpEdType, sizeof(tAniEdType) );
p += sizeof( pMsg->keyMaterial.edType );
*p = numKeys;
p += sizeof( pMsg->keyMaterial.numKeys );
*p = keyId;
p += sizeof( pMsg->keyMaterial.key[ 0 ].keyId );
*p = (tANI_U8)fUnicast;
p += sizeof( pMsg->keyMaterial.key[ 0 ].unicast );
tmpDirection = (tAniKeyDirection)pal_cpu_to_be32(aniKeyDirection);
palCopyMemory( pMac->hHdd, p, (tANI_U8 *)&tmpDirection, sizeof(tAniKeyDirection) );
p += sizeof(tAniKeyDirection);
palCopyMemory( pMac->hHdd, p, pKeyRsc, CSR_MAX_RSC_LEN );
p += sizeof( pMsg->keyMaterial.key[ 0 ].keyRsc );
*p = paeRole;
p++;
p = pal_set_U16( p, pal_cpu_to_be16(keyLength) );
if ( keyLength && pKey )
{
palCopyMemory( pMac->hHdd, p, pKey, keyLength );
if(keyLength == 16)
{
smsLog(pMac, LOG1, " SME Set keyIdx (%d) encType(%d) key = %02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X",
keyId, edType, pKey[0], pKey[1], pKey[2], pKey[3], pKey[4],
pKey[5], pKey[6], pKey[7], pKey[8],
pKey[9], pKey[10], pKey[11], pKey[12], pKey[13], pKey[14], pKey[15]);
}
}
status = palSendMBMessage(pMac->hHdd, pMsg);
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamBssType bssType,
<API key> *pParam, tSirBssDescription *pBssDesc )
{
eHalStatus status;
tSirSmeStartBssReq *pMsg;
tANI_U8 *pBuf = NULL;
tANI_U8 *wTmpBuf = NULL;
tANI_U16 msgLen, wTmp;
tANI_U32 dwTmp;
tSirNwType nwType;
ePhyChanBondState cbMode;
tANI_U32 authType;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
do {
pSession->joinFailStatusCode.statusCode = eSIR_SME_SUCCESS;
pSession->joinFailStatusCode.reasonCode = 0;
msgLen = sizeof(tSirSmeStartBssReq);
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, msgLen);
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pBuf = &pMsg->sessionId;
wTmpBuf = pBuf;
*pBuf = (tANI_U8)sessionId;
pBuf++;
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += sizeof(tANI_U16);
palCopyMemory( pMac->hHdd, pBuf, pParam->bssid, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
palCopyMemory( pMac->hHdd, pBuf, pSession->selfMacAddr, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
if( pBssDesc && pBssDesc->beaconInterval )
{
wTmp = pal_cpu_to_be16( pBssDesc->beaconInterval );
}
else if(pParam->beaconInterval)
{
wTmp = pal_cpu_to_be16( pParam->beaconInterval );
}
else
{
wTmp = pal_cpu_to_be16( <API key> );
}
if(<API key> (pMac, sessionId,
pParam->bssPersona)
== eHAL_STATUS_SUCCESS )
{
<API key>(pMac, pParam->operationChn, &wTmp, sessionId,
pParam->bssPersona);
pParam->beaconInterval = wTmp;
}
else
{
smsLog( pMac,LOGE, FL("****Start BSS failed persona already exists***"));
status = eHAL_STATUS_FAILURE;
palFreeMemory( pMac->hHdd, pMsg );
return status;
}
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof( tANI_U16 ) );
pBuf += sizeof(tANI_U16);
*pBuf = (tANI_U8)<API key>( pMac, pParam->uCfgDot11Mode );
pBuf += 1;
dwTmp = pal_cpu_to_be32( <API key>( bssType ) );
palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tSirBssType) );
pBuf += sizeof(tSirBssType);
if( pParam->ssId.length )
{
*pBuf = pParam->ssId.length;
pBuf++;
palCopyMemory( pMac->hHdd, pBuf, pParam->ssId.ssId, pParam->ssId.length );
pBuf += pParam->ssId.length;
}
else
{
*pBuf = 0;
pBuf++;
}
*pBuf = pParam->operationChn;
pBuf++;
cbMode = (ePhyChanBondState)pal_cpu_to_be32(pParam->cbMode);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&cbMode, sizeof(ePhyChanBondState) );
pBuf += sizeof(ePhyChanBondState);
*pBuf = pParam->privacy;
pBuf++;
*pBuf = pParam->ApUapsdEnable;
pBuf++;
*pBuf = pParam->ssidHidden;
pBuf++;
*pBuf = (tANI_U8)pParam->fwdWPSPBCProbeReq;
pBuf++;
*pBuf = (tANI_U8)pParam->protEnabled;
pBuf++;
*pBuf = (tANI_U8)pParam->obssProtEnabled;
pBuf++;
wTmp = pal_cpu_to_be16( pParam->ht_protection );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof( tANI_U16 ) );
pBuf += sizeof(tANI_U16);
authType = pal_cpu_to_be32(pParam->authType);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&authType, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
dwTmp = pal_cpu_to_be32(pParam->dtimPeriod);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
pBuf += sizeof(tANI_U32);
*pBuf = pParam->wps_state;
pBuf++;
*pBuf = (tANI_U8)pParam->bssPersona;
pBuf++;
*pBuf = (tANI_U8)(tANI_U8)pMac->roam.configParam.txLdpcEnable;
pBuf++;
*pBuf = (tANI_U8)pMac->roam.configParam.enableOxygenNwk;
pBuf++;
if( pParam->nRSNIELength > sizeof(pMsg->rsnIE.rsnIEdata) )
{
status = <API key>;
palFreeMemory( pMac->hHdd, pMsg );
break;
}
wTmp = pal_cpu_to_be16( pParam->nRSNIELength );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof(tANI_U16);
if( wTmp )
{
wTmp = pParam->nRSNIELength;
palCopyMemory( pMac->hHdd, pBuf, pParam->pRSNIE, wTmp );
pBuf += wTmp;
}
nwType = (tSirNwType)pal_cpu_to_be32(pParam->sirNwType);
palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&nwType, sizeof(tSirNwType) );
pBuf += sizeof(tSirNwType);
*pBuf = pParam->operationalRateSet.numRates;
pBuf++;
palCopyMemory( pMac->hHdd, pBuf, pParam->operationalRateSet.rate, pParam->operationalRateSet.numRates );
pBuf += pParam->operationalRateSet.numRates ;
*pBuf++ = pParam->extendedRateSet.numRates;
if(0 != pParam->extendedRateSet.numRates)
{
palCopyMemory( pMac->hHdd, pBuf, pParam->extendedRateSet.rate, pParam->extendedRateSet.numRates );
pBuf += pParam->extendedRateSet.numRates;
}
msgLen = (tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf));
pMsg->length = pal_cpu_to_be16(msgLen);
status = palSendMBMessage(pMac->hHdd, pMsg);
} while( 0 );
return( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId )
{
eHalStatus status = eHAL_STATUS_FAILURE;
tSirSmeStopBssReq *pMsg;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
tANI_U8 *pBuf;
tANI_U16 msgLen;
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
do {
status = palAllocateMemory(pMac, (void **)&pMsg, sizeof(tSirSmeStopBssReq));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeStopBssReq ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pBuf = &pMsg->sessionId;
*pBuf = (tANI_U8)sessionId;
pBuf++;
*pBuf = 0;
pBuf += sizeof(tANI_U16);
*pBuf = 0;
pBuf += sizeof(tSirResultCodes);
if( CSR_IS_CONN_WDS_STA(&pSession->connectedProfile) )
{
palCopyMemory( pMac->hHdd, pBuf,(tANI_U8 *)&pSession->selfMacAddr, sizeof(tSirMacAddr) );
}
else
{
palCopyMemory( pMac->hHdd, pBuf,(tANI_U8 *)&pSession->connectedProfile.bssid, sizeof(tSirMacAddr) );
}
pBuf += sizeof(tSirMacAddr);
msgLen = sizeof(tANI_U16) + sizeof(tANI_U16) + 1 + sizeof(tANI_U16) + sizeof(tSirResultCodes) + sizeof(tSirMacAddr);
pMsg->length = pal_cpu_to_be16(msgLen);
status = palSendMBMessage( pMac->hHdd, pMsg );
#if 0
status = palAllocateMemory(pMac, (void **)&pMsg, sizeof(tSirSmeStopBssReq));
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeStopBssReq ));
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->reasonCode = 0;
if( CSR_IS_CONN_WDS_STA(&pSession->connectedProfile) )
{
pbBssid = (tANI_U8 *)&pSession->selfMacAddr;
}
else
{
pbBssid = (tANI_U8 *)&pSession->connectedProfile.bssid;
}
palCopyMemory( pMac->hHdd, &pMsg->bssId, pbBssid, sizeof(tSirMacAddr) );
pMsg->transactionId = 0;
pMsg->sessionId = (tANI_U8)sessionId;
pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeStopBssReq ));
status = palSendMBMessage( pMac->hHdd, pMsg );
#endif
} while( 0 );
return( status );
}
eHalStatus csrReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId,
<API key> *pModProfileFields,
tANI_U32 *pRoamId, v_BOOL_t fForce)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tANI_U32 roamId = 0;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if((<API key>(pMac, sessionId)) &&
(fForce || (!palEqualMemory(pMac->hHdd, &pModProfileFields,
&pSession->connectedProfile.modifyProfileFields,
sizeof(<API key>)))) )
{
roamId = GET_NEXT_ROAM_ID(&pMac->roam);
if(pRoamId)
{
*pRoamId = roamId;
}
status = csrRoamIssueReassoc(pMac, sessionId, NULL, pModProfileFields,
<API key>, roamId,
eANI_BOOLEAN_FALSE);
}
return status;
}
static eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamInfo roamInfo;
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
status = csrRoamCallCallback(pMac, sessionId, &roamInfo, 0,
<API key>, <API key>);
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U8 *pMsg)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tListElem *pEntry = NULL;
tSmeCmd *pCommand = NULL;
<API key> *pRsp;
do
{
if(pMsg == NULL)
{
smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__);
status = eHAL_STATUS_FAILURE;
break;
}
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if(pEntry)
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if(<API key> == pCommand->command)
{
pRsp = (<API key>*)pMsg;
smsLog( pMac, LOG1, "Add Sta rsp status = %d", pRsp->status );
<API key>(pMac, pCommand->sessionId);
if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK))
{
csrReleaseCommand(pMac, pCommand);
}
<API key>( pMac );
}
else
{
smsLog(pMac, LOGE, "in %s <API key> Received but NO Add sta session command are ACTIVE ...",
__func__);
status = eHAL_STATUS_FAILURE;
break;
}
}
else
{
smsLog(pMac, LOGE, "in %s <API key> Received but NO commands are ACTIVE ...",
__func__);
status = eHAL_STATUS_FAILURE;
break;
}
} while(0);
return status;
}
eHalStatus <API key>(tpAniSirGlobal pMac,
<API key> *pAddStaReq)
{
<API key> *pMsg;
tANI_U16 msgLen;
eHalStatus status = eHAL_STATUS_FAILURE;
do {
msgLen = sizeof(<API key>);
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, msgLen);
pMsg->mesgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->mesgLen = pal_cpu_to_be16(msgLen);
palCopyMemory(pMac->hHdd, (tANI_U8 *)pMsg->selfMacAddr,
(tANI_U8 *)&pAddStaReq->selfMacAddr, sizeof(tSirMacAddr));
pMsg->currDeviceMode = pAddStaReq->currDeviceMode;
smsLog( pMac, LOG1, FL("selfMac=%02x, %02x, %02x, %02x, %02x, %02x"),
pMsg->selfMacAddr[0],
pMsg->selfMacAddr[1],
pMsg->selfMacAddr[2],
pMsg->selfMacAddr[3],
pMsg->selfMacAddr[4],
pMsg->selfMacAddr[5]);
status = palSendMBMessage(pMac->hHdd, pMsg);
} while( 0 );
return( status );
}
eHalStatus <API key>(tpAniSirGlobal pMac,
tANI_U32 sessionId,
tSirMacAddr sessionMacAddr)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
pCommand = csrGetCommandBuffer(pMac);
if(NULL == pCommand)
{
status = <API key>;
}
else
{
pCommand->command = <API key>;
pCommand->sessionId = (tANI_U8)sessionId;
palCopyMemory( pMac->hHdd, pCommand->u.addStaSessionCmd.selfMacAddr, sessionMacAddr, sizeof( tSirMacAddr ) );
pCommand->u.addStaSessionCmd.currDeviceMode = pMac->sme.currDeviceMode;
status = csrQueueSmeCommand(pMac, pCommand, TRUE);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
}
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
return <API key>(pMac, &pCommand->u.addStaSessionCmd);
}
eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac,
<API key> callback,
void *pContext, tANI_U8 *pSelfMacAddr,
tANI_U8 *pbSessionId)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 i;
tCsrRoamSession *pSession;
*pbSessionId = <API key>;
for( i = 0; i < <API key>; i++ )
{
if( !<API key>( pMac, i ) )
{
pSession = CSR_GET_SESSION( pMac, i );
status = eHAL_STATUS_SUCCESS;
pSession->sessionActive = eANI_BOOLEAN_TRUE;
pSession->sessionId = (tANI_U8)i;
pSession->callback = callback;
pSession->pContext = pContext;
palCopyMemory( pMac->hHdd, &pSession->selfMacAddr, pSelfMacAddr, sizeof(tCsrBssid) );
*pbSessionId = (tANI_U8)i;
status = vos_timer_init(&pSession->hTimerRoaming, VOS_TIMER_TYPE_SW,
<API key>,
&pSession->roamingTimerInfo);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("cannot allocate memory for Roaming timer"));
break;
}
#ifdef <API key>
status = vos_timer_init(&pSession->hTimerJoinRetry, VOS_TIMER_TYPE_SW,
<API key>,
&pSession->joinRetryTimerInfo);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("cannot allocate memory for joinretry timer"));
break;
}
#endif
pSession->ibssJoinTimerInfo.pMac = pMac;
pSession->ibssJoinTimerInfo.sessionId = <API key>;
status = vos_timer_init(&pSession->hTimerIbssJoining, VOS_TIMER_TYPE_SW,
<API key>,
&pSession->ibssJoinTimerInfo);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("cannot allocate memory for IbssJoining timer"));
break;
}
status = <API key> (pMac, i, pSelfMacAddr);
break;
}
}
if( <API key> == i )
{
status = <API key>;
}
return ( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U8 *pMsg)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tListElem *pEntry = NULL;
tSmeCmd *pCommand = NULL;
<API key> *pRsp;
do
{
if(pMsg == NULL)
{
smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__);
status = eHAL_STATUS_FAILURE;
break;
}
pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
if(pEntry)
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if(<API key> == pCommand->command)
{
tANI_U8 sessionId = pCommand->sessionId;
pRsp = (<API key>*)pMsg;
smsLog( pMac, LOG1, "Del Sta rsp status = %d", pRsp->status );
csrCleanupSession(pMac, sessionId);
if(pCommand->u.delStaSessionCmd.callback)
{
status = <API key>( &pMac->sme );
if ( HAL_STATUS_SUCCESS( status ) )
{
pCommand->u.delStaSessionCmd.callback(
pCommand->u.delStaSessionCmd.pContext);
status = <API key>( &pMac->sme );
if (! HAL_STATUS_SUCCESS( status ) )
{
smsLog(pMac, LOGP, "%s: Failed to Acquire Lock", __func__);
return status;
}
}
else {
smsLog(pMac, LOGE, "%s: Failed to Release Lock", __func__);
}
}
if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK))
{
csrReleaseCommand(pMac, pCommand);
}
<API key>( pMac );
}
else
{
smsLog(pMac, LOGE, "in %s <API key> Received but NO Del sta session command are ACTIVE ...",
__func__);
status = eHAL_STATUS_FAILURE;
break;
}
}
else
{
smsLog(pMac, LOGE, "in %s <API key> Received but NO commands are ACTIVE ...",
__func__);
status = eHAL_STATUS_FAILURE;
break;
}
} while(0);
return status;
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSirMacAddr macAddr )
{
<API key> *pMsg;
tANI_U16 msgLen;
eHalStatus status = eHAL_STATUS_FAILURE;
do {
msgLen = sizeof( tANI_U16 ) + sizeof( tANI_U16 ) + sizeof( tSirMacAddr )
;
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
if ( !HAL_STATUS_SUCCESS(status) ) break;
palZeroMemory(pMac->hHdd, pMsg, msgLen);
pMsg->mesgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->mesgLen = pal_cpu_to_be16(msgLen);
palCopyMemory( pMac->hHdd, (tANI_U8 *)pMsg->selfMacAddr, (tANI_U8 *)macAddr, sizeof(tSirMacAddr) );
status = palSendMBMessage(pMac->hHdd, pMsg);
} while( 0 );
return( status );
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId,
tSirMacAddr sessionMacAddr,
<API key> callback,
void *pContext)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tSmeCmd *pCommand;
pCommand = csrGetCommandBuffer(pMac);
if(NULL == pCommand)
{
status = <API key>;
}
else
{
pCommand->command = <API key>;
pCommand->sessionId = (tANI_U8)sessionId;
pCommand->u.delStaSessionCmd.callback = callback;
pCommand->u.delStaSessionCmd.pContext = pContext;
palCopyMemory( pMac->hHdd, pCommand->u.delStaSessionCmd.selfMacAddr, sessionMacAddr, sizeof( tSirMacAddr ) );
status = csrQueueSmeCommand(pMac, pCommand, TRUE);
if( !HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL(" fail to send message status = %d"), status );
}
}
return (status);
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
return <API key>( pMac,
pCommand->u.delStaSessionCmd.selfMacAddr );
}
static void <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
tDblLinkList *pList = &pMac->roam.roamCmdPendingList;
tListElem *pEntry, *pNext;
tSmeCmd *pCommand;
tDblLinkList localList;
vos_mem_zero(&localList, sizeof(tDblLinkList));
if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList)))
{
smsLog(pMac, LOGE, FL(" failed to open list"));
return;
}
csrLLLock(pList);
pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK);
while(pEntry != NULL)
{
pNext = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK);
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
if(pCommand->sessionId == sessionId)
{
if(csrLLRemoveEntry(pList, pEntry, LL_ACCESS_NOLOCK))
{
csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK);
}
}
pEntry = pNext;
}
csrLLUnlock(pList);
while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) )
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
csrAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE);
}
csrLLClose(&localList);
}
void csrCleanupSession(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
if( <API key>( pMac, sessionId ) )
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
csrRoamStop(pMac, sessionId);
<API key>(pMac, sessionId);
<API key>( pMac, &pSession->connectedProfile );
<API key> ( pMac, &pSession->connectedInfo);
vos_timer_destroy(&pSession->hTimerRoaming);
#ifdef <API key>
vos_timer_destroy(&pSession->hTimerJoinRetry);
#endif
vos_timer_destroy(&pSession->hTimerIbssJoining);
<API key>(pMac, sessionId);
<API key>(pMac, sessionId);
csrInitSession(pMac, sessionId);
}
}
eHalStatus csrRoamCloseSession( tpAniSirGlobal pMac, tANI_U32 sessionId,
tANI_BOOLEAN fSync,
<API key> callback,
void *pContext )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
if( <API key>( pMac, sessionId ) )
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(fSync)
{
csrCleanupSession(pMac, sessionId);
}
else
{
<API key>(pMac, sessionId);
<API key>(pMac, sessionId);
status = <API key>( pMac, sessionId,
pSession->selfMacAddr, callback, pContext);
}
}
else
{
status = <API key>;
}
return ( status );
}
static void csrInitSession( tpAniSirGlobal pMac, tANI_U32 sessionId )
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
pSession->sessionActive = eANI_BOOLEAN_FALSE;
pSession->sessionId = <API key>;
pSession->callback = NULL;
pSession->pContext = NULL;
pSession->ibss_join_pending = FALSE;
pSession->connectState = <API key>;
csrFreeRoamProfile( pMac, sessionId );
<API key>(pMac, &pSession->connectedProfile);
<API key>( pMac, &pSession->connectedInfo );
<API key>(pMac, sessionId);
csrScanEnable(pMac);
palZeroMemory( pMac->hHdd, &pSession->selfMacAddr, sizeof(tCsrBssid) );
if(pSession->pWpaRsnReqIE)
{
palFreeMemory(pMac->hHdd, pSession->pWpaRsnReqIE);
pSession->pWpaRsnReqIE = NULL;
}
pSession->nWpaRsnReqIeLength = 0;
if(pSession->pWpaRsnRspIE)
{
palFreeMemory(pMac->hHdd, pSession->pWpaRsnRspIE);
pSession->pWpaRsnRspIE = NULL;
}
pSession->nWpaRsnRspIeLength = 0;
#ifdef FEATURE_WLAN_WAPI
if(pSession->pWapiReqIE)
{
palFreeMemory(pMac->hHdd, pSession->pWapiReqIE);
pSession->pWapiReqIE = NULL;
}
pSession->nWapiReqIeLength = 0;
if(pSession->pWapiRspIE)
{
palFreeMemory(pMac->hHdd, pSession->pWapiRspIE);
pSession->pWapiRspIE = NULL;
}
pSession->nWapiRspIeLength = 0;
#endif
if (pSession->nAddIEScanLength)
{
memset(pSession->addIEScan, 0 , <API key>);
}
pSession->nAddIEScanLength = 0;
if(pSession->pAddIEAssoc)
{
palFreeMemory(pMac->hHdd, pSession->pAddIEAssoc);
pSession->pAddIEAssoc = NULL;
}
pSession->nAddIEAssocLength = 0;
}
eHalStatus <API key>( tpAniSirGlobal pMac, tCsrBssid *bssid, tANI_U32 *pSessionId )
{
eHalStatus status = eHAL_STATUS_FAILURE;
tANI_U32 i;
for( i = 0; i < <API key>; i++ )
{
if( <API key>( pMac, i ) )
{
if( <API key>( pMac, bssid, &pMac->roam.roamSession[i].connectedProfile.bssid ) )
{
status = eHAL_STATUS_SUCCESS;
*pSessionId = i;
break;
}
}
}
return( status );
}
static tANI_U32 csrFindIbssSession( tpAniSirGlobal pMac )
{
tANI_U32 i, nRet = <API key>;
tCsrRoamSession *pSession;
for( i = 0; i < <API key>; i++ )
{
if( <API key>( pMac, i ) )
{
pSession = CSR_GET_SESSION( pMac, i );
if( pSession->pCurRoamProfile && ( csrIsBssTypeIBSS( pSession->connectedProfile.BSSType ) ) )
{
nRet = i;
break;
}
}
}
return (nRet);
}
static void csrRoamLinkUp(tpAniSirGlobal pMac, tCsrBssid bssid)
{
smsLog(pMac, LOGW, " csrRoamLinkUp: WLAN link UP with AP= %02x-%02x-%02x-%02x-%02x-%02x",
bssid[ 0 ], bssid[ 1 ], bssid[ 2 ],
bssid[ 3 ], bssid[ 4 ], bssid[ 5 ] );
pMac->roam.configParam.vccRssiThreshold =
( 0 == pMac->roam.configParam.vccRssiThreshold ) ?
<API key> : pMac->roam.configParam.vccRssiThreshold;
pMac->roam.vccLinkQuality = <API key>;
pMac->roam.configParam.<API key> =
( 0 == pMac->roam.configParam.<API key> ) ?
<API key> : pMac->roam.configParam.<API key>;
#if defined <API key>
{
tANI_U32 sessionId = 0;
<API key>(pMac, (tCsrBssid *)bssid, &sessionId);
<API key>(pMac, sessionId, VOS_STATUS_SUCCESS);
}
#endif
}
static void csrRoamLinkDown(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
if( <API key> != pSession->connectedProfile.BSSType )
{
return;
}
<API key>(pMac);
pMac->roam.vccLinkQuality = <API key>;
#if defined <API key>
<API key>(pMac, sessionId);
#endif
if(!<API key>(SLM_SESSIONIZATION) &&
csrIsInfraApStarted( pMac ) &&
pMac->roam.configParam.doBMPSWorkaround)
{
pMac->roam.configParam.doBMPSWorkaround = 0;
}
}
void <API key>(void *pv)
{
tpAniSirGlobal pMac = PMAC_STRUCT( pv );
eHalStatus status;
pMac->roam.tlStatsReqInfo.timerRunning = FALSE;
smsLog(pMac, LOG1, FL(" TL stat timer is no-op. It needs to support multiple stations"));
#if 0
if(<API key>(pMac->roam.gVosContext, &tlStats, pMac->roam.connectedInfo.staId))
{
smsLog(pMac, LOGE, FL("<API key>:couldn't get the stats from TL"));
}
else
{
<API key>(pMac, tlStats);
}
#endif
if(!pMac->roam.tlStatsReqInfo.timerRunning)
{
if(pMac->roam.tlStatsReqInfo.periodicity)
{
status = vos_timer_start(&pMac->roam.tlStatsReqInfo.hTlStatsTimer,
pMac->roam.tlStatsReqInfo.periodicity);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("<API key>:cannot start TlStatsTimer timer"));
return;
}
pMac->roam.tlStatsReqInfo.timerRunning = TRUE;
}
}
}
void <API key>(void *pv)
{
tCsrPeStatsReqInfo *<API key> = (tCsrPeStatsReqInfo *)pv;
eHalStatus status;
tpAniSirGlobal pMac = <API key>->pMac;
VOS_STATUS vosStatus;
tPmcPowerState powerState;
<API key>->timerRunning = FALSE;
if( <API key>->timerStopFailed == TRUE )
{
vosStatus = vos_timer_destroy( &<API key>->hPeStatsTimer );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("<API key>:failed to destroy hPeStatsTimer timer"));
}
vos_mem_free(<API key>);
<API key> = NULL;
}
else
{
if(!<API key>->rspPending)
{
status = <API key>(pMac, <API key>->statsMask & ~(1 << <API key>),
<API key>->staId);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("<API key>:failed to send down stats req to PE"));
}
else
{
<API key>->rspPending = TRUE;
}
}
if(<API key>->periodicity &&
(<API key> == <API key>(&<API key>->hPeStatsTimer)))
{
pmcQueryPowerState(pMac, &powerState, NULL, NULL);
if(ePMC_FULL_POWER == powerState)
{
if(<API key>->periodicity < pMac->roam.configParam.statsReqPeriodicity)
{
<API key>->periodicity = pMac->roam.configParam.statsReqPeriodicity;
}
}
else
{
if(<API key>->periodicity < pMac->roam.configParam.<API key>)
{
<API key>->periodicity = pMac->roam.configParam.<API key>;
}
}
vosStatus = vos_timer_start( &<API key>->hPeStatsTimer, <API key>->periodicity );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("<API key>:cannot start hPeStatsTimer timer"));
return;
}
<API key>->timerRunning = TRUE;
}
}
}
void <API key>(void *pv)
{
<API key> *pStaEntry = (<API key> *)pv;
if(<API key> == <API key>(&pStaEntry->timer))
{
#if 0
vosStatus = vos_timer_start( &pStaEntry->timer, pStaEntry->periodicity );
if ( !<API key>( vosStatus ) )
{
smsLog(pStaEntry->pMac, LOGE, FL("csrGetStatistics:cannot start StatsClient timer"));
}
#endif
}
#if 0
<API key>(pStaEntry->pMac, pStaEntry->statsMask, pStaEntry->callback,
pStaEntry->staId, pStaEntry->pContext);
#endif
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 statsMask, tANI_U8 staId)
{
tAniGetPEStatsReq *pMsg;
eHalStatus status = eHAL_STATUS_SUCCESS;
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof(tAniGetPEStatsReq));
if ( !HAL_STATUS_SUCCESS(status) )
{
smsLog(pMac, LOG1, " <API key>: failed to allocate mem for stats req ");
return status;
}
pMsg->msgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->msgLen = (tANI_U16)sizeof(tAniGetPEStatsReq);
pMsg->staId = staId;
pMsg->statsMask = statsMask;
status = palSendMBMessage(pMac->hHdd, pMsg );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOG1, " <API key>: failed to send down the stats req ");
}
return status;
}
void <API key>(tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg)
{
tAniGetPEStatsRsp *pSmeStatsRsp;
eHalStatus status = eHAL_STATUS_FAILURE;
tListElem *pEntry = NULL;
<API key> *pTempStaEntry = NULL;
tCsrPeStatsReqInfo *pPeStaEntry = NULL;
tANI_U32 tempMask = 0;
tANI_U8 counter = 0;
tANI_U8 *pStats = NULL;
tANI_U32 length = 0;
v_PVOID_t pvosGCtx;
v_S7_t rssi = 0, snr = 0;
tANI_U32 *pRssi = NULL, *pSnr = NULL;
tANI_U32 linkCapacity;
pSmeStatsRsp = (tAniGetPEStatsRsp *)pSirMsg;
if(pSmeStatsRsp->rc)
{
smsLog( pMac, LOGW, FL("<API key>:stats rsp from PE shows failure"));
goto post_update;
}
tempMask = pSmeStatsRsp->statsMask;
pStats = ((tANI_U8 *)&pSmeStatsRsp->statsMask) + sizeof(pSmeStatsRsp->statsMask);
length = pSmeStatsRsp->msgLen - sizeof(tAniGetPEStatsRsp);
while(tempMask)
{
if(tempMask & 1)
{
switch(counter)
{
case eCsrSummaryStats:
smsLog( pMac, LOG2, FL("<API key>:summary stats"));
status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.summaryStatsInfo,
pStats, sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGW, FL("<API key>:failed to copy summary stats"));
}
pStats += sizeof(<API key>);
length -= sizeof(<API key>);
break;
case <API key>:
smsLog( pMac, LOG2, FL("<API key>:ClassA stats"));
status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.classAStatsInfo,
pStats, sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGW, FL("<API key>:failed to copy ClassA stats"));
}
pStats += sizeof(<API key>);
length -= sizeof(<API key>);
break;
case <API key>:
smsLog( pMac, LOG2, FL("<API key>:ClassB stats"));
status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.classBStatsInfo,
pStats, sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGW, FL("<API key>:failed to copy ClassB stats"));
}
pStats += sizeof(<API key>);
length -= sizeof(<API key>);
break;
case <API key>:
smsLog( pMac, LOG2, FL("<API key>:ClassC stats"));
status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.classCStatsInfo,
pStats, sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGW, FL("<API key>:failed to copy ClassC stats"));
}
pStats += sizeof(<API key>);
length -= sizeof(<API key>);
break;
case eCsrPerStaStats:
smsLog( pMac, LOG2, FL("<API key>:PerSta stats"));
if( CSR_MAX_STA > pSmeStatsRsp->staId )
{
status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.perStaStatsInfo[pSmeStatsRsp->staId],
pStats, sizeof(tCsrPerStaStatsInfo));
}
else
{
status = eHAL_STATUS_FAILURE;
smsLog( pMac, LOGE, FL("<API key>:out bound staId:%d"), pSmeStatsRsp->staId);
VOS_ASSERT( 0 );
}
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOGW, FL("<API key>:failed to copy PerSta stats"));
}
pStats += sizeof(tCsrPerStaStatsInfo);
length -= sizeof(tCsrPerStaStatsInfo);
break;
default:
smsLog( pMac, LOGW, FL("<API key>:unknown stats type"));
break;
}
}
tempMask >>=1;
counter++;
}
pvosGCtx = <API key>(VOS_MODULE_ID_SME, pMac);
if (length != 0)
{
pRssi = (tANI_U32*)pStats;
rssi = (v_S7_t)*pRssi;
pStats += sizeof(tANI_U32);
length -= sizeof(tANI_U32);
}
else
{
rssi = RSSI_HACK_BMPS;
}
WDA_UpdateRssiBmps(pvosGCtx, pSmeStatsRsp->staId, rssi);
if (length != 0)
{
linkCapacity = *(tANI_U32*)pStats;
pStats += sizeof(tANI_U32);
length -= sizeof(tANI_U32);
}
else
{
linkCapacity = 0;
}
<API key>(pvosGCtx, pSmeStatsRsp->staId, linkCapacity);
if (length != 0)
{
pSnr = (tANI_U32*)pStats;
snr = (v_S7_t)*pSnr;
}
else
{
snr = SNR_HACK_BMPS;
}
WDA_UpdateSnrBmps(pvosGCtx, pSmeStatsRsp->staId, snr);
post_update:
pEntry = <API key>(pMac, pSmeStatsRsp->statsMask);
if(pEntry)
{
pPeStaEntry = GET_BASE_ADDR( pEntry, tCsrPeStatsReqInfo, link );
pPeStaEntry->rspPending = FALSE;
}
pEntry = <API key>(pMac, pSmeStatsRsp->statsMask);
if(pEntry)
{
pTempStaEntry = GET_BASE_ADDR( pEntry, <API key>, link );
if(pTempStaEntry->timerExpired)
{
<API key>(pMac, pTempStaEntry->statsMask, pTempStaEntry->callback,
pTempStaEntry->staId, pTempStaEntry->pContext);
<API key>(pMac, pEntry);
pTempStaEntry = NULL;
}
}
}
tListElem * <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask)
{
tListElem *pEntry = NULL;
tCsrPeStatsReqInfo *pTempStaEntry = NULL;
pEntry = csrLLPeekHead( &pMac->roam.peStatsReqList, LL_ACCESS_LOCK );
if(!pEntry)
{
smsLog(pMac, LOG2, "<API key>: List empty, no request to PE");
return NULL;
}
while( pEntry )
{
pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrPeStatsReqInfo, link );
if(pTempStaEntry->statsMask == statsMask)
{
smsLog(pMac, LOG3, "<API key>: match found");
break;
}
pEntry = csrLLNext( &pMac->roam.peStatsReqList, pEntry, LL_ACCESS_NOLOCK );
}
return pEntry;
}
tListElem * <API key>(tpAniSirGlobal pMac, <API key> *pStaEntry,
tANI_BOOLEAN update)
{
tListElem *pEntry;
<API key> *pTempStaEntry;
pEntry = csrLLPeekHead( &pMac->roam.statsClientReqList, LL_ACCESS_LOCK );
if(!pEntry)
{
smsLog(pMac, LOG2, "<API key>: List empty, no request from "
"upper layer client(s)");
return NULL;
}
while( pEntry )
{
pTempStaEntry = GET_BASE_ADDR( pEntry, <API key>, link );
if((pTempStaEntry->requesterId == pStaEntry->requesterId) &&
(pTempStaEntry->statsMask == pStaEntry->statsMask))
{
smsLog(pMac, LOG3, "<API key>: match found");
if(update)
{
pTempStaEntry->periodicity = pStaEntry->periodicity;
pTempStaEntry->callback = pStaEntry->callback;
pTempStaEntry->pContext = pStaEntry->pContext;
}
break;
}
pEntry = csrLLNext( &pMac->roam.statsClientReqList, pEntry, LL_ACCESS_NOLOCK );
}
return pEntry;
}
tListElem * <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask)
{
tListElem *pEntry;
<API key> *pTempStaEntry;
pEntry = csrLLPeekHead( &pMac->roam.statsClientReqList, LL_ACCESS_LOCK );
if(!pEntry)
{
smsLog(pMac, LOG2, "<API key>: List empty, no request from "
"upper layer client(s)");
return NULL;
}
while( pEntry )
{
pTempStaEntry = GET_BASE_ADDR( pEntry, <API key>, link );
if((pTempStaEntry->statsMask & ~(1 << <API key>)) == statsMask)
{
smsLog(pMac, LOG3, "<API key>: match found");
break;
}
pEntry = csrLLNext( &pMac->roam.statsClientReqList, pEntry, LL_ACCESS_NOLOCK );
}
return pEntry;
}
eHalStatus <API key>(tpAniSirGlobal pMac,
<API key> callback,
void *pContext)
{
pMac->roam.linkQualityIndInfo.callback = callback;
pMac->roam.linkQualityIndInfo.context = pContext;
if( NULL == callback )
{
smsLog(pMac, LOGW, "<API key>: indication callback being deregistered");
}
else
{
smsLog(pMac, LOGW, "<API key>: indication callback being registered");
}
return eHAL_STATUS_SUCCESS;
}
void csrRoamVccTrigger(tpAniSirGlobal pMac)
{
<API key> newVccLinkQuality;
tANI_U32 ul_mac_loss = 0;
tANI_U32 <API key>;
<API key> =
pMac->roam.configParam.<API key>;
VOS_ASSERT( <API key> != 0 );
smsLog(pMac, LOGW, "csrRoamVccTrigger: <API key> is %d",
<API key> );
if(<API key> < ul_mac_loss)
{
smsLog(pMac, LOGW, "csrRoamVccTrigger: link quality is POOR ");
newVccLinkQuality = <API key>;
}
else
{
smsLog(pMac, LOGW, "csrRoamVccTrigger: link quality is GOOD");
newVccLinkQuality = <API key>;
}
smsLog(pMac, LOGW, "csrRoamVccTrigger: link qual : *** UL_MAC_LOSS %d *** ",
ul_mac_loss);
if(newVccLinkQuality != pMac->roam.vccLinkQuality)
{
smsLog(pMac, LOGW, "csrRoamVccTrigger: link quality changed: trigger necessary");
if(NULL != pMac->roam.linkQualityIndInfo.callback)
{
smsLog(pMac, LOGW, "csrRoamVccTrigger: link quality indication %d",
newVccLinkQuality );
pMac->roam.linkQualityIndInfo.callback( newVccLinkQuality,
pMac->roam.linkQualityIndInfo.context );
}
}
pMac->roam.vccLinkQuality = newVccLinkQuality;
}
VOS_STATUS <API key>(tHalHandle hHal,
v_U8_t rssiNotification,
void * context)
{
tpAniSirGlobal pMac = PMAC_STRUCT( context );
<API key> newVccLinkQuality;
tANI_U32 sessionId = 0;
VOS_STATUS status = VOS_STATUS_SUCCESS;
smsLog(pMac, LOGW, "<API key>: RSSI trigger threshold is %d",
pMac->roam.configParam.vccRssiThreshold);
if(!<API key>(pMac, sessionId))
{
smsLog(pMac, LOGW, "<API key>: ignoring the indication as we are not connected");
return VOS_STATUS_SUCCESS;
}
if(<API key> == rssiNotification)
{
smsLog(pMac, LOGW, "<API key>: link quality is POOR");
newVccLinkQuality = <API key>;
}
else if(<API key> == rssiNotification)
{
smsLog(pMac, LOGW, "<API key>: link quality is GOOD ");
newVccLinkQuality = <API key>;
}
else
{
smsLog(pMac, LOGW, "<API key>: unknown rssi notification %d", rssiNotification);
newVccLinkQuality = pMac->roam.vccLinkQuality;
VOS_ASSERT(0);
}
if(newVccLinkQuality != pMac->roam.vccLinkQuality)
{
smsLog(pMac, LOGW, "<API key>: link quality changed: trigger necessary");
if(NULL != pMac->roam.linkQualityIndInfo.callback)
{
smsLog(pMac, LOGW, "<API key>: link quality indication %d",
newVccLinkQuality);
pMac->roam.linkQualityIndInfo.callback( newVccLinkQuality,
pMac->roam.linkQualityIndInfo.context );
}
}
pMac->roam.vccLinkQuality = newVccLinkQuality;
return status;
}
<API key> * <API key>( tpAniSirGlobal pMac,
tDblLinkList *pStaList,
<API key> *pStaEntry)
{
<API key> *pNewStaEntry = NULL;
eHalStatus status;
if(NULL == <API key>(pMac, pStaEntry, TRUE))
{
status = palAllocateMemory(pMac->hHdd, (void **)&pNewStaEntry, sizeof(<API key>));
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, "<API key>: couldn't allocate memory for the "
"entry");
return NULL;
}
pNewStaEntry->callback = pStaEntry->callback;
pNewStaEntry->pContext = pStaEntry->pContext;
pNewStaEntry->periodicity = pStaEntry->periodicity;
pNewStaEntry->requesterId = pStaEntry->requesterId;
pNewStaEntry->statsMask = pStaEntry->statsMask;
pNewStaEntry->pPeStaEntry = pStaEntry->pPeStaEntry;
pNewStaEntry->pMac = pStaEntry->pMac;
pNewStaEntry->staId = pStaEntry->staId;
pNewStaEntry->timerExpired = pStaEntry->timerExpired;
csrLLInsertTail( pStaList, &pNewStaEntry->link, LL_ACCESS_LOCK );
}
return pNewStaEntry;
}
tCsrPeStatsReqInfo * <API key>( tpAniSirGlobal pMac,
tDblLinkList *pStaList,
tCsrPeStatsReqInfo *pStaEntry)
{
tCsrPeStatsReqInfo *pNewStaEntry = NULL;
eHalStatus status;
status = palAllocateMemory(pMac->hHdd, (void **)&pNewStaEntry, sizeof(tCsrPeStatsReqInfo));
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGW, "<API key>: couldn't allocate memory for the "
"entry");
return NULL;
}
pNewStaEntry->hPeStatsTimer = pStaEntry->hPeStatsTimer;
pNewStaEntry->numClient = pStaEntry->numClient;
pNewStaEntry->periodicity = pStaEntry->periodicity;
pNewStaEntry->statsMask = pStaEntry->statsMask;
pNewStaEntry->pMac = pStaEntry->pMac;
pNewStaEntry->staId = pStaEntry->staId;
pNewStaEntry->timerRunning = pStaEntry->timerRunning;
pNewStaEntry->rspPending = pStaEntry->rspPending;
csrLLInsertTail( pStaList, &pNewStaEntry->link, LL_ACCESS_LOCK );
return pNewStaEntry;
}
eHalStatus csrGetRssi(tpAniSirGlobal pMac,
tCsrRssiCallback callback,
tANI_U8 staId, tCsrBssid bssId, void *pContext, void* pVosContext)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
vos_msg_t msg;
tANI_U32 sessionId;
tAniGetRssiReq *pMsg;
smsLog(pMac, LOG2, FL("called"));
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof(tAniGetRssiReq));
if ( !HAL_STATUS_SUCCESS(status) )
{
smsLog(pMac, LOGE, " csrGetRssi: failed to allocate mem for req ");
return status;
}
<API key>(pMac, (tCsrBssid *)bssId, &sessionId);
pMsg->msgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->msgLen = (tANI_U16)sizeof(tAniGetRssiReq);
pMsg->sessionId = sessionId;
pMsg->staId = staId;
pMsg->rssiCallback = callback;
pMsg->pDevContext = pContext;
pMsg->pVosContext = pVosContext;
msg.type = <API key>;
msg.bodyptr = pMsg;
msg.reserved = 0;
if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg))
{
smsLog(pMac, LOGE, " csrGetRssi failed to post msg to self ");
palFreeMemory(pMac->hHdd, (void *)pMsg);
status = eHAL_STATUS_FAILURE;
}
smsLog(pMac, LOG2, FL("returned"));
return status;
}
eHalStatus csrGetSnr(tpAniSirGlobal pMac,
tCsrSnrCallback callback,
tANI_U8 staId, tCsrBssid bssId,
void *pContext)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
vos_msg_t msg;
tANI_U32 sessionId;
tAniGetSnrReq *pMsg;
smsLog(pMac, LOG2, FL("called"));
pMsg =(tAniGetSnrReq *)vos_mem_malloc(sizeof(tAniGetSnrReq));
if (NULL == pMsg )
{
smsLog(pMac, LOGE, "%s: failed to allocate mem for req",__func__);
return status;
}
<API key>(pMac, (tCsrBssid *)bssId, &sessionId);
pMsg->msgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->msgLen = (tANI_U16)sizeof(tAniGetSnrReq);
pMsg->sessionId = sessionId;
pMsg->staId = staId;
pMsg->snrCallback = callback;
pMsg->pDevContext = pContext;
msg.type = <API key>;
msg.bodyptr = pMsg;
msg.reserved = 0;
if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg))
{
smsLog(pMac, LOGE, "%s failed to post msg to self", __func__);
vos_mem_free((v_VOID_t *)pMsg);
status = eHAL_STATUS_FAILURE;
}
smsLog(pMac, LOG2, FL("returned"));
return status;
}
#if defined <API key> || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
eHalStatus csrGetRoamRssi(tpAniSirGlobal pMac,
tCsrRssiCallback callback,
tANI_U8 staId, tCsrBssid bssId, void *pContext, void* pVosContext)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tAniGetRssiReq *pMsg;
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof(tAniGetRssiReq));
if ( !HAL_STATUS_SUCCESS(status) )
{
smsLog(pMac, LOGE, " csrGetRoamRssi: failed to allocate mem for req");
return status;
}
pMsg->msgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->msgLen = (tANI_U16)sizeof(tAniGetRssiReq);
pMsg->staId = staId;
pMsg->rssiCallback = callback;
pMsg->pDevContext = pContext;
pMsg->pVosContext = pVosContext;
status = palSendMBMessage(pMac->hHdd, pMsg );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOG1, " csrGetRoamRssi: failed to send down the rssi req");
status = eHAL_STATUS_FAILURE;
}
return status;
}
#endif
#if defined(FEATURE_WLAN_CCX) && defined(<API key>)
eHalStatus csrGetTsmStats(tpAniSirGlobal pMac,
<API key> callback,
tANI_U8 staId,
tCsrBssid bssId,
void *pContext,
void* pVosContext,
tANI_U8 tid)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tAniGetTsmStatsReq *pMsg = NULL;
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof(tAniGetTsmStatsReq));
if ( !HAL_STATUS_SUCCESS(status) )
{
smsLog(pMac, LOGE, "csrGetTsmStats: failed to allocate mem for req");
return status;
}
pMsg->msgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->msgLen = (tANI_U16)sizeof(tAniGetTsmStatsReq);
pMsg->staId = staId;
pMsg->tid = tid;
palCopyMemory(pMac->hHdd, pMsg->bssId, bssId, sizeof(tSirMacAddr));
pMsg->tsmStatsCallback = callback;
pMsg->pDevContext = pContext;
pMsg->pVosContext = pVosContext;
status = palSendMBMessage(pMac->hHdd, pMsg );
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOG1, " csrGetTsmStats: failed to send down the rssi req");
status = eHAL_STATUS_FAILURE;
}
return status;
}
#endif
tANI_U16 csrGetTLSTAState(tpAniSirGlobal pMac, tANI_U8 staId)
{
WLANTL_STAStateType tlSTAState;
tlSTAState = WLANTL_STA_INIT;
if ( !<API key>(WLANTL_GetSTAState(pMac->roam.gVosContext, staId, &tlSTAState)) )
{
smsLog(pMac, LOGE, FL("csrGetTLSTAState:couldn't get the STA state from TL"));
}
return tlSTAState;
}
eHalStatus csrGetStatistics(tpAniSirGlobal pMac, <API key> requesterId,
tANI_U32 statsMask,
tCsrStatsCallback callback,
tANI_U32 periodicity, tANI_BOOLEAN cache,
tANI_U8 staId, void *pContext)
{
<API key> staEntry;
<API key> *pStaEntry = NULL;
tCsrPeStatsReqInfo *pPeStaEntry = NULL;
tListElem *pEntry = NULL;
tANI_BOOLEAN found = FALSE;
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_BOOLEAN insertInClientList = FALSE;
VOS_STATUS vosStatus;
<API key> *pTlStats;
if( <API key>(pMac) )
{
return eHAL_STATUS_FAILURE;
}
if((!statsMask) && (!callback))
{
smsLog(pMac, LOGW, "csrGetStatistics: statsMask & callback empty in the request");
return eHAL_STATUS_FAILURE;
}
staEntry.requesterId = requesterId;
staEntry.statsMask = statsMask;
if((statsMask) && (!callback))
{
pEntry = <API key>(pMac, &staEntry, FALSE);
if(!pEntry)
{
smsLog(pMac, LOGW, "csrGetStatistics: callback is empty in the request & couldn't "
"find any existing request in statsClientReqList");
return eHAL_STATUS_FAILURE;
}
else
{
pStaEntry = GET_BASE_ADDR( pEntry, <API key>, link );
if(NULL != pStaEntry->pPeStaEntry)
{
pStaEntry->pPeStaEntry->numClient
if(!pStaEntry->pPeStaEntry->numClient)
{
<API key>(pMac, pStaEntry->pPeStaEntry);
}
}
pMac->roam.tlStatsReqInfo.numClient
if(!pMac->roam.tlStatsReqInfo.numClient)
{
if(pMac->roam.tlStatsReqInfo.timerRunning)
{
status = vos_timer_stop(&pMac->roam.tlStatsReqInfo.hTlStatsTimer);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("csrGetStatistics:cannot stop TlStatsTimer timer"));
return eHAL_STATUS_FAILURE;
}
}
pMac->roam.tlStatsReqInfo.periodicity = 0;
pMac->roam.tlStatsReqInfo.timerRunning = FALSE;
}
vos_timer_stop( &pStaEntry->timer );
vosStatus = vos_timer_destroy( &pStaEntry->timer );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("csrGetStatistics:failed to destroy Client req timer"));
}
<API key>(pMac, pEntry);
pStaEntry = NULL;
return eHAL_STATUS_SUCCESS;
}
}
if(cache && !periodicity)
{
<API key>(pMac, statsMask, callback, staId, pContext);
}
else
{
staEntry.callback = callback;
staEntry.pContext = pContext;
staEntry.periodicity = periodicity;
staEntry.pPeStaEntry = NULL;
staEntry.staId = staId;
staEntry.pMac = pMac;
staEntry.timerExpired = FALSE;
if(periodicity)
{
if(statsMask & ~(1 << <API key>))
{
pPeStaEntry = <API key>(pMac, statsMask & ~(1 << <API key>),
periodicity, &found, staId);
if(!pPeStaEntry)
{
return eHAL_STATUS_FAILURE;
}
else
{
staEntry.pPeStaEntry = pPeStaEntry;
}
}
if(statsMask & (1 << <API key>))
{
if(cache && pMac->roam.tlStatsReqInfo.numClient)
{
smsLog(pMac, LOGE, FL("csrGetStatistics:Looking for cached stats from TL"));
}
else
{
if(pMac->roam.tlStatsReqInfo.periodicity)
{
pMac->roam.tlStatsReqInfo.periodicity =
CSR_ROAM_MIN(periodicity, pMac->roam.tlStatsReqInfo.periodicity);
}
else
{
pMac->roam.tlStatsReqInfo.periodicity = periodicity;
}
if(pMac->roam.tlStatsReqInfo.periodicity < <API key>)
{
pMac->roam.tlStatsReqInfo.periodicity = <API key>;
}
if(!pMac->roam.tlStatsReqInfo.timerRunning)
{
pTlStats = (<API key> *)vos_mem_malloc(sizeof(<API key>));
if(NULL != pTlStats)
{
if(<API key>(pMac->roam.gVosContext, pTlStats, staId))
{
smsLog(pMac, LOGE, FL("csrGetStatistics:couldn't get the stats from TL"));
}
else
{
<API key>(pMac, pTlStats);
}
vos_mem_free(pTlStats);
pTlStats = NULL;
}
else
{
smsLog(pMac, LOGE, FL("cannot allocate memory for TL stat"));
}
if(pMac->roam.tlStatsReqInfo.periodicity)
{
status = vos_timer_start(&pMac->roam.tlStatsReqInfo.hTlStatsTimer,
pMac->roam.tlStatsReqInfo.periodicity);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("csrGetStatistics:cannot start TlStatsTimer timer"));
return eHAL_STATUS_FAILURE;
}
pMac->roam.tlStatsReqInfo.timerRunning = TRUE;
}
}
}
pMac->roam.tlStatsReqInfo.numClient++;
}
insertInClientList = TRUE;
}
else if(!cache && !periodicity)
{
if(statsMask & ~(1 << <API key>))
{
status = <API key>(pMac, statsMask & ~(1 << <API key>), staId);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("csrGetStatistics:failed to send down stats req to PE"));
}
staEntry.timerExpired = TRUE;
insertInClientList = TRUE;
}
if(statsMask & (1 << <API key>))
{
pTlStats = (<API key> *)vos_mem_malloc(sizeof(<API key>));
if(NULL != pTlStats)
{
if(!<API key>(<API key>(pMac->roam.gVosContext, pTlStats, staId)))
{
smsLog(pMac, LOGE, FL("csrGetStatistics:couldn't get the stats from TL"));
}
else
{
<API key>(pMac, pTlStats);
}
vos_mem_free(pTlStats);
pTlStats = NULL;
}
else
{
smsLog(pMac, LOGE, FL("cannot allocate memory for TL stat"));
}
}
if(!insertInClientList)
{
<API key>(pMac, statsMask, callback, staId, pContext);
}
}
if(insertInClientList)
{
pStaEntry = <API key>(pMac, &pMac->roam.statsClientReqList, &staEntry);
if(!pStaEntry)
{
smsLog(pMac, LOGW, "csrGetStatistics: Failed to insert req in statsClientReqList");
return eHAL_STATUS_FAILURE;
}
pStaEntry->periodicity = periodicity;
if(periodicity)
{
vosStatus = vos_timer_init( &pStaEntry->timer, VOS_TIMER_TYPE_SW,
<API key>, pStaEntry );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("csrGetStatistics:cannot init StatsClient timer"));
return eHAL_STATUS_FAILURE;
}
vosStatus = vos_timer_start( &pStaEntry->timer, periodicity );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("csrGetStatistics:cannot start StatsClient timer"));
return eHAL_STATUS_FAILURE;
}
}
}
}
return eHAL_STATUS_SUCCESS;
}
#ifdef <API key>
static tSirRetStatus
<API key>(tpAniSirGlobal pMac,
tANI_U8* pBD,
tANI_U8 type,
tANI_U8 subType,
tSirMacAddr peerAddr,
tSirMacAddr selfMacAddr)
{
tSirRetStatus statusCode = eSIR_SUCCESS;
tpSirMacMgmtHdr pMacHdr;
pMacHdr = (tpSirMacMgmtHdr) (pBD);
pMacHdr->fc.protVer = <API key>;
pMacHdr->fc.type = type;
pMacHdr->fc.subType = subType;
palCopyMemory( pMac->hHdd,
(tANI_U8 *) pMacHdr->da,
(tANI_U8 *) peerAddr,
sizeof( tSirMacAddr ));
sirCopyMacAddr(pMacHdr->sa,selfMacAddr);
palCopyMemory( pMac->hHdd,
(tANI_U8 *) pMacHdr->bssId,
(tANI_U8 *) peerAddr,
sizeof( tSirMacAddr ));
return statusCode;
}
static tSirRetStatus
<API key>(tpAniSirGlobal pMac,
tANI_U8 nChannelNum,
tANI_U32 dot11mode,
tSirMacAddr selfMacAddr,
tANI_U8 *pFrame,
tANI_U16 *pusLen)
{
tDot11fProbeRequest pr;
tANI_U32 nStatus, nBytes, nPayload;
tSirRetStatus nSirStatus;
tSirMacAddr bssId = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
palZeroMemory( pMac->hHdd, ( tANI_U8* )&pr, sizeof( pr ) );
<API key>( pMac, nChannelNum, &pr.SuppRates,NULL);
if ( <API key> != dot11mode )
{
<API key>( pMac, nChannelNum, &pr.ExtSuppRates );
}
if (IS_DOT11_MODE_HT(dot11mode))
{
<API key>( pMac, NULL, &pr.HTCaps );
}
nStatus = <API key>( pMac, &pr, &nPayload );
if ( DOT11F_FAILED( nStatus ) )
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Failed to calculate the packed size f"
"or a Probe Request (0x%08x).\n", nStatus );
nPayload = sizeof( tDot11fProbeRequest );
}
else if ( DOT11F_WARNED( nStatus ) )
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"There were warnings while calculating"
"the packed size for a Probe Request ("
"0x%08x).\n", nStatus );
}
nBytes = nPayload + sizeof( tSirMacMgmtHdr );
palZeroMemory( pMac->hHdd, pFrame, nBytes );
nSirStatus = <API key>( pMac, pFrame, SIR_MAC_MGMT_FRAME,
<API key>, bssId,selfMacAddr);
if ( eSIR_SUCCESS != nSirStatus )
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Failed to populate the buffer descriptor for a Probe Request (%d).\n",
nSirStatus );
return nSirStatus;
}
nStatus = <API key>( pMac, &pr, pFrame +
sizeof( tSirMacMgmtHdr ),
nPayload, &nPayload );
if ( DOT11F_FAILED( nStatus ) )
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Failed to pack a Probe Request (0x%08x).\n", nStatus );
return eSIR_FAILURE;
}
else if ( DOT11F_WARNED( nStatus ) )
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"There were warnings while packing a Probe Request (0x%08x).\n" );
}
*pusLen = nPayload + sizeof(tSirMacMgmtHdr);
return eSIR_SUCCESS;
}
eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reason)
{
vos_msg_t msg;
<API key> *pRequestBuf;
<API key> pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
tCsrRoamSession *pSession;
tANI_U8 i,num_channels = 0, ucDot11Mode;
tANI_U8 *ChannelList = NULL;
tANI_U32 sessionId;
eHalStatus status = eHAL_STATUS_SUCCESS;
tpCsrChannelInfo currChannelListInfo;
tANI_U32 host_channels = 0;
tSirBssDescription *pBssDesc = NULL;
tDot11fBeaconIEs *pIes = NULL;
tANI_U8 minRate = 0, dataRate;
tANI_U8 operationChannel;
eCsrBand eBand;
currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.<API key>;
if (0 == <API key>(pMac))
{
smsLog( pMac, LOGE,"<API key> not set");
return eHAL_STATUS_FAILURE;
}
if ((VOS_TRUE == <API key>) && (<API key> == command))
{
smsLog( pMac, LOGE,"Roam Scan Offload is already started");
return eHAL_STATUS_FAILURE;
}
status = <API key>(pMac,
(tCsrBssid *)pNeighborRoamInfo->currAPbssid,
&sessionId);
if ((pMac->roam.neighborRoamInfo.neighborRoamState == <API key>) &&
(command != <API key>))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "Scan Command not sent to FW with state = %d and cmd = %d\n",
pMac->roam.neighborRoamInfo.neighborRoamState, command);
return eHAL_STATUS_FAILURE;
}
if ( !HAL_STATUS_SUCCESS( status ) )
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "%s: Not able to find the sessionId for Roam Offload scan request", __func__);
return eHAL_STATUS_FAILURE;
}
pSession = CSR_GET_SESSION( pMac, sessionId );
pBssDesc = pSession->pConnectBssDesc;
if (pBssDesc == NULL)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "%s: pBssDesc not found for current session", __func__);
return eHAL_STATUS_FAILURE;
}
pRequestBuf = vos_mem_malloc(sizeof(<API key>));
if (NULL == pRequestBuf)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "%s: Not able to allocate memory for Roam Offload scan request", __func__);
return <API key>;
}
vos_mem_zero(pRequestBuf,sizeof(<API key>));
pRequestBuf->Command = command;
if(command == <API key>)
{
pRequestBuf-><API key> = 0;
goto <API key>;
}
else
pRequestBuf-><API key> = pMac->roam.configParam.<API key>;
vos_mem_copy(pRequestBuf->ConnectedNetwork.currAPbssid,
pNeighborRoamInfo->currAPbssid,
sizeof(tCsrBssid));
pRequestBuf->ConnectedNetwork.ssId.length =
pMac->roam.roamSession[sessionId].connectedProfile.SSID.length;
vos_mem_copy(pRequestBuf->ConnectedNetwork.ssId.ssId,
pMac->roam.roamSession[sessionId].connectedProfile.SSID.ssId,
pRequestBuf->ConnectedNetwork.ssId.length);
pRequestBuf->ConnectedNetwork.authentication =
pMac->roam.roamSession[sessionId].connectedProfile.AuthType;
pRequestBuf->ConnectedNetwork.encryption =
pMac->roam.roamSession[sessionId].connectedProfile.EncryptionType;
pRequestBuf->ConnectedNetwork.mcencryption =
pMac->roam.roamSession[sessionId].connectedProfile.mcEncryptionType;
if (pNeighborRoamInfo->cfgParams.<API key>)
{
pRequestBuf->LookupThreshold =
(v_S7_t)pNeighborRoamInfo->cfgParams.<API key> * (-1);
pRequestBuf-><API key> = <API key>;
}
else
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "Calculate Adaptive Threshold");
operationChannel = pSession->connectedProfile.operationChannel;
if (!HAL_STATUS_SUCCESS(<API key>(pMac, pBssDesc, &pIes)))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"%s: <API key> failed", __func__);
vos_mem_free(pRequestBuf);
return eHAL_STATUS_FAILURE;
}
if (pIes->SuppRates.present)
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "Number \t Rate");
for (i = 0; i < pIes->SuppRates.num_rates; i++)
{
if (<API key>(pMac, pIes->SuppRates.rates[i])
&& (pIes->SuppRates.rates[i] & 0x80))
{
dataRate = (pIes->SuppRates.rates[i] & 0x7F)/2;
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "%d \t\t %d", i, dataRate);
if (minRate == 0)
minRate = dataRate;
else
minRate = (minRate < dataRate) ? minRate:dataRate;
}
}
if (pIes->ExtSuppRates.present)
{
for (i = 0; i < pIes->ExtSuppRates.num_rates; i++)
{
if (<API key>(pMac, pIes->ExtSuppRates.rates[i])
&& (pIes->ExtSuppRates.rates[i] & 0x80))
{
dataRate = (pIes->ExtSuppRates.rates[i] & 0x7F)/2;
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "%d \t\t %d", i, dataRate);
if (minRate == 0)
minRate = dataRate;
else
minRate = (minRate < dataRate) ? minRate:dataRate;
}
}
}
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "MinRate = %d", minRate);
}
else
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"%s: Supp Rates not present in pIes", __func__);
vos_mem_free(pRequestBuf);
return eHAL_STATUS_FAILURE;
}
if (NULL != pIes)
{
vos_mem_free(pIes);
pIes = NULL;
}
switch (minRate)
{
case 1:
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
break;
case 2:
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
break;
case 5:
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
break;
case 6:
if (<API key>(operationChannel))
{
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
}
else
{
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
}
break;
case 11:
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
break;
case 12:
if (<API key>(operationChannel))
{
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
}
else
{
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
}
break;
case 24:
if (<API key>(operationChannel))
{
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
}
else
{
pRequestBuf-><API key> = <API key>;
pRequestBuf->LookupThreshold = <API key>;
}
break;
default:
pRequestBuf->LookupThreshold = <API key>;
pRequestBuf-><API key> = <API key>;
break;
}
}
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Chnl=%d,MinRate=%d,RxSenThr=%d,LookupThr=%d",
operationChannel, minRate,
pRequestBuf-><API key>,
pRequestBuf->LookupThreshold);
pRequestBuf->RoamRssiDiff =
pMac->roam.configParam.RoamRssiDiff;
pRequestBuf->StartScanReason = reason;
pRequestBuf-><API key> =
pNeighborRoamInfo->cfgParams.neighborScanPeriod;
pRequestBuf-><API key> =
pNeighborRoamInfo->cfgParams.<API key>;
pRequestBuf-><API key> =
pNeighborRoamInfo->cfgParams.minChannelScanTime;
pRequestBuf-><API key> =
pNeighborRoamInfo->cfgParams.maxChannelScanTime;
pRequestBuf-><API key> =
pNeighborRoamInfo->cfgParams.<API key>;
pRequestBuf->MAWCEnabled =
pMac->roam.configParam.MAWCEnabled;
#ifdef FEATURE_WLAN_CCX
pRequestBuf->IsCCXEnabled = pMac->roam.configParam.<API key>;
#endif
if (
#ifdef FEATURE_WLAN_CCX
((pNeighborRoamInfo->isCCXAssoc) &&
(pNeighborRoamInfo->roamChannelInfo.<API key> ==
eANI_BOOLEAN_FALSE)) ||
(pNeighborRoamInfo->isCCXAssoc == eANI_BOOLEAN_FALSE) ||
#endif
currChannelListInfo->numOfChannels == 0)
{
if (pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels)
{
ChannelList = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList;
eBand = pMac->roam.configParam.bandCapability;
if ((eCSR_BAND_24 != eBand) && (eCSR_BAND_5G != eBand) && (eCSR_BAND_ALL != eBand))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"Invalid band, No operation carried out (Band %d)", eBand);
vos_mem_free(pRequestBuf);
return eHAL_STATUS_FAILURE;
}
for (i=0; i<pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++)
{
if(((eCSR_BAND_24 == eBand) && <API key>(*ChannelList)) ||
((eCSR_BAND_5G == eBand) && CSR_IS_CHANNEL_5GHZ(*ChannelList)) ||
(eCSR_BAND_ALL == eBand))
{
if(!CSR_IS_CHANNEL_DFS(*ChannelList) &&
<API key>(pMac, *ChannelList) &&
*ChannelList && (num_channels < <API key>))
{
pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList;
}
}
ChannelList++;
}
pRequestBuf->ConnectedNetwork.ChannelCount = num_channels;
pRequestBuf->ChannelCacheType = CHANNEL_LIST_STATIC;
}
else
{
ChannelList = pMac->scan.occupiedChannels.channelList;
for(i=0; i<pMac->scan.occupiedChannels.numChannels; i++)
{
if(!CSR_IS_CHANNEL_DFS(*ChannelList) &&
*ChannelList && (num_channels < <API key>))
{
pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList;
}
ChannelList++;
}
pRequestBuf->ConnectedNetwork.ChannelCount = num_channels;
if (reason == <API key>)
pRequestBuf->ChannelCacheType = <API key>;
else {
if (<API key>(pMac))
pRequestBuf->ChannelCacheType = <API key>;
else
pRequestBuf->ChannelCacheType = <API key>;
}
}
}
#ifdef FEATURE_WLAN_CCX
else
{
if (currChannelListInfo->numOfChannels != 0)
{
ChannelList = currChannelListInfo->ChannelList;
for (i=0;i<currChannelListInfo->numOfChannels;i++)
{
if(!CSR_IS_CHANNEL_DFS(*ChannelList) && *ChannelList)
{
pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList;
}
ChannelList++;
}
pRequestBuf->ConnectedNetwork.ChannelCount = num_channels;
pRequestBuf->ChannelCacheType = CHANNEL_LIST_STATIC;
}
}
#endif
num_channels = 0;
ChannelList = NULL;
host_channels = sizeof(pMac->roam.validChannelList);
if (HAL_STATUS_SUCCESS(<API key>(pMac, pMac->roam.validChannelList, &host_channels)))
{
ChannelList = pMac->roam.validChannelList;
pMac->roam.numValidChannels = host_channels;
}
else
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,
"%s:Failed to get the valid channel list", __func__);
vos_mem_free(pRequestBuf);
return eHAL_STATUS_FAILURE;
}
for(i=0; i<pMac->roam.numValidChannels; i++)
{
if(!CSR_IS_CHANNEL_DFS(*ChannelList) && *ChannelList)
{
pRequestBuf->ValidChannelList[num_channels++] = *ChannelList;
}
ChannelList++;
}
pRequestBuf->ValidChannelCount = num_channels;
pRequestBuf->MDID.mdiePresent =
pMac->roam.roamSession[sessionId].connectedProfile.MDID.mdiePresent;
pRequestBuf->MDID.mobilityDomain =
pMac->roam.roamSession[sessionId].connectedProfile.MDID.mobilityDomain;
pRequestBuf->nProbes = pMac->roam.configParam.nProbes;
pRequestBuf->HomeAwayTime = pMac->roam.configParam.<API key>;
if (pRequestBuf->HomeAwayTime < (pRequestBuf-><API key> + (2 * <API key>)))
{
VOS_TRACE( VOS_MODULE_ID_SME, <API key>,
"%s: Invalid config, Home away time(%d) is less than (twice RF switching time + channel max time)(%d)"
" Hence enforcing home away time to disable (0)",
__func__, pRequestBuf->HomeAwayTime,
(pRequestBuf-><API key> + (2 * <API key>)));
pRequestBuf->HomeAwayTime = 0;
}
VOS_TRACE(VOS_MODULE_ID_SME, <API key>,"HomeAwayTime:%d",pRequestBuf->HomeAwayTime);
ucDot11Mode = (tANI_U8) <API key>(pMac,
csrFindBestPhyMode( pMac, pMac->roam.configParam.phyMode ));
<API key>(pMac,<API key>, ucDot11Mode, pSession->selfMacAddr,
pRequestBuf->p24GProbeTemplate, &pRequestBuf-><API key>);
<API key>(pMac,<API key>, ucDot11Mode, pSession->selfMacAddr,
pRequestBuf->p5GProbeTemplate, &pRequestBuf-><API key>);
<API key>:
msg.type = <API key>;
msg.reserved = 0;
msg.bodyptr = pRequestBuf;
if (!<API key>(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)))
{
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "%s: Not able to post <API key> message to WDA", __func__);
vos_mem_free(pRequestBuf);
return eHAL_STATUS_FAILURE;
}
else
{
if (<API key> == command)
<API key> = VOS_TRUE;
else if (<API key> == command)
<API key> = VOS_FALSE;
}
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "Roam Scan Offload Command %d, Reason %d", command, reason);
return status;
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U8 reason)
{
switch(reason)
{
case 0:
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "Rsp for Roam Scan Offload with failure status");
break;
case <API key>:
<API key>(pMac);
break;
default:
VOS_TRACE(VOS_MODULE_ID_SME, <API key>, "Rsp for Roam Scan Offload with reason %d", reason);
}
return eHAL_STATUS_SUCCESS;
}
#endif
tCsrPeStatsReqInfo * <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask,
tANI_U32 periodicity, tANI_BOOLEAN *pFound, tANI_U8 staId)
{
tANI_BOOLEAN found = FALSE;
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrPeStatsReqInfo staEntry;
tCsrPeStatsReqInfo *pTempStaEntry = NULL;
tListElem *pStaEntry = NULL;
VOS_STATUS vosStatus;
tPmcPowerState powerState;
*pFound = FALSE;
pStaEntry = <API key>(pMac, statsMask);
if(pStaEntry)
{
pTempStaEntry = GET_BASE_ADDR( pStaEntry, tCsrPeStatsReqInfo, link );
if(pTempStaEntry->periodicity)
{
pTempStaEntry->periodicity =
CSR_ROAM_MIN(periodicity, pTempStaEntry->periodicity);
}
else
{
pTempStaEntry->periodicity = periodicity;
}
pTempStaEntry->numClient++;
found = TRUE;
}
else
{
palZeroMemory(pMac->hHdd, &staEntry, sizeof(tCsrPeStatsReqInfo));
staEntry.numClient = 1;
staEntry.periodicity = periodicity;
staEntry.pMac = pMac;
staEntry.rspPending = FALSE;
staEntry.staId = staId;
staEntry.statsMask = statsMask;
staEntry.timerRunning = FALSE;
pTempStaEntry = <API key>(pMac, &pMac->roam.peStatsReqList, &staEntry);
if(!pTempStaEntry)
{
smsLog(pMac, LOGW, "<API key>: Failed to insert req in peStatsReqList");
return NULL;
}
}
pmcQueryPowerState(pMac, &powerState, NULL, NULL);
if(ePMC_FULL_POWER == powerState)
{
if(pTempStaEntry->periodicity < pMac->roam.configParam.statsReqPeriodicity)
{
pTempStaEntry->periodicity = pMac->roam.configParam.statsReqPeriodicity;
}
}
else
{
if(pTempStaEntry->periodicity < pMac->roam.configParam.<API key>)
{
pTempStaEntry->periodicity = pMac->roam.configParam.<API key>;
}
}
if(!pTempStaEntry->timerRunning)
{
if(!pTempStaEntry->rspPending &&
!pTempStaEntry->periodicity)
{
status = <API key>(pMac, statsMask & ~(1 << <API key>), staId);
if(!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("<API key>:failed to send down stats req to PE"));
}
else
{
pTempStaEntry->rspPending = TRUE;
}
}
if(pTempStaEntry->periodicity)
{
if(!found)
{
vosStatus = vos_timer_init( &pTempStaEntry->hPeStatsTimer, VOS_TIMER_TYPE_SW,
<API key>, pTempStaEntry );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("<API key>:cannot init hPeStatsTimer timer"));
return NULL;
}
}
smsLog(pMac, LOG1, "<API key>:peStatsTimer period %d", pTempStaEntry->periodicity);
vosStatus = vos_timer_start( &pTempStaEntry->hPeStatsTimer, pTempStaEntry->periodicity );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("<API key>:cannot start hPeStatsTimer timer"));
return NULL;
}
pTempStaEntry->timerRunning = TRUE;
}
}
*pFound = found;
return pTempStaEntry;
}
static void <API key>(tpAniSirGlobal pMac, tListElem *pEntry)
{
if(pEntry)
{
if(csrLLRemoveEntry(&pMac->roam.statsClientReqList, pEntry, LL_ACCESS_LOCK))
{
palFreeMemory(pMac->hHdd, GET_BASE_ADDR( pEntry, <API key>, link ));
}
}
}
void <API key>(tpAniSirGlobal pMac, tCsrPeStatsReqInfo *pPeStaEntry)
{
tListElem *pEntry;
tCsrPeStatsReqInfo *pTempStaEntry;
VOS_STATUS vosStatus;
pEntry = csrLLPeekHead( &pMac->roam.peStatsReqList, LL_ACCESS_LOCK );
if(!pEntry)
{
smsLog(pMac, LOGW, "<API key>: List empty, no stats req for PE");
return;
}
while( pEntry )
{
pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrPeStatsReqInfo, link );
if( pTempStaEntry && pTempStaEntry->statsMask == pPeStaEntry->statsMask)
{
smsLog(pMac, LOGW, "<API key>: match found");
if(pTempStaEntry->timerRunning)
{
vosStatus = vos_timer_stop( &pTempStaEntry->hPeStatsTimer );
if ( vosStatus == VOS_STATUS_SUCCESS )
{
pTempStaEntry->timerRunning = FALSE;
vosStatus = vos_timer_destroy( &pTempStaEntry->hPeStatsTimer );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("<API key>:failed to destroy hPeStatsTimer timer"));
}
}
else
{
pTempStaEntry->timerStopFailed = TRUE;
}
}
if(csrLLRemoveEntry(&pMac->roam.peStatsReqList, pEntry, LL_ACCESS_LOCK))
{
if(!pTempStaEntry->timerStopFailed)
{
palFreeMemory(pMac->hHdd, pTempStaEntry);
pTempStaEntry = NULL;
}
break;
}
pEntry = csrLLNext( &pMac->roam.peStatsReqList, pEntry, LL_ACCESS_NOLOCK );
}
}
return;
}
void <API key>(tpAniSirGlobal pMac, <API key> *pTlStats)
{
pMac->roam.classDStatsInfo.num_rx_bytes_crc_ok = pTlStats->rxBcntCRCok;
pMac->roam.classDStatsInfo.rx_bc_byte_cnt = pTlStats->rxBCBcnt;
pMac->roam.classDStatsInfo.rx_bc_frm_cnt = pTlStats->rxBCFcnt;
pMac->roam.classDStatsInfo.rx_byte_cnt = pTlStats->rxBcnt;
pMac->roam.classDStatsInfo.rx_mc_byte_cnt = pTlStats->rxMCBcnt;
pMac->roam.classDStatsInfo.rx_mc_frm_cnt = pTlStats->rxMCFcnt;
pMac->roam.classDStatsInfo.rx_rate = pTlStats->rxRate;
pMac->roam.classDStatsInfo.rx_uc_byte_cnt[0] = pTlStats->rxUCBcnt;
pMac->roam.classDStatsInfo.rx_uc_frm_cnt = pTlStats->rxUCFcnt;
pMac->roam.classDStatsInfo.tx_bc_byte_cnt = pTlStats->txBCBcnt;
pMac->roam.classDStatsInfo.tx_bc_frm_cnt = pTlStats->txBCFcnt;
pMac->roam.classDStatsInfo.tx_mc_byte_cnt = pTlStats->txMCBcnt;
pMac->roam.classDStatsInfo.tx_mc_frm_cnt = pTlStats->txMCFcnt;
pMac->roam.classDStatsInfo.tx_uc_byte_cnt[0] = pTlStats->txUCBcnt;
pMac->roam.classDStatsInfo.tx_uc_frm_cnt = pTlStats->txUCFcnt;
}
void <API key>(tpAniSirGlobal pMac, tANI_U32 statsMask,
tCsrStatsCallback callback, tANI_U8 staId, void *pContext)
{
tANI_U8 stats[500];
tANI_U8 *pStats = NULL;
tANI_U32 tempMask = 0;
tANI_U8 counter = 0;
eHalStatus status = eHAL_STATUS_FAILURE;
if(!callback)
{
smsLog(pMac, LOGE, FL("<API key>:cannot report callback NULL"));
return;
}
if(!statsMask)
{
smsLog(pMac, LOGE, FL("<API key>:cannot report statsMask is 0"));
return;
}
pStats = stats;
tempMask = statsMask;
while(tempMask)
{
if(tempMask & 1)
{
switch(counter)
{
case eCsrSummaryStats:
smsLog( pMac, LOG2, FL("<API key>:summary stats"));
status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.summaryStatsInfo,
sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOG1, FL("<API key>:failed to copy summary stats"));
}
pStats += sizeof(<API key>);
break;
case <API key>:
smsLog( pMac, LOG2, FL("<API key>:ClassA stats"));
status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classAStatsInfo,
sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOG1, FL("<API key>:failed to copy ClassA stats"));
}
pStats += sizeof(<API key>);
break;
case <API key>:
smsLog( pMac, LOG2, FL("<API key>:ClassB stats"));
status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classBStatsInfo,
sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOG1, FL("<API key>:failed to copy ClassB stats"));
}
pStats += sizeof(<API key>);
break;
case <API key>:
smsLog( pMac, LOG2, FL("<API key>:ClassC stats"));
status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classCStatsInfo,
sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOG1, FL("<API key>:failed to copy ClassC stats"));
}
pStats += sizeof(<API key>);
break;
case <API key>:
smsLog( pMac, LOG2, FL("<API key>:ClassD stats"));
status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classDStatsInfo,
sizeof(<API key>));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOG1, FL("<API key>:failed to copy ClassD stats"));
}
pStats += sizeof(<API key>);
break;
case eCsrPerStaStats:
smsLog( pMac, LOG2, FL("<API key>:PerSta stats"));
status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.perStaStatsInfo[staId],
sizeof(tCsrPerStaStatsInfo));
if(!HAL_STATUS_SUCCESS(status))
{
smsLog( pMac, LOG1, FL("<API key>:failed to copy PerSta stats"));
}
pStats += sizeof(tCsrPerStaStatsInfo);
break;
default:
smsLog( pMac, LOG1, FL("<API key>:unknown stats type"));
break;
}
}
tempMask >>=1;
counter++;
}
callback(stats, pContext );
}
eHalStatus <API key>(tpAniSirGlobal pMac)
{
tListElem *pEntry = NULL;
tListElem *pPrevEntry = NULL;
<API key> *pTempStaEntry = NULL;
eHalStatus status = eHAL_STATUS_SUCCESS;
VOS_STATUS vosStatus;
pEntry = csrLLPeekHead( &pMac->roam.statsClientReqList, LL_ACCESS_LOCK );
if(!pEntry)
{
smsLog(pMac, LOGW, "<API key>: List empty, no request from "
"upper layer client(s)");
return status;
}
while( pEntry )
{
if(pPrevEntry)
{
pTempStaEntry = GET_BASE_ADDR( pPrevEntry, <API key>, link );
<API key>(pMac, pTempStaEntry->statsMask, pTempStaEntry->callback,
pTempStaEntry->staId, pTempStaEntry->pContext);
<API key>(pMac, pPrevEntry);
}
pTempStaEntry = GET_BASE_ADDR( pEntry, <API key>, link );
if (pTempStaEntry->pPeStaEntry)
{
pTempStaEntry->pPeStaEntry->numClient
if(!pTempStaEntry->pPeStaEntry->numClient)
{
<API key>(pMac, pTempStaEntry->pPeStaEntry);
}
}
pMac->roam.tlStatsReqInfo.numClient
if(!pMac->roam.tlStatsReqInfo.numClient)
{
if(pMac->roam.tlStatsReqInfo.timerRunning)
{
status = vos_timer_stop(&pMac->roam.tlStatsReqInfo.hTlStatsTimer);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL("<API key>:cannot stop TlStatsTimer timer"));
}
}
pMac->roam.tlStatsReqInfo.periodicity = 0;
pMac->roam.tlStatsReqInfo.timerRunning = FALSE;
}
if (pTempStaEntry->periodicity)
{
vos_timer_stop( &pTempStaEntry->timer );
vosStatus = vos_timer_destroy( &pTempStaEntry->timer );
if ( !<API key>( vosStatus ) )
{
smsLog(pMac, LOGE, FL("<API key>:failed to destroy Client req timer"));
}
}
pPrevEntry = pEntry;
pEntry = csrLLNext( &pMac->roam.statsClientReqList, pEntry, LL_ACCESS_NOLOCK );
}
if(pPrevEntry)
{
pTempStaEntry = GET_BASE_ADDR( pPrevEntry, <API key>, link );
<API key>(pMac, pTempStaEntry->statsMask, pTempStaEntry->callback,
pTempStaEntry->staId, pTempStaEntry->pContext);
<API key>(pMac, pPrevEntry);
}
return status;
}
eHalStatus <API key>( tpAniSirGlobal pMac, tSmeCmd *pCommand,
<API key> *pReason,
tANI_BOOLEAN *pfNeedPower )
{
tANI_BOOLEAN fNeedFullPower = eANI_BOOLEAN_FALSE;
<API key> reason = eSME_REASON_OTHER;
tPmcState pmcState;
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_U32 sessionId = 0;
if( pfNeedPower )
{
*pfNeedPower = eANI_BOOLEAN_FALSE;
}
if( !(eSmeCsrCommandMask & pCommand->command) )
{
return eHAL_STATUS_SUCCESS;
}
pmcState = pmcGetPmcState( pMac );
switch( pmcState )
{
case REQUEST_IMPS:
case IMPS:
if( eSmeCommandScan == pCommand->command )
{
switch( pCommand->u.scanCmd.reason )
{
#ifdef <API key>
case <API key>:
#endif
case eCsrScanGetResult:
case eCsrScanBGScanAbort:
case <API key>:
case <API key>:
fNeedFullPower = eANI_BOOLEAN_FALSE;
break;
default:
fNeedFullPower = eANI_BOOLEAN_TRUE;
break;
}
}
else
{
fNeedFullPower = eANI_BOOLEAN_TRUE;
}
break;
case REQUEST_BMPS:
case BMPS:
case REQUEST_START_UAPSD:
case UAPSD:
case REQUEST_ENTER_WOWL:
case WOWL:
if( eSmeCommandRoam == pCommand->command )
{
tScanResultList *pBSSList = (tScanResultList *)pCommand->u.roamCmd.hBSSList;
tCsrScanResult *pScanResult;
tListElem *pEntry;
switch ( pCommand->u.roamCmd.roamReason )
{
case eCsrForcedDisassoc:
case <API key>:
reason = <API key>;
fNeedFullPower = eANI_BOOLEAN_TRUE;
break;
case <API key>:
case eCsrForcedDeauth:
case <API key>:
case <API key>:
fNeedFullPower = eANI_BOOLEAN_TRUE;
break;
case eCsrCapsChange:
fNeedFullPower = eANI_BOOLEAN_TRUE;
break;
default:
if ( <API key>(pMac, sessionId) && pBSSList )
{
pEntry = csrLLPeekHead(&pBSSList->List, LL_ACCESS_LOCK);
if( pEntry )
{
pScanResult = GET_BASE_ADDR(pEntry, tCsrScanResult, Link);
#if 0
if( csrIsBssIdEqual( pMac, &pScanResult->Result.BssDescriptor, pMac->roam.pConnectBssDesc ) &&
csrIsSsidEqual( pMac, pMac->roam.pConnectBssDesc,
&pScanResult->Result.BssDescriptor, (tDot11fBeaconIEs *)( pScanResult->Result.pvIes ) ) )
{
if(csrIsSameProfile(pMac, &pMac->roam.connectedProfile, pProfile))
{
if(<API key>(pMac, &pMac->roam.connectedProfile, pProfile))
{
pCommand->u.roamCmd.<API key> = eANI_BOOLEAN_TRUE;
break;
}
}
}
#endif
}
}
fNeedFullPower = eANI_BOOLEAN_TRUE;
break;
}
}
else if( <API key> == pCommand->command )
{
fNeedFullPower = eANI_BOOLEAN_TRUE;
reason = <API key>;
}
#ifdef FEATURE_WLAN_TDLS
else if( <API key> == pCommand->command )
{
fNeedFullPower = eANI_BOOLEAN_TRUE;
reason = <API key>;
}
#endif
break;
case REQUEST_STOP_UAPSD:
case REQUEST_EXIT_WOWL:
if( eSmeCommandRoam == pCommand->command )
{
fNeedFullPower = eANI_BOOLEAN_TRUE;
switch ( pCommand->u.roamCmd.roamReason )
{
case eCsrForcedDisassoc:
case <API key>:
reason = <API key>;
break;
default:
break;
}
}
break;
case STOPPED:
case REQUEST_STANDBY:
case STANDBY:
case LOW_POWER:
smsLog( pMac, LOGE, FL( " cannot process because PMC is in stopped/standby state %d" ), pmcState );
status = eHAL_STATUS_FAILURE;
break;
case FULL_POWER:
case REQUEST_FULL_POWER:
default:
break;
}
if( pReason )
{
*pReason = reason;
}
if( pfNeedPower )
{
*pfNeedPower = fNeedFullPower;
}
return ( status );
}
static eHalStatus csrRequestFullPower( tpAniSirGlobal pMac, tSmeCmd *pCommand )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tANI_BOOLEAN fNeedFullPower = eANI_BOOLEAN_FALSE;
<API key> reason = eSME_REASON_OTHER;
status = <API key>( pMac, pCommand, &reason, &fNeedFullPower );
if( fNeedFullPower && HAL_STATUS_SUCCESS( status ) )
{
status = pmcRequestFullPower(pMac, <API key>, pMac, reason);
}
return ( status );
}
tSmeCmd *csrGetCommandBuffer( tpAniSirGlobal pMac )
{
tSmeCmd *pCmd = smeGetCommandBuffer( pMac );
if( pCmd )
{
pMac->roam.sPendingCommands++;
}
return ( pCmd );
}
void csrReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand)
{
if (pMac->roam.sPendingCommands > 0)
{
pMac->roam.sPendingCommands
smeReleaseCommand( pMac, pCommand );
}
else
{
smsLog(pMac, LOGE, FL( "no pending commands"));
VOS_ASSERT(0);
}
}
eHalStatus csrQueueSmeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fHighPriority )
{
eHalStatus status;
if( (eSmeCommandScan == pCommand->command) && pMac->scan.fDropScanCmd )
{
smsLog(pMac, LOGW, FL(" drop scan (scan reason %d) command"),
pCommand->u.scanCmd.reason);
return <API key>;
}
if ((pMac->fScanOffload) && (pCommand->command == eSmeCommandScan))
{
csrLLInsertTail(&pMac->sme.<API key>,
&pCommand->Link, LL_ACCESS_LOCK);
<API key>(pMac);
status = eHAL_STATUS_SUCCESS;
goto end;
}
status = csrRequestFullPower( pMac, pCommand );
if( HAL_STATUS_SUCCESS( status ) )
{
tANI_BOOLEAN fNoCmdPending;
fNoCmdPending = csrLLIsListEmpty( &pMac->roam.roamCmdPendingList, eANI_BOOLEAN_FALSE );
if( fNoCmdPending )
{
smePushCommand( pMac, pCommand, fHighPriority );
}
else
{
if( !fHighPriority )
{
csrLLInsertTail( &pMac->roam.roamCmdPendingList, &pCommand->Link, eANI_BOOLEAN_FALSE );
}
else {
csrLLInsertHead( &pMac->roam.roamCmdPendingList, &pCommand->Link, eANI_BOOLEAN_FALSE );
}
}
}
else if( <API key> == status )
{
if( !fHighPriority )
{
csrLLInsertTail( &pMac->roam.roamCmdPendingList, &pCommand->Link, eANI_BOOLEAN_FALSE );
}
else {
csrLLInsertHead( &pMac->roam.roamCmdPendingList, &pCommand->Link, eANI_BOOLEAN_FALSE );
}
status = eHAL_STATUS_SUCCESS;
}
else
{
smsLog( pMac, LOGE, FL( " cannot queue command %d" ), pCommand->command );
}
end:
return ( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs* pAPWPSIES )
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> *pMsg;
tANI_U8 *pBuf = NULL, *wTmpBuf = NULL;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (NULL == pSession)
{
smsLog( pMac, LOGE, FL( " Session does not exist for session id %d" ), sessionId);
return eHAL_STATUS_FAILURE;
}
do
{
status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof(<API key>) );
if (!HAL_STATUS_SUCCESS(status)) break;
palZeroMemory( pMac->hHdd, pMsg, sizeof(<API key>) );
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pBuf = (tANI_U8 *)&pMsg->transactionId;
VOS_ASSERT(pBuf);
wTmpBuf = pBuf;
*pBuf = 0;
*( pBuf + 1 ) = 0;
pBuf += sizeof(tANI_U16);
palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, &pSession->selfMacAddr, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
*pBuf++ = (tANI_U8)sessionId;
palCopyMemory( pMac->hHdd, (tSirAPWPSIEs *)pBuf, pAPWPSIES, sizeof(tSirAPWPSIEs));
pBuf += sizeof(tSirAPWPSIEs);
pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32) + (pBuf - wTmpBuf)));
status = palSendMBMessage(pMac->hHdd, pMsg);
} while( 0 );
return ( status );
}
eHalStatus <API key>( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> *pMsg;
tANI_U8 *pBuf = NULL, *wTmpBuf = NULL;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if (NULL == pSession)
{
smsLog( pMac, LOGE, FL( " Session does not exist for session id %d" ), sessionId);
return eHAL_STATUS_FAILURE;
}
do
{
status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof(<API key>) );
if (!HAL_STATUS_SUCCESS(status)) break;
palZeroMemory( pMac->hHdd, pMsg, sizeof( <API key> ) );
pMsg->messageType = pal_cpu_to_be16((tANI_U16)<API key>);
pBuf = (tANI_U8 *)&pMsg->transactionId;
wTmpBuf = pBuf;
*pBuf = 0;
*( pBuf + 1 ) = 0;
pBuf += sizeof(tANI_U16);
VOS_ASSERT(pBuf);
palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, &pSession->selfMacAddr, sizeof(tSirMacAddr) );
pBuf += sizeof(tSirMacAddr);
*pBuf++ = (tANI_U8)sessionId;
palCopyMemory( pMac->hHdd, (tSirRSNie *)pBuf, pAPSirRSNie, sizeof(tSirRSNie));
pBuf += sizeof(tSirRSNie);
pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)));
status = palSendMBMessage(pMac->hHdd, pMsg);
} while( 0 );
return ( status );
}
#ifdef <API key>
eHalStatus <API key>(tHalHandle hHal, tANI_U32 sessionId, tpSirBssDescription pBssDescription)
{
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
tpSirFTPreAuthReq pftPreAuthReq;
tANI_U16 auth_req_len = 0;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
auth_req_len = sizeof(tSirFTPreAuthReq);
pftPreAuthReq = (tpSirFTPreAuthReq)vos_mem_malloc(auth_req_len);
if (pftPreAuthReq == NULL)
{
smsLog(pMac, LOGE, FL("Memory allocation for FT Preauth request failed"));
return <API key>;
}
pMac->ft.ftSmeContext.smeSessionId = sessionId;
vos_mem_zero(pftPreAuthReq, auth_req_len);
pftPreAuthReq->pbssDescription = (tpSirBssDescription)vos_mem_malloc(
sizeof(pBssDescription->length) + pBssDescription->length);
pftPreAuthReq->messageType = pal_cpu_to_be16(<API key>);
pftPreAuthReq->preAuthchannelNum = pBssDescription->channelId;
palCopyMemory(pMac->hHdd, (void *)&pftPreAuthReq->currbssId, (void *)pSession->connectedProfile.bssid, sizeof(tSirMacAddr));
palCopyMemory(pMac->hHdd, (void *)&pftPreAuthReq->preAuthbssId, (void *)pBssDescription->bssId, sizeof(tSirMacAddr));
#ifdef <API key>
if (csrRoamIs11rAssoc(pMac) &&
(pMac->roam.roamSession[sessionId].connectedProfile.AuthType != eCSR_<API key>))
{
pftPreAuthReq->ft_ies_length = (tANI_U16)pMac->ft.ftSmeContext.auth_ft_ies_length;
palCopyMemory(pMac->hHdd, pftPreAuthReq->ft_ies, pMac->ft.ftSmeContext.auth_ft_ies,
pMac->ft.ftSmeContext.auth_ft_ies_length);
}
else
#endif
{
pftPreAuthReq->ft_ies_length = 0;
}
vos_mem_copy(pftPreAuthReq->pbssDescription, pBssDescription,
sizeof(pBssDescription->length) + pBssDescription->length);
pftPreAuthReq->length = pal_cpu_to_be16(auth_req_len);
return palSendMBMessage(pMac->hHdd, pftPreAuthReq);
}
void <API key>( tHalHandle hHal, tpSirFTPreAuthRsp pFTPreAuthRsp )
{
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
eHalStatus status = eHAL_STATUS_SUCCESS;
#if defined(FEATURE_WLAN_LFR) || defined(FEATURE_WLAN_CCX) || defined(<API key>)
tCsrRoamInfo roamInfo;
#endif
#if defined <API key>
smsLog( pMac, LOGE, FL("Preauth response status code 0x%x"), pFTPreAuthRsp->status);
#endif
#ifdef <API key>
status = <API key>(pMac, pFTPreAuthRsp->status);
if (status != eHAL_STATUS_SUCCESS) {
smsLog(pMac, LOGW, FL("Preauth was not processed: %d"), status);
return;
}
#endif
if (VOS_STATUS_SUCCESS != (VOS_STATUS)pFTPreAuthRsp->status)
return;
pMac->ft.ftSmeContext.FTState = eFT_AUTH_COMPLETE;
pMac->ft.ftSmeContext.psavedFTPreAuthRsp = pFTPreAuthRsp;
if (csrRoamIs11rAssoc(pMac))
{
sme_QosCsrEventInd(pMac, pMac->ft.ftSmeContext.smeSessionId, <API key>, NULL);
}
status = vos_timer_start(&pMac->ft.ftSmeContext.pre<API key>,
60);
if (eHAL_STATUS_SUCCESS != status)
{
smsLog(pMac, LOGE, FL("Preauth reassoc interval timer start failed to start with status %d"), status);
return;
}
palCopyMemory(pMac->hHdd, (void *)&pMac->ft.ftSmeContext.preAuthbssId, (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid));
if (csrRoamIs11rAssoc(pMac))
csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, NULL, 0,
<API key>, <API key>);
#if defined(FEATURE_WLAN_CCX) && defined(<API key>)
if (csrRoamIsCCXAssoc(pMac))
{
csrRoamReadTSF(pMac, (tANI_U8 *)roamInfo.timestamp);
palCopyMemory(pMac->hHdd, (void *)&roamInfo.bssid, (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid));
csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, &roamInfo, 0, <API key>, 0);
}
#endif
#ifdef FEATURE_WLAN_LFR
if (<API key>(pMac, <API key>))
{
palCopyMemory(pMac->hHdd, (void *)&roamInfo.bssid, (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid));
csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, &roamInfo, 0, <API key>, 0);
}
#endif
pMac->ft.ftSmeContext.psavedFTPreAuthRsp = NULL;
}
#endif
#ifdef <API key>
void <API key>(void *pv)
{
tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv;
tpAniSirGlobal pMac = pInfo->pMac;
tANI_U32 sessionId = pInfo->sessionId;
tCsrRoamSession *pSession;
if( <API key>(pMac, sessionId) )
{
smsLog( pMac, LOGE, FL( " retrying the last roam profile on session %d" ), sessionId );
pSession = CSR_GET_SESSION( pMac, sessionId );
if(pSession->pCurRoamProfile && <API key>(pMac, sessionId))
{
if( !HAL_STATUS_SUCCESS(<API key>(pMac, sessionId)) )
{
smsLog( pMac, LOGE, FL( " fail to retry the last roam profile" ) );
}
}
}
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval)
{
eHalStatus status = eHAL_STATUS_FAILURE;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
if(pSession->pCurRoamProfile && pSession->maxRetryCount)
{
smsLog(pMac, LOGE, FL(" call sessionId %d retry count %d left"), sessionId, pSession->maxRetryCount);
pSession->maxRetryCount
pSession->joinRetryTimerInfo.pMac = pMac;
pSession->joinRetryTimerInfo.sessionId = (tANI_U8)sessionId;
status = vos_timer_start(&pSession->hTimerJoinRetry, interval/<API key>);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL(" fail to start timer status %s"), status);
}
}
else
{
smsLog(pMac, LOGE, FL(" not to start timer due to no profile or reach mac ret (%d)"),
pSession->maxRetryCount);
}
return (status);
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
smsLog(pMac, LOGE, " <API key>");
if( <API key>(pMac, sessionId) )
{
return (vos_timer_stop(&pMac->roam.roamSession[sessionId].hTimerJoinRetry));
}
return eHAL_STATUS_SUCCESS;
}
#endif
static void <API key>(tANI_U8 *pBuf, tSirSmeDisassocRsp *pRsp)
{
if(pBuf && pRsp)
{
pBuf += 4;
pRsp->sessionId = *pBuf++;
pal_get_U16( pBuf, (tANI_U16 *)&pRsp->transactionId );
pBuf += 2;
pal_get_U32( pBuf, (tANI_U32 *)&pRsp->statusCode );
pBuf += 4;
vos_mem_copy(pRsp->peerMacAddr, pBuf, 6);
}
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U8 *pCountry)
{
static uNvTables nvTables;
eHalStatus status = eHAL_STATUS_SUCCESS;
VOS_STATUS vosStatus = <API key>( &nvTables );
if ( <API key>(vosStatus) )
{
palCopyMemory( pMac->hHdd, pCountry,
nvTables.defaultCountryTable.countryCode,
<API key> );
return status;
}
else
{
palCopyMemory( pMac->hHdd, pCountry,
"XXX",
<API key> );
status = eHAL_STATUS_FAILURE;
return status;
}
}
eHalStatus <API key>(tpAniSirGlobal pMac, tANI_U8 *pCountry)
{
palCopyMemory( pMac->hHdd, pCountry,
pMac->scan.countryCode11d,
<API key> );
return eHAL_STATUS_SUCCESS;
}
eHalStatus csrSetTxPower(tpAniSirGlobal pMac, v_U8_t sessionId, v_U8_t mW)
{
tSirSetTxPowerReq *pMsg = NULL;
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
if (!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof(tSirSetTxPowerReq));
if (HAL_STATUS_SUCCESS(status))
{
palZeroMemory(pMac->hHdd, (void *)pMsg, sizeof(tSirSetTxPowerReq));
pMsg->messageType = <API key>;
pMsg->length = sizeof(tSirSetTxPowerReq);
pMsg->mwPower = mW;
palCopyMemory( pMac->hHdd,
(tSirMacAddr *)pMsg->bssId,
&pSession->selfMacAddr,
sizeof(tSirMacAddr) );
status = palSendMBMessage(pMac->hHdd, pMsg);
if (!HAL_STATUS_SUCCESS(status))
{
smsLog(pMac, LOGE, FL(" csr set TX Power Post MSG Fail %d "), status);
}
}
return status;
}
tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId)
{
tCsrRoamSession *pSession = NULL;
pSession = CSR_GET_SESSION ( pMac, sessionId );
if(!pSession)
{
smsLog(pMac, LOGE, FL(" %s: session %d not found "), __func__, sessionId);
return eANI_BOOLEAN_FALSE;
}
if ( !<API key> ( pMac, sessionId ) )
{
smsLog(pMac, LOGE, FL(" %s: Inactive session"), __func__);
return eANI_BOOLEAN_FALSE;
}
if ( <API key> != pSession->connectedProfile.BSSType )
{
return eANI_BOOLEAN_FALSE;
}
if ( NULL != pSession->pCurRoamProfile )
{
if ( pSession->pCurRoamProfile->csrPersona == VOS_STA_MODE )
{
return eANI_BOOLEAN_TRUE;
} else {
smsLog(pMac, LOGE, FL(" %s: pCurRoamProfile is NULL\n"), __func__);
return eANI_BOOLEAN_FALSE;
}
}
return eANI_BOOLEAN_FALSE;
}
#ifdef <API key>
eHalStatus csrHandoffRequest(tpAniSirGlobal pMac,
tCsrHandoffRequest *pHandoffInfo)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
vos_msg_t msg;
tAniHandoffReq *pMsg;
status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof(tAniHandoffReq));
if ( !HAL_STATUS_SUCCESS(status) )
{
smsLog(pMac, LOGE, " csrHandoffRequest: failed to allocate mem for req ");
return status;
}
pMsg->msgType = pal_cpu_to_be16((tANI_U16)<API key>);
pMsg->msgLen = (tANI_U16)sizeof(tAniHandoffReq);
pMsg->sessionId = pMac->roam.neighborRoamInfo.csrSessionId;
pMsg->channel = pHandoffInfo->channel;
palCopyMemory(pMac->hHdd, pMsg->bssid,
pHandoffInfo->bssid,
6);
msg.type = <API key>;
msg.bodyptr = pMsg;
msg.reserved = 0;
if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg))
{
smsLog(pMac, LOGE, " csrHandoffRequest failed to post msg to self ");
palFreeMemory(pMac->hHdd, (void *)pMsg);
status = eHAL_STATUS_FAILURE;
}
return status;
}
#endif
#if defined(FEATURE_WLAN_CCX) && defined(<API key>)
VOS_STATUS csrSetCCKMIe(tpAniSirGlobal pMac, const tANI_U8 sessionId,
const tANI_U8 *pCckmIe,
const tANI_U8 ccKmIeLen)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId);
if (!pSession)
{
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return eHAL_STATUS_FAILURE;
}
palCopyMemory(pMac->hHdd, pSession->suppCckmIeInfo.cckmIe, pCckmIe, ccKmIeLen);
pSession->suppCckmIeInfo.cckmIeLen = ccKmIeLen;
return status;
}
VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp)
{
eHalStatus status = eHAL_STATUS_SUCCESS;
<API key> handoffNode;
tANI_U32 timer_diff = 0;
tANI_U32 timeStamp[2];
tpSirBssDescription pBssDescription = NULL;
<API key>(pMac, &handoffNode);
pBssDescription = handoffNode.pBssDescription;
timer_diff = <API key>() - pBssDescription->scanSysTimeMsec;
timer_diff = (tANI_U32)(timer_diff * <API key>);
timeStamp[0] = pBssDescription->timeStamp[0];
timeStamp[1] = pBssDescription->timeStamp[1];
UpdateCCKMTSF(&(timeStamp[0]), &(timeStamp[1]), &timer_diff);
palCopyMemory(pMac->hHdd, pTimestamp, (void *) &timeStamp[0],
sizeof (tANI_U32) * 2);
return status;
}
#endif |
<?php
namespace App\Console\Commands\Install\Components;
/**
* Class ComponentHtaccess
*/
class ComponentHtaccess extends ComponentBase implements <API key> {
/**
* Create a new command instance.
*/
public function __construct() {
parent::__construct();
}
/**
* Execute the component.
*
* @return mixed
*/
public function fire() {
if ( $this->filesystem->exists( $this-><API key> . '/htaccess.twig.conf' ) && ! $this->filesystem->exists( $this->public_dir . "/.htaccess" ) ) {
// Render backup template
$output = $this->twig->render(
'htaccess.twig.conf',
array(
'auth' => $this->config->basicauth->status,
'auth_file' => $this->home_dir . '/.htpasswd',
)
);
// Write file
$this->filesystem->put( $this->public_dir . "/.htaccess", $output );
// Unset temp var
unset( $output );
}
}
} |
#ifndef lauxlib_h
#define lauxlib_h
#include <stddef.h>
#include <stdio.h>
#include "lua.h"
/* extra error code for `luaL_load' */
#define LUA_ERRFILE (LUA_ERRERR+1)
typedef struct luaL_Reg {
const char *name;
lua_CFunction func;
} luaL_Reg;
#define LUAL_NUMSIZES (sizeof(lua_Integer)*16 + sizeof(lua_Number))
LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver, size_t sz);
#define luaL_checkversion(L) \
luaL_checkversion_(L, LUA_VERSION_NUM, LUAL_NUMSIZES)
LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
LUALIB_API const char *(luaL_tolstring) (lua_State *L, int idx, size_t *len);
LUALIB_API int (luaL_argerror) (lua_State *L, int arg, const char *extramsg);
LUALIB_API const char *(luaL_checklstring) (lua_State *L, int arg,
size_t *l);
LUALIB_API const char *(luaL_optlstring) (lua_State *L, int arg,
const char *def, size_t *l);
LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int arg);
LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int arg, lua_Number def);
LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int arg);
LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int arg,
lua_Integer def);
LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);
LUALIB_API void (luaL_checktype) (lua_State *L, int arg, int t);
LUALIB_API void (luaL_checkany) (lua_State *L, int arg);
LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
LUALIB_API void (luaL_setmetatable) (lua_State *L, const char *tname);
LUALIB_API void *(luaL_testudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API int (luaL_checkoption) (lua_State *L, int arg, const char *def,
const char *const lst[]);
LUALIB_API int (luaL_fileresult) (lua_State *L, int stat, const char *fname);
LUALIB_API int (luaL_execresult) (lua_State *L, int stat);
/* pre-defined references */
#define LUA_NOREF (-2)
#define LUA_REFNIL (-1)
LUALIB_API int (luaL_ref) (lua_State *L, int t);
LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);
LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename,
const char *mode);
#define luaL_loadfile(L,f) luaL_loadfilex(L,f,NULL)
LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz,
const char *name, const char *mode);
LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
LUALIB_API lua_State *(luaL_newstate) (void);
LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx);
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
const char *r);
LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
LUALIB_API int (luaL_getsubtable) (lua_State *L, int idx, const char *fname);
LUALIB_API void (luaL_traceback) (lua_State *L, lua_State *L1,
const char *msg, int level);
LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
lua_CFunction openf, int glb);
#define luaL_newlibtable(L,l) \
lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1)
#define luaL_newlib(L,l) \
(luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))
#define luaL_argcheck(L, cond,arg,extramsg) \
((void)((cond) || luaL_argerror(L, (arg), (extramsg))))
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n)))
#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n)))
#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d)))
#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i)))
#define luaL_dofile(L, fn) \
(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
#define luaL_dostring(L, s) \
(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n)))
#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))
#define luaL_loadbuffer(L,s,sz,n) luaL_loadbufferx(L,s,sz,n,NULL)
typedef struct luaL_Buffer {
char *b; /* buffer address */
size_t size; /* buffer size */
size_t n; /* number of characters in buffer */
lua_State *L;
char initb[LUAL_BUFFERSIZE]; /* initial buffer */
} luaL_Buffer;
#define luaL_addchar(B,c) \
((void)((B)->n < (B)->size || luaL_prepbuffsize((B), 1)), \
((B)->b[(B)->n++] = (c)))
#define luaL_addsize(B,s) ((B)->n += (s))
LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);
LUALIB_API char *(luaL_prepbuffsize) (luaL_Buffer *B, size_t sz);
LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);
LUALIB_API void (luaL_addvalue) (luaL_Buffer *B);
LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
LUALIB_API void (luaL_pushresultsize) (luaL_Buffer *B, size_t sz);
LUALIB_API char *(luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz);
#define luaL_prepbuffer(B) luaL_prepbuffsize(B, LUAL_BUFFERSIZE)
/*
** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and
** initial structure 'luaL_Stream' (it may contain other fields
** after that initial structure).
*/
#define LUA_FILEHANDLE "FILE*"
typedef struct luaL_Stream {
FILE *f; /* stream (NULL for incompletely created streams) */
lua_CFunction closef; /* to close stream (NULL for closed streams) */
} luaL_Stream;
/* compatibility with old module system */
#if defined(LUA_COMPAT_MODULE)
LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname,
int sizehint);
LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,
const luaL_Reg *l, int nup);
#define luaL_register(L,n,l) (luaL_openlib(L,(n),(l),0))
#endif
#if defined(<API key>)
#define luaL_checkunsigned(L,a) ((lua_Unsigned)luaL_checkinteger(L,a))
#define luaL_optunsigned(L,a,d) \
((lua_Unsigned)luaL_optinteger(L,a,(lua_Integer)(d)))
#endif
#endif |
#ifndef CAPUTILS_ADDRESS_H
#define CAPUTILS_ADDRESS_H
#include <stdio.h>
#include <netinet/ether.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
/**
* Supported address format:
*
* Types:
* - ethernet address (hwaddr)
* - IP address:port
* - filename
*
* Ethernet address:
* - Optional but recommended colon or dash delimiter.
* - Can fill in blanks by using double color, e.g:
* 01::01 is read as 01:00:00:00:00:01
*
* IP address:
* - tcp://127.0.0.1:4711
* - Supports tcp and udp.
* - Parsed using inet_aton.
*
* Filename:
* - Absolute or relative.
* - For filters limited to 22 chars.
* - No limit on local machine.
* - NOTE: For local addresses the string is referenced and must be retained
* during the lifetime of the address.
*
* To force a specific type use a prefix, e.g. file://127.0.0.1 reference a file
* called "127.0.0.1". TCP/UDP is only supported using prefix.
*
*/
#ifdef CAPUTILS_EXPORT
#pragma GCC visibility push(default)
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct stream_addr {
union {
/* raw buffer for backwards compability (may not be null-terminated) (includes old port) */
unsigned char buffer[22 + 4];
/* for ethernet streams */
struct ether_addr ether_addr;
/* for capfiles (null-terminated) */
char filename[22];
/* for locally stored capfiles (null-terminated) */
/* these cannot be sent across network */
const char* local_filename;
/* used together with <API key> */
char* int_filename;
/* Using existing FILE pointer. By default the user has to close this
* stream after stream_close. To automatically close it use
* STREAM_ADDR_FCLOSE flag. */
FILE* fp;
/* for TCP/UDP streams */
struct sockaddr_in ipv4;
} __attribute__((packed));
uint16_t _type;
uint16_t _flags;
} __attribute__((packed));
typedef struct stream_addr stream_addr_t;
#define <API key> {{{0,}},}
enum AddressType {
/**
* If the format of the address isn't know, this flag can be set to have it
* guess. Essentially it works like following:
* - If it is parsable as an ethernet address, <API key> is used.
* - If is begins with tcp:// or udp://, STREAM_ADD_{TCP,UDP} is used.
* - Otwerwise STREAM_ADDR_CAPFILE with STREAM_ADDR_LOCAL flag is used.
*
* However, if the user have a file which is named as an ethernet address
* confusion might happen.
*/
STREAM_ADDR_GUESS = -1,
/* fixed format */
STREAM_ADDR_CAPFILE = 0,
<API key>,
STREAM_ADDR_UDP,
STREAM_ADDR_TCP,
STREAM_ADDR_FP,
STREAM_ADDR_FIFO,
};
enum AddressFlags {
/* set to indicate that the capfile path is local (and can thus be longer
* than a regular filename of 22 chars). Memory is referenced so the caller
* must ensure the lifetime of the string is as long as the lifetime as the
* filter holding this address. */
STREAM_ADDR_LOCAL = (1<<0),
/* force the stream to be flushed for every write. useful for low-traffic
* streams or to ensure real-time data. Not necessarily implemented for all
* types.*/
STREAM_ADDR_FLUSH = (1<<1),
/* For files, FIFOs and similar, unlink the file in stream_close. This is
* most useful for FIFO which is created dynamically and should not really
* be used by end-users. */
STREAM_ADDR_UNLINK = (1<<2),
/* Normally the file is closed automatically but when using STREAM_ADDR_FP
* that is not the case. Using this flag the FILE pointer will be closed
* automatically. */
STREAM_ADDR_FCLOSE = (1<<3),
/* The local filename is duplicated and automatically freed. */
<API key> = (1<<4),
};
/**
* Convert string to stream_addr_t.
* @param dst Pointer to an existig destination_t.
* @param src String representing an address.
* @param type What kind of address it represents.
* @param flags Special flags, can be set to zero. @see DestinationFlags.
* @return Zero if successful, errno on errors.
*/
int stream_addr_aton(stream_addr_t* dst, const char* src, enum AddressType type, int flags);
/**
* Set address to a local string (only referencing the memory)
*/
int stream_addr_str(stream_addr_t* dst, const char* src, int flags);
/**
* Set address to an existing local file pointer. User must ensure it is open in the
* correct mode for the operation.
*/
int stream_addr_fp(stream_addr_t* dst, FILE* fp, int flags);
/**
* Convert destination to string. The string is returned in a statically
* allocated buffer, which subsequent calls will overwrite.
*/
const char* stream_addr_ntoa(const stream_addr_t* src);
/**
* Like destination_ntoa but writes into buf.
* @param bytes Size of buf.
*/
const char* stream_addr_ntoa_r(const stream_addr_t* src, char* buf, size_t bytes);
enum AddressType stream_addr_type(const stream_addr_t* addr) __attribute__((pure));
int stream_addr_flags(const stream_addr_t* addr) __attribute__((pure));
int <API key>(const stream_addr_t* addr, enum AddressFlags flag);
/**
* Initialize address to zero.
* Some address whose types allocates resources will be free'd.
*/
void stream_addr_reset(stream_addr_t* addr);
/**
* Check if an address is set or not.
*/
int stream_addr_is_set(const stream_addr_t* addr);
#ifdef __cplusplus
}
#endif
#ifdef CAPUTILS_EXPORT
#pragma GCC visibility pop
#endif
#endif /* CAPUTILS_ADDRESS_H */ |
<?php
$selectname = $name."[type]";
$textname = $name."[text]";
printf('<select %s>', $control->attributes(array("name"=>$selectname)));
$type = isset($value['type']) ? $value['type'] : null;
$text = isset($value['text']) ? $value['text'] : null;
foreach ($node->children('option') as $option) {
// set attributes
$attributes = array('value' => $option->attr('value'));
// is checked ?
if ($option->attr('value') == $type) {
$attributes = array_merge($attributes, array('selected' => 'selected'));
}
printf('<option %s>%s</option>', $control->attributes($attributes), $option->text());
}
printf('</select>');
printf(' <input class="uk-form-width-mini" %s>', $control->attributes(array_merge($node->attr(), array('type' => 'text', 'name' => $textname, 'value' => $text)), array('label', 'description', 'default'))); |
/* -*- mode: C; c-basic-offset: 8; indent-tabs-mode: nil; tab-width: 8 -*- */
#include <config.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#include <netdb.h>
#ifdef USE_SOCKS5
#define SOCKS
#include <socks.h>
#endif
#include <errno.h>
#include "http.h"
#include "util.h"
#include "url.h"
#include "ftp.h"
#include "options.h"
void
close_quit(int sock)
{
if(sock) {
write(sock, "QUIT\r\n", 6);
close(sock);
}
}
static void
ftp_set_defaults(UrlResource *rsrc, Url *u)
{
if( !u->port )
u->port = 21;
if( !u->username )
u->username = strdup("anonymous");
if( !u->password )
u->password = strdup("snarf@");
if( !rsrc->outfile ) {
if( u->file )
rsrc->outfile = strdup(u->file);
else
rsrc->outfile = strdup("ftpindex.txt");
}
}
void
send_control(int sock, char *string, ...)
{
va_list args;
char *line = NULL;
char *newline;
char *s = NULL;
line = safe_strdup(string);
va_start(args, string);
s = va_arg(args, char *);
while( s ) {
newline = strconcat(line, s, NULL);
safe_free(line);
line = newline;
s = va_arg(args, char *);
}
va_end(args);
write(sock, line, strlen(line));
safe_free(line);
}
char *
get_line(UrlResource *rsrc, int control)
{
int bytes_read = 0;
char *end;
char buf[BUFSIZE+1];
while( (bytes_read = read(control, buf, BUFSIZE)) ) {
if( rsrc->options & OPT_VERBOSE )
fwrite(buf, 1, bytes_read, stderr);
if( (buf[0] == '4' || buf[0] == '5') &&
!((rsrc->options & (OPT_VERBOSE | OPT_QUIET))) ) {
fwrite(buf, 1, bytes_read, stderr);
return NULL;
}
/* in case there's a partial read */
buf[bytes_read] = '\0';
if( buf[bytes_read - 1] == '\n' )
buf[bytes_read - 1] = '\0';
if( buf[bytes_read - 2] == '\r' )
buf[bytes_read - 2] = '\0';
if( isdigit(buf[0]) && buf[3] == ' ' ) {
return strdup(buf);
}
/* skip to last line of possibly multiple line input */
if( (end = strrchr(buf, '\n')) ) {
end++;
if( isdigit(end[0]) && end[3] == ' ' )
return strdup(end);
}
}
return NULL;
}
static int
check_numeric(const char *numeric, const char *buf)
{
return( (buf[0] == numeric[0]) &&
(buf[1] == numeric[1]) &&
(buf[2] == numeric[2]) );
}
/* cheesy I know */
int
sock_init(struct sockaddr_in *sa, int control)
{
socklen_t i;
int sock;
if( (sock = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {
perror("socket");
return(0);
}
i = sizeof(*sa);
getsockname (control, (struct sockaddr *)sa, &i) ;
sa->sin_port = 0 ; /* let system choose a port */
if (bind (sock, (struct sockaddr *)sa, sizeof (*sa)) < 0) {
perror("bind");
return 0;
}
return sock;
}
int
get_passive_sock(UrlResource *rsrc, int control)
{
unsigned char *addr;
struct sockaddr_in sa;
int sock;
int x;
char *line, *orig_line;
send_control(control, "PASV\r\n", NULL);
if( !((line = get_line(rsrc, control)) &&
check_numeric("227", line)) ) {
safe_free(line);
return 0;
}
orig_line = line;
if( strlen(line) < 4 ) {
safe_free(line);
return 0;
}
if( !(sock = sock_init(&sa, control)) )
return -1;
/* skip the numeric response */
line += 4;
/* then find the digits */
while( !(isdigit(*line)) )
line++;
/* ugliness from snarf 1.x */
sa.sin_family = AF_INET;
addr = (unsigned char *)&sa.sin_addr;
for(x = 0; x < 4; x++) {
addr[x] = atoi(line);
line = strchr(line,',') + 1;
}
addr = (unsigned char *)&sa.sin_port ;
addr[0] = atoi(line);
line = strchr(line,',') + 1;
addr[1] = atoi(line);
if( connect(sock, (struct sockaddr *)&sa, sizeof(sa)) < 0 ) {
safe_free(orig_line);
perror("connect");
return -1;
}
safe_free(orig_line);
return sock;
}
int
get_sock(UrlResource *rsrc, int control)
{
struct sockaddr_in sa;
unsigned char *addr;
unsigned char *port;
char *line;
char port_string[BUFSIZE];
unsigned int sock;
socklen_t i;
if(! (sock = sock_init(&sa, control)) )
return 0;
if ( listen(sock, 0) < 0 ) {
perror("listen");
return 0;
}
i = sizeof(sa);
getsockname(sock, (struct sockaddr *)&sa, &i);
addr = (unsigned char *)(&sa.sin_addr.s_addr);
port = (unsigned char *)(&sa.sin_port);
sprintf(port_string, "PORT %d,%d,%d,%d,%d,%d\r\n",
addr[0], addr[1], addr[2], addr[3],
port[0],(unsigned char)port[1]);
send_control(control, port_string, NULL);
if( !((line = get_line(rsrc, control)) &&
check_numeric("200", line)) ) {
safe_free(line);
return 0;
}
safe_free(line);
return sock;
}
/* I'm going to go to hell for not doing proper cleanup. */
int
ftp_transfer(UrlResource *rsrc)
{
Url *u = NULL;
FILE *out = NULL;
char *line = NULL;
int sock = 0;
int data_sock = 0;
int passive = 1;
int retval = 0;
u = rsrc->url;
/* first of all, if this is proxied, just pass it off to the
http module, since that's how we support proxying. */
rsrc->proxy = get_proxy("FTP_PROXY");
if( rsrc->proxy ) {
return http_transfer(rsrc);
}
ftp_set_defaults(rsrc, u);
if( !(sock = tcp_connect(u->host, u->port)) )
return 0;
if( !(line = get_line(rsrc, sock)) )
return 0;
if( !check_numeric("220", line) ) {
safe_free(line);
report(ERR, "bad server greeting: %s");
return 0;
}
send_control(sock, "USER ", u->username, "\r\n", NULL);
if( !(line = get_line(rsrc, sock)) )
return 0;
/* do the password dance */
if( !check_numeric("230", line) ) {
if( !check_numeric("331", line)) {
safe_free(line);
report(ERR, "bad/unexpected response: %s", line);
return 0;
} else {
safe_free(line);
send_control(sock, "PASS ", u->password, "\r\n", NULL);
if( !((line = get_line(rsrc, sock)) &&
check_numeric("230", line)) ) {
safe_free(line);
report(ERR, "login failed");
return 0;
}
safe_free(line);
}
}
/* set binmode */
send_control(sock, "TYPE I\r\n", NULL);
if( !(line = get_line(rsrc, sock)) )
return 0;
safe_free(line);
if( u->path ) {
send_control(sock, "CWD ", u->path, "\r\n", NULL);
if( !((line = get_line(rsrc, sock)) &&
check_numeric("250", line)) ) {
safe_free(line);
close_quit(sock);
return 0;
}
safe_free(line);
}
/* finally, the good stuff */
/* get a socket for reading. try passive first. */
if( ! (rsrc->options & OPT_ACTIVE) ) {
if( (data_sock = get_passive_sock(rsrc, sock)) == -1 )
return 0;
}
if( !data_sock ) {
if( (data_sock = get_sock(rsrc, sock)) < 1 )
return 0;
else
passive = 0;
}
if (u->file) {
send_control(sock, "SIZE ", u->file, "\r\n", NULL);
line = get_line(rsrc, sock);
if (line && check_numeric("213", line)) {
rsrc->outfile_size = atoi(line + 3);
} else {
rsrc->outfile_size = 0;
}
}
/* handle resume */
if( rsrc->outfile_offset && (rsrc->options & OPT_RESUME) ) {
char numstring[BUFSIZE]; /* ugly hack */
sprintf(numstring, "%ld", (long int )rsrc->outfile_offset);
send_control(sock, "REST ", numstring, "\r\n", NULL);
if( !((line = get_line(rsrc, sock)) &&
check_numeric("350", line)) ) {
safe_free(line);
close_quit(sock);
report(ERR, "server does not support FTP resume, "
"try again without -r");
return 0;
}
safe_free(line);
}
if (u->file)
send_control(sock, "RETR ", u->file, "\r\n", NULL);
else
send_control(sock, "NLST\r\n", NULL);
if( !((line = get_line(rsrc, sock)) &&
(check_numeric("150", line) || check_numeric("125", line))) ) {
safe_free(line);
close_quit(sock);
return 0;
}
if( !passive )
data_sock = accept(data_sock, NULL, NULL);
/* rsrc->outfile_size = guess_file_size(line); */
safe_free(line);
if( ! (out = open_outfile(rsrc)) ) {
report(ERR, "opening %s: %s", rsrc->outfile,
strerror(errno));
close_quit(sock);
return 0;
}
retval = dump_data(rsrc, data_sock, out);
line = get_line(rsrc, sock); /* 226 Transfer complete */
safe_free(line);
send_control(sock, "QUIT\r\n", NULL);
line = get_line(rsrc, sock); /* 221 Goodbye */
safe_free(line);
fclose(out);
close(sock);
close(data_sock);
return retval;
} |
class <API key> < ActiveRecord::Migration
def self.up
change_table :articles do |t|
t.attachment :header
end
end
def self.down
remove_attachment :articles, :header
end
end |
#include "testmanager.h"
#include <QFile>
#include <QTextStream>
#include <QDebug>
TestManager::TestManager()
{
}
int TestManager::count() const
{
return _testList.length();
}
void TestManager::clear()
{
TestManager::TestCaseList::const_iterator itr = _testList.begin();
while(itr != _testList.end()) {
TestCase *tp = *itr;
delete tp;
itr++;
}
_testList.clear();
}
void TestManager::addTestCase(TestCase *testCase)
{
_testList.append(testCase);
}
TestCase *TestManager::testCase(int index)
{
TestCase *tp = NULL;
if (index >= 0 && index < _testList.length()){
tp = _testList.at(index);
}
return tp;
}
void TestManager::initFromFunctions(const QStringList &funList)
{
int len = funList.length();
clear();
QString funName;
TestCase *test ;
test = new TestCase();
funName = "initTestCase";
test->setName(funName);
test->setChecked(true);
addTestCase(test);
for (int i = 0; i < len; i++) {
test = new TestCase();
funName = funList.at(i);
funName.resize(funName.length() - 2);
test->setName(funName);
addTestCase(test);
}
test = new TestCase();
funName = "cleanupTestCase";
test->setName(funName);
test->setChecked(true);
addTestCase(test);
}
const int &TestManager::indexOfByFunName(const QString &fun) const
{
int len = count();
int result = -1;
for (int i = 0; i < len; i++) {
if (_testList.at(i)->name() == fun) {
result = i;
}
}
return result;
}
void TestManager::setTestResult(const QString &result)
{
_xmlStr = result;
_doc.setContent(result);
QDomElement root = _doc.documentElement();
QDomNodeList funlist = root.elementsByTagName("TestFunction");
for (int i = 0; i < funlist.count(); i++) {
readFunction(funlist.at(i).toElement());
}
}
void TestManager::readFunction(const QDomElement &element)
{
QString funName = element.attribute("name");
int index = indexOfByFunName(funName);
if (index != -1) {
//find test case
TestCase *test = _testList.at(index);
QDomNode res = element.firstChild();
while (!res.isNull()) {
if (test->checked()) {
if (res.nodeName() == "Incident")
readResult(res.toElement(),test);
else if (res.nodeName() == "Message")
readMessage(res.toElement(),test);
else if (res.nodeName() == "BenchmarkResult")
readBenchmark(res.toElement(),test);
} else {
test->setChecked(false);
}
res = res.nextSibling();
}
}
}
void TestManager::readMessage(const QDomElement &element, TestCase *test)
{
QDomNode child = element.firstChild();
while (!child.isNull()) {
if (child.nodeName() == "Description") {
test->message() << element.attribute("type") + " : "
+ child.toElement().firstChild().toCDATASection().data();
break;
}
child = child.nextSibling();
}
}
void TestManager::readResult(const QDomElement &element, TestCase *test)
{
QString result = element.attribute("type");
test->setExecuted(true);
test->setResultStr(result);
if (result == "pass") {
test->setResult(true);
test->setErrorFile("");
test->setErrorLine(0);
test->setErrorMessage("");
} else if (result == "fail") {
test->setResult(false);
test->setErrorFile(element.attribute("file"));
test->setErrorLine(element.attribute("line").toInt());
test->setErrorMessage("");
readErrorMessage(element,test);
}
}
void TestManager::readErrorMessage(const QDomElement &element, TestCase *test)
{
QDomNode child = element.firstChild();
while (!child.isNull()) {
if (child.nodeName() == "Description") {
test->setErrorMessage(child.toElement().firstChild().toCDATASection().data());
break;
}
child = child.nextSibling();
}
}
void TestManager::readBenchmark(const QDomElement &element, TestCase *test)
{
double total;
int iter;
total = element.attribute("value","0").toDouble();
iter = element.attribute("iterations","1").toInt();
QString msg;
msg.sprintf("Benchmark : %f msec per iteration (total: %f, iterations: %d)",total / iter, total, iter);
test->benchmark() << msg;
}
void TestManager::saveResult(QString filename)
{
QFile file(filename);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
return;
QTextStream out(&file);
out << _doc.toString();
} |
<?php
/**
* Class loader using SPL autoloader.
*/
class <API key> {
/**
* Base path supplied when calling register method.
*
* @var string
*/
private static $base_path;
/**
* This loader only load class with this prefix.
*
* @var string
*/
private static $class_prefix;
/**
* Registers Autoloader as an SPL autoloader.
*/
public static function register( $class_prefix, $base_path ) {
self::$class_prefix = $class_prefix;
self::$base_path = $base_path;
<API key>( array( __CLASS__, 'autoload' ) );
}
/**
* Handles autoloading of classes.
*
* @param string $classname Class name
*/
public static function autoload( $classname ) {
if ( false === strpos( $classname, self::$class_prefix . '_' ) ) {
return;
}
$<API key> = str_replace( self::$class_prefix . '_', '', $classname );
$filename = str_replace( '_', '-', strtolower( $<API key> ) );
require_once self::$base_path . $filename . '.php';
}
} |
#ifndef <API key>
#define <API key>
class pqistore ;
#include "retroshare/rsplugin.h"
#include "plugins/rscacheservice.h"
#include "rsrank.h"
/*
* A Generic Ranking system.
* Each User provides one cache...
*
* can be overloaded for specific types
* (links, shares, photos etc)
*
* This is not generic yet!!!
*/
class RsRankMsg;
class RsRankLinkMsg;
const uint16_t <API key> = 0x0002 ;
const uint32_t <API key> = 0x0011 ;
class RankGroup
{
public:
std::string rid; /* Random Id */
std::wstring link;
std::wstring title;
float rank;
bool ownTag;
std::map<std::string, RsRankLinkMsg *> comments;
};
class p3Ranking: public RsCacheService, public RsRanks
{
public:
p3Ranking(RsPluginHandler* pgHandler) ;
/* overloaded functions from Cache Source */
virtual bool loadLocalCache(const RsCacheData &data);
/* overloaded functions from Cache Store */
virtual int loadCache(const RsCacheData &data);
public:
/* changed */
virtual bool updated();
/* Set Sort Methods */
virtual bool setSortPeriod(uint32_t period);
virtual bool setSortMethod(uint32_t type);
virtual bool clearPeerFilter();
virtual bool setPeerFilter(std::list<std::string> peers);
/* get Ids */
virtual uint32_t getRankingsCount();
virtual float getMaxRank();
virtual bool getRankings(uint32_t first, uint32_t count, std::list<std::string> &rids);
virtual bool getRankDetails(std::string rid, RsRankDetails &details);
/* Add New Comment / Msg */
virtual std::string newRankMsg(std::wstring link, std::wstring title, std::wstring comment, int32_t score);
virtual bool updateComment(std::string rid, std::wstring comment, int32_t score);
virtual std::string anonRankMsg(std::string rid, std::wstring link, std::wstring title);
virtual void tick();
void loadRankFile(std::string filename, std::string src);
void addRankMsg(RsRankLinkMsg *msg);
void publishMsgs(bool own);
float locked_calcRank(RankGroup &grp); /* returns 0->100 */
void locked_reSortGroup(RankGroup &grp);
void sortAllMsgs();
pqistore *createStore(std::string file, std::string src, bool reading);
protected:
bool addAnonToList(RsRankLinkMsg *msg);
virtual RsSerialiser *setupSerialiser();
virtual bool saveList(bool &cleanup, std::list<RsItem *>&);
virtual bool loadList(std::list<RsItem *>& load);
virtual void saveDone();
private:
void createDummyData();
uint32_t storePeriod;
p3LinkMgr *mConnMgr;
RsMutex mRankMtx;
bool mRepublish;
bool mRepublishFriends;
time_t mRepublishFriendTS;
uint32_t mStorePeriod;
std::string mOwnId;
bool mUpdated;
bool mRepost;
std::map<std::string, RankGroup> mData;
std::multimap<float, std::string> mRankings;
/* Filter/Sort params */
std::list<std::string> mPeerFilter;
uint32_t mViewPeriod;
uint32_t mSortType;
/* Anonymous Link List */
std::list<RsRankLinkMsg *> mAnon;
};
#endif |
// XOR Problem solution using Multi-Layer Neural Network
// AForge.NET framework
// contacts@aforgenet.com
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
using System.IO;
using AForge;
using AForge.Neuro;
using AForge.Neuro.Learning;
using AForge.Controls;
namespace XORProblem
{
<summary>
Summary description for MainForm.
</summary>
public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox learningRateBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox alphaBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox errorLimitBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ComboBox sigmoidTypeCombo;
private System.Windows.Forms.TextBox currentErrorBox;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox currentIterationBox;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button stopButton;
private System.Windows.Forms.Button startButton;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.CheckBox saveFilesCheck;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox momentumBox;
private Chart errorChart;
<summary>
Required designer variable.
</summary>
private System.ComponentModel.Container components = null;
private double learningRate = 0.1;
private double momentum = 0.0;
private double sigmoidAlphaValue = 2.0;
private double learningErrorLimit = 0.1;
private int sigmoidType = 0;
private bool <API key> = false;
private Thread workerThread = null;
private volatile bool needToStop = false;
// Constructor
public MainForm( )
{
// Required for Windows Form Designer support
InitializeComponent();
// update controls
UpdateSettings();
// initialize charts
errorChart.AddDataSeries( "error", Color.Red, Chart.SeriesType.Line, 1 );
}
<summary>
Clean up any resources being used.
</summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox( );
this.momentumBox = new System.Windows.Forms.TextBox( );
this.label6 = new System.Windows.Forms.Label( );
this.stopButton = new System.Windows.Forms.Button( );
this.startButton = new System.Windows.Forms.Button( );
this.label5 = new System.Windows.Forms.Label( );
this.currentErrorBox = new System.Windows.Forms.TextBox( );
this.label11 = new System.Windows.Forms.Label( );
this.currentIterationBox = new System.Windows.Forms.TextBox( );
this.label8 = new System.Windows.Forms.Label( );
this.label7 = new System.Windows.Forms.Label( );
this.sigmoidTypeCombo = new System.Windows.Forms.ComboBox( );
this.errorLimitBox = new System.Windows.Forms.TextBox( );
this.label3 = new System.Windows.Forms.Label( );
this.alphaBox = new System.Windows.Forms.TextBox( );
this.label2 = new System.Windows.Forms.Label( );
this.learningRateBox = new System.Windows.Forms.TextBox( );
this.label1 = new System.Windows.Forms.Label( );
this.label4 = new System.Windows.Forms.Label( );
this.groupBox2 = new System.Windows.Forms.GroupBox( );
this.errorChart = new AForge.Controls.Chart( );
this.saveFilesCheck = new System.Windows.Forms.CheckBox( );
this.groupBox1.SuspendLayout( );
this.groupBox2.SuspendLayout( );
this.SuspendLayout( );
// groupBox1
this.groupBox1.Controls.Add( this.momentumBox );
this.groupBox1.Controls.Add( this.label6 );
this.groupBox1.Controls.Add( this.stopButton );
this.groupBox1.Controls.Add( this.startButton );
this.groupBox1.Controls.Add( this.label5 );
this.groupBox1.Controls.Add( this.currentErrorBox );
this.groupBox1.Controls.Add( this.label11 );
this.groupBox1.Controls.Add( this.currentIterationBox );
this.groupBox1.Controls.Add( this.label8 );
this.groupBox1.Controls.Add( this.label7 );
this.groupBox1.Controls.Add( this.sigmoidTypeCombo );
this.groupBox1.Controls.Add( this.errorLimitBox );
this.groupBox1.Controls.Add( this.label3 );
this.groupBox1.Controls.Add( this.alphaBox );
this.groupBox1.Controls.Add( this.label2 );
this.groupBox1.Controls.Add( this.learningRateBox );
this.groupBox1.Controls.Add( this.label1 );
this.groupBox1.Controls.Add( this.label4 );
this.groupBox1.Location = new System.Drawing.Point( 10, 10 );
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size( 195, 260 );
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Neural Network";
// momentumBox
this.momentumBox.Location = new System.Drawing.Point( 125, 45 );
this.momentumBox.Name = "momentumBox";
this.momentumBox.Size = new System.Drawing.Size( 60, 20 );
this.momentumBox.TabIndex = 3;
// label6
this.label6.Location = new System.Drawing.Point( 10, 47 );
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size( 82, 17 );
this.label6.TabIndex = 2;
this.label6.Text = "Momentum:";
// stopButton
this.stopButton.Enabled = false;
this.stopButton.Location = new System.Drawing.Point( 110, 225 );
this.stopButton.Name = "stopButton";
this.stopButton.Size = new System.Drawing.Size( 75, 23 );
this.stopButton.TabIndex = 28;
this.stopButton.Text = "S&top";
this.stopButton.Click += new System.EventHandler( this.stopButton_Click );
// startButton
this.startButton.Location = new System.Drawing.Point( 25, 225 );
this.startButton.Name = "startButton";
this.startButton.Size = new System.Drawing.Size( 75, 23 );
this.startButton.TabIndex = 27;
this.startButton.Text = "&Start";
this.startButton.Click += new System.EventHandler( this.startButton_Click );
// label5
this.label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label5.Location = new System.Drawing.Point( 10, 211 );
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size( 175, 2 );
this.label5.TabIndex = 26;
// currentErrorBox
this.currentErrorBox.Location = new System.Drawing.Point( 125, 185 );
this.currentErrorBox.Name = "currentErrorBox";
this.currentErrorBox.ReadOnly = true;
this.currentErrorBox.Size = new System.Drawing.Size( 60, 20 );
this.currentErrorBox.TabIndex = 25;
// label11
this.label11.Location = new System.Drawing.Point( 10, 187 );
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size( 121, 14 );
this.label11.TabIndex = 24;
this.label11.Text = "Current summary error:";
// currentIterationBox
this.currentIterationBox.Location = new System.Drawing.Point( 125, 160 );
this.currentIterationBox.Name = "currentIterationBox";
this.currentIterationBox.ReadOnly = true;
this.currentIterationBox.Size = new System.Drawing.Size( 60, 20 );
this.currentIterationBox.TabIndex = 23;
// label8
this.label8.Location = new System.Drawing.Point( 10, 162 );
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size( 98, 16 );
this.label8.TabIndex = 22;
this.label8.Text = "Current iteration:";
// label7
this.label7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label7.Location = new System.Drawing.Point( 10, 150 );
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size( 175, 2 );
this.label7.TabIndex = 21;
// sigmoidTypeCombo
this.sigmoidTypeCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.sigmoidTypeCombo.Items.AddRange( new object[] {
"Unipolar",
"Bipolar"} );
this.sigmoidTypeCombo.Location = new System.Drawing.Point( 125, 120 );
this.sigmoidTypeCombo.Name = "sigmoidTypeCombo";
this.sigmoidTypeCombo.Size = new System.Drawing.Size( 60, 21 );
this.sigmoidTypeCombo.TabIndex = 9;
// errorLimitBox
this.errorLimitBox.Location = new System.Drawing.Point( 125, 95 );
this.errorLimitBox.Name = "errorLimitBox";
this.errorLimitBox.Size = new System.Drawing.Size( 60, 20 );
this.errorLimitBox.TabIndex = 7;
// label3
this.label3.Location = new System.Drawing.Point( 10, 97 );
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size( 110, 15 );
this.label3.TabIndex = 6;
this.label3.Text = "Learning error limit:";
// alphaBox
this.alphaBox.Location = new System.Drawing.Point( 125, 70 );
this.alphaBox.Name = "alphaBox";
this.alphaBox.Size = new System.Drawing.Size( 60, 20 );
this.alphaBox.TabIndex = 5;
// label2
this.label2.Location = new System.Drawing.Point( 10, 72 );
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size( 120, 15 );
this.label2.TabIndex = 4;
this.label2.Text = "Sigmoid\'s alpha value:";
// learningRateBox
this.learningRateBox.Location = new System.Drawing.Point( 125, 20 );
this.learningRateBox.Name = "learningRateBox";
this.learningRateBox.Size = new System.Drawing.Size( 60, 20 );
this.learningRateBox.TabIndex = 1;
// label1
this.label1.Location = new System.Drawing.Point( 10, 22 );
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size( 78, 14 );
this.label1.TabIndex = 0;
this.label1.Text = "Learning rate:";
// label4
this.label4.Location = new System.Drawing.Point( 10, 122 );
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size( 100, 15 );
this.label4.TabIndex = 8;
this.label4.Text = "Sigmoid\'s type:";
// groupBox2
this.groupBox2.Controls.Add( this.errorChart );
this.groupBox2.Controls.Add( this.saveFilesCheck );
this.groupBox2.Location = new System.Drawing.Point( 215, 10 );
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size( 220, 260 );
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Error\'s dynamics";
// errorChart
this.errorChart.Location = new System.Drawing.Point( 10, 20 );
this.errorChart.Name = "errorChart";
this.errorChart.Size = new System.Drawing.Size( 200, 205 );
this.errorChart.TabIndex = 2;
this.errorChart.Text = "chart1";
// saveFilesCheck
this.saveFilesCheck.Location = new System.Drawing.Point( 10, 233 );
this.saveFilesCheck.Name = "saveFilesCheck";
this.saveFilesCheck.Size = new System.Drawing.Size( 200, 18 );
this.saveFilesCheck.TabIndex = 1;
this.saveFilesCheck.Text = "Save errors to files";
// MainForm
this.AutoScaleBaseSize = new System.Drawing.Size( 5, 13 );
this.ClientSize = new System.Drawing.Size( 452, 278 );
this.Controls.Add( this.groupBox2 );
this.Controls.Add( this.groupBox1 );
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "MainForm";
this.Text = "XOR Problem";
this.Closing += new System.ComponentModel.CancelEventHandler( this.MainForm_Closing );
this.groupBox1.ResumeLayout( false );
this.groupBox1.PerformLayout( );
this.groupBox2.ResumeLayout( false );
this.ResumeLayout( false );
}
#endregion
<summary>
The main entry point for the application.
</summary>
[STAThread]
static void Main( )
{
Application.Run( new MainForm( ) );
}
// Delegates to enable async calls for setting controls properties
private delegate void SetTextCallback( System.Windows.Forms.Control control, string text );
// Thread safe updating of control's text property
private void SetText( System.Windows.Forms.Control control, string text )
{
if ( control.InvokeRequired )
{
SetTextCallback d = new SetTextCallback( SetText );
Invoke( d, new object[] { control, text } );
}
else
{
control.Text = text;
}
}
// On main form closing
private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
// check if worker thread is running
if ( ( workerThread != null ) && ( workerThread.IsAlive ) )
{
needToStop = true;
while ( !workerThread.Join( 100 ) )
Application.DoEvents( );
}
}
// Update settings controls
private void UpdateSettings( )
{
learningRateBox.Text = learningRate.ToString( );
momentumBox.Text = momentum.ToString( );
alphaBox.Text = sigmoidAlphaValue.ToString( );
errorLimitBox.Text = learningErrorLimit.ToString( );
sigmoidTypeCombo.SelectedIndex = sigmoidType;
saveFilesCheck.Checked = <API key>;
}
// Delegates to enable async calls for setting controls properties
private delegate void EnableCallback( bool enable );
// Enable/disale controls (safe for threading)
private void EnableControls( bool enable )
{
if ( InvokeRequired )
{
EnableCallback d = new EnableCallback( EnableControls );
Invoke( d, new object[] { enable } );
}
else
{
learningRateBox.Enabled = enable;
momentumBox.Enabled = enable;
alphaBox.Enabled = enable;
errorLimitBox.Enabled = enable;
sigmoidTypeCombo.Enabled = enable;
saveFilesCheck.Enabled = enable;
startButton.Enabled = enable;
stopButton.Enabled = !enable;
}
}
// On "Start" button click
private void startButton_Click( object sender, System.EventArgs e )
{
// get learning rate
try
{
learningRate = Math.Max( 0.00001, Math.Min( 1, double.Parse( learningRateBox.Text ) ) );
}
catch
{
learningRate = 0.1;
}
// get momentum
try
{
momentum = Math.Max( 0, Math.Min( 0.5, double.Parse( momentumBox.Text ) ) );
}
catch
{
momentum = 0;
}
// get sigmoid's alpha value
try
{
sigmoidAlphaValue = Math.Max( 0.01, Math.Min( 100, double.Parse( alphaBox.Text ) ) );
}
catch
{
sigmoidAlphaValue = 2;
}
// get learning error limit
try
{
learningErrorLimit = Math.Max( 0, double.Parse( errorLimitBox.Text ) );
}
catch
{
learningErrorLimit = 0.1;
}
// get sigmoid's type
sigmoidType = sigmoidTypeCombo.SelectedIndex;
<API key> = saveFilesCheck.Checked;
// update settings controls
UpdateSettings( );
// disable all settings controls
EnableControls( false );
// run worker thread
needToStop = false;
workerThread = new Thread( new ThreadStart( SearchSolution ) );
workerThread.Start( );
}
// On "Stop" button click
private void stopButton_Click( object sender, System.EventArgs e )
{
// stop worker thread
needToStop = true;
while ( !workerThread.Join( 100 ) )
Application.DoEvents( );
workerThread = null;
}
// Worker thread
void SearchSolution( )
{
// initialize input and output values
double[][] input = null;
double[][] output = null;
if ( sigmoidType == 0 )
{
// unipolar data
input = new double[4][] {
new double[] {0, 0},
new double[] {0, 1},
new double[] {1, 0},
new double[] {1, 1}
};
output = new double[4][] {
new double[] {0},
new double[] {1},
new double[] {1},
new double[] {0}
};
}
else
{
// biipolar data
input = new double[4][] {
new double[] {-1, -1},
new double[] {-1, 1},
new double[] { 1, -1},
new double[] { 1, 1}
};
output = new double[4][] {
new double[] {-1},
new double[] { 1},
new double[] { 1},
new double[] {-1}
};
}
// create neural network
ActivationNetwork network = new ActivationNetwork(
( sigmoidType == 0 ) ?
(IActivationFunction) new SigmoidFunction( sigmoidAlphaValue ) :
(IActivationFunction) new <API key>( sigmoidAlphaValue ),
2, 2, 1 );
// create teacher
<API key> teacher = new <API key>( network );
// set learning rate and momentum
teacher.LearningRate = learningRate;
teacher.Momentum = momentum;
// iterations
int iteration = 1;
// statistic files
StreamWriter errorsFile = null;
try
{
// check if we need to save statistics to files
if ( <API key> )
{
// open files
errorsFile = File.CreateText( "errors.csv" );
}
// erros list
ArrayList errorsList = new ArrayList( );
// loop
while ( !needToStop )
{
// run epoch of learning procedure
double error = teacher.RunEpoch( input, output );
errorsList.Add( error );
// save current error
if ( errorsFile != null )
{
errorsFile.WriteLine( error );
}
// show current iteration & error
SetText( currentIterationBox, iteration.ToString( ) );
SetText( currentErrorBox, error.ToString( ) );
iteration++;
// check if we need to stop
if ( error <= learningErrorLimit )
break;
}
// show error's dynamics
double[,] errors = new double[errorsList.Count, 2];
for ( int i = 0, n = errorsList.Count; i < n; i++ )
{
errors[i, 0] = i;
errors[i, 1] = (double) errorsList[i];
}
errorChart.RangeX = new Range( 0, errorsList.Count - 1 );
errorChart.UpdateDataSeries( "error", errors );
}
catch ( IOException )
{
MessageBox.Show( "Failed writing file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
}
finally
{
// close files
if ( errorsFile != null )
errorsFile.Close( );
}
// enable settings controls
EnableControls( true );
}
}
} |
<?php
if(!defined('SYSTEM_ROOT'))
require_once __DIR__.'/settings.php';
include_once SYSTEM_ROOT.LIB_DIR.'system.lib.php';
include_once SYSTEM_ROOT.LIB_DIR.'filesystem.lib.php';
include_once SYSTEM_ROOT.LIB_DIR.'log.class.php';
include_once SYSTEM_ROOT.LIB_DIR.'rate.lib.php';
include_once SYSTEM_ROOT.ETC_DIR.'versions.php';
// Get IP address
$IP = getClient_ip();
//$LONGIP = @sprintf("%u",ip2long($IP)) | '0';
// Get and clean request vars
$codalbum = clear_request_param(getRequest_param(URI_QUERY_ALBUM, false), 'a-zA-Z0-9', 8, false);
$action = clear_request_param(getRequest_param(URI_QUERY_ACTION, ''), 'a-z', 9, false); // redocache | nocache
$i = 0;
if($codalbum==false){
// Open error log
$ERRLOG = new LOG(SYSTEM_ROOT.ADMIN_DIR.'/logs/events.log');
$ERRLOG->insert('EMPTY ALBUM CODE - ip='.$IP.' - (/classement.php)', true);
echo '<h1>Album introuvable!</h1>';
exit;
}else{
// Open logs
$ERRLOG = new LOG(SYSTEM_ROOT.ALBUMS_DIR.$codalbum.'/logs/errors.log');
}
// Get other vars
$AL_CONF = include SYSTEM_ROOT.ETC_DIR.'album_clean.config.php'; // Charger array de configuration propre
$RKEY = clear_request_param(getRequest_param(<API key>, ''), 'a-zA-Z0-9', 16, false);
$ALBUM_ROOT = SYSTEM_ROOT.ALBUMS_DIR.$codalbum.'/';
$RANKING_FILENAME = SYSTEM_ROOT.ALBUMS_DIR.$codalbum.'/'.PROC_DIR.'/ranking_cache.html';
// Load album config
if(@is_readable(SYSTEM_ROOT.ALBUMS_DIR.$codalbum.'/config.php')===true){
$AL_CONF = include SYSTEM_ROOT.ALBUMS_DIR.$codalbum.'/config.php';
}
DEBUG:
echo '
<html>
<head>
<title>Club photo - MJC Rodez</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" media="screen" href="'.PUBLIC_ROOT.'css/reset.css?v='.VERSION_CSS.'" type="text/css" />
<link rel="stylesheet" media="screen" href="'.PUBLIC_ROOT.'css/base.css?v='.VERSION_CSS.'" type="text/css" />
<link rel="stylesheet" media="screen" href="'.PUBLIC_ROOT.'css/ranking.css?v='.VERSION_CSS.'" type="text/css" />
</head>
<body>
<!-- Header -->
<div class="header">
<h1>Classement approximatif pour l\'album: '.get_arr_value($AL_CONF, 'albumname').'</h1>
</div>
<!-- / Header -->
<div class="ranking">';
if($action != 'nocache' && $action != 'redocache' && is_readable($RANKING_FILENAME)){
include $RANKING_FILENAME;
}else{
/**
* MAKE RANKING CACHE FILE
*/
foreach(glob($ALBUM_ROOT.'votes/*') as $file){
if($file!='.' && $file!='..'){
if(substr($file,-7)=='jpg.txt'){
$votes_fname = $file;
$thumb_fname = substr($file, strrpos($file,DIRECTORY_SEPARATOR)+1,-4);
$points_fname = $ALBUM_ROOT.'votes/'.$thumb_fname.'.pts.txt';
//$thumb_fname = PUBLIC_ROOT.ALBUMS_DIR.$codalbum.'/photos/thumbs/'.$thumb_fname;
$votes = filesize($votes_fname);
$points = filesize($points_fname);
$avg = round($points / $votes, 1);
// Leer fichero $photo_filename.csv
//$photo_info = read_csv($ALBUM_ROOT.'photos/'.$thumb_fname.'.csv');
$LoP[] = array($thumb_fname, $votes, $points, $avg);
$aPoints[] = $points;
$aVotes[] = $votes;
$aAVG[] = $avg;
}
}
}
// Array sort
//array_multisort($aAVG, SORT_DESC, $aPoints, SORT_DESC, $aVotes, SORT_ASC, $LoP);
array_multisort($aAVG, SORT_DESC, $aVotes, SORT_ASC, $LoP);
*/
$LoP = get_ranking($ALBUM_ROOT.'votes/');
if($action != 'nocache' || $action == 'redocache'){
// Create and open cache file
$ranking_cache = new LOG($RANKING_FILENAME, false, true);
// Print result to cache file
foreach($LoP as $photo){
$i++;
$ranking_cache->insert('<div class="photo"><span class="pos">'.$i.'</span><span class="votes">'.$photo[1].'</span><span class="points">'.$photo[2].'</span><span class="avg" title="Moyenne">'.$photo[3].'</span><a href="'.PUBLIC_ROOT.FORMS_DIR.'vote.php?'.URI_QUERY_ALBUM.'='.$codalbum.'&'.URI_QUERY_PHOTO.'='.$photo[0].'"><img src="'.PUBLIC_ROOT.ALBUMS_DIR.$codalbum.'/photos/thumbs/'.$photo[0].'" /></a></div>', false);
}
// Close cache file
$ranking_cache->close();
// Import cache file
include $RANKING_FILENAME;
}else{
/**
* PRINT RANKING (NO CACHE FILE)
*/
// Print result
foreach($LoP as $photo){
$i++;
echo '<div class="photo"><span class="pos">'.$i.'</span><span class="votes">'.$photo[1].'</span><span class="points">'.$photo[2].'</span><span class="avg" title="Moyenne">'.round($photo[2] / $photo[1], 1).'</span><a href="'.PUBLIC_ROOT.FORMS_DIR.'vote.php?'.URI_QUERY_ALBUM.'='.$codalbum.'&'.URI_QUERY_PHOTO.'='.$photo[0].'"><img src="'.PUBLIC_ROOT.ALBUMS_DIR.$codalbum.'/photos/thumbs/'.$photo[0].'" /></a></div>'."\n", false;
}
}
}
echo '</div>
</body>
</html>';
?> |
// This is a part of the Microsoft Foundation Classes C++ library.
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include "stdafx.h"
#include "sal.h"
#define new DEBUG_NEW
// <API key>
AFX_STATIC void AFXAPI <API key>(LPCTSTR pszFontFace, WORD wFontSize,
int cxDlg, int cyDlg, SIZE* pSizePixel)
{
// Attempt to create the font to be used in the dialog box
UINT cxSysChar, cySysChar;
LOGFONT lf;
HDC hDC = ::GetDC(NULL);
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = -MulDiv(wFontSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
lf.lfWeight = FW_NORMAL;
lf.lfCharSet = DEFAULT_CHARSET;
Checked::tcsncpy_s(lf.lfFaceName, _countof(lf.lfFaceName), pszFontFace, _TRUNCATE);
HFONT hNewFont = CreateFontIndirect(&lf);
if (hNewFont != NULL)
{
HFONT hFontOld = (HFONT)SelectObject(hDC, hNewFont);
TEXTMETRIC tm;
GetTextMetrics(hDC, &tm);
cySysChar = tm.tmHeight + tm.tmExternalLeading;
SIZE size;
::<API key>(hDC,
_T("<API key>"), 52,
&size);
cxSysChar = (size.cx + 26) / 52;
SelectObject(hDC, hFontOld);
DeleteObject(hNewFont);
}
else
{
// Could not create the font so just use the system's values
cxSysChar = LOWORD(GetDialogBaseUnits());
cySysChar = HIWORD(GetDialogBaseUnits());
}
::ReleaseDC(NULL, hDC);
// Translate dialog units to pixels
pSizePixel->cx = MulDiv(cxDlg, cxSysChar, 4);
pSizePixel->cy = MulDiv(cyDlg, cySysChar, 8);
}
// IsDialogEx
AFX_STATIC inline BOOL IsDialogEx(const DLGTEMPLATE* pTemplate)
{
return ((DLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF;
}
// HasFont
AFX_STATIC inline BOOL HasFont(const DLGTEMPLATE* pTemplate)
{
return (DS_SETFONT &
(IsDialogEx(pTemplate) ? ((DLGTEMPLATEEX*)pTemplate)->style :
pTemplate->style));
}
// FontAttrSize
AFX_STATIC inline int FontAttrSize(BOOL bDialogEx)
{
return (int)sizeof(WORD) * (bDialogEx ? 3 : 1);
}
// CDialogTemplate - implementation class
CDialogTemplate::CDialogTemplate(const DLGTEMPLATE* pTemplate)
{
if (pTemplate == NULL)
{
m_hTemplate = NULL;
m_dwTemplateSize = 0;
m_bSystemFont = FALSE;
}
else
{
BOOL bSet=SetTemplate(pTemplate, GetTemplateSize(pTemplate));
if(!bSet)
{
<API key>();
}
}
}
CDialogTemplate::CDialogTemplate(HGLOBAL hTemplate)
{
if (hTemplate == NULL)
{
m_hTemplate = NULL;
m_dwTemplateSize = 0;
m_bSystemFont = FALSE;
}
else
{
DLGTEMPLATE* pTemplate = (DLGTEMPLATE*)GlobalLock(hTemplate);
BOOL bSet=SetTemplate(pTemplate, GetTemplateSize(pTemplate));
GlobalUnlock(hTemplate);
if(!bSet)
{
<API key>();
}
}
}
BOOL CDialogTemplate::SetTemplate(const DLGTEMPLATE* pTemplate, UINT cb)
{
m_dwTemplateSize = cb;
SIZE_T nAllocSize=m_dwTemplateSize + LF_FACESIZE * 2;
if (nAllocSize < m_dwTemplateSize)
{
return FALSE;
}
if ((m_hTemplate = GlobalAlloc(GPTR,nAllocSize)) == NULL)
{
return FALSE;
}
DLGTEMPLATE* pNew = (DLGTEMPLATE*)GlobalLock(m_hTemplate);
Checked::memcpy_s((BYTE*)pNew, (size_t)m_dwTemplateSize, pTemplate, (size_t)m_dwTemplateSize);
m_bSystemFont = (::HasFont(pNew) == 0);
GlobalUnlock(m_hTemplate);
return TRUE;
}
CDialogTemplate::~CDialogTemplate()
{
if (m_hTemplate != NULL)
GlobalFree(m_hTemplate);
}
BOOL CDialogTemplate::Load(LPCTSTR lpDialogTemplateID)
{
HINSTANCE hInst = <API key>(lpDialogTemplateID, RT_DIALOG);
if (hInst == NULL)
{
return FALSE;
}
HRSRC hRsrc = FindResource(hInst, lpDialogTemplateID, RT_DIALOG);
if (hRsrc == NULL)
{
return FALSE;
}
HGLOBAL hTemplate = LoadResource(hInst, hRsrc);
DLGTEMPLATE* pTemplate = (DLGTEMPLATE*)LockResource(hTemplate);
BOOL bSet=SetTemplate(pTemplate, (UINT)SizeofResource(hInst, hRsrc));
UnlockResource(hTemplate);
FreeResource(hTemplate);
return bSet;
}
HGLOBAL CDialogTemplate::Detach()
{
HGLOBAL hTmp = m_hTemplate;
m_hTemplate = NULL;
return hTmp;
}
BOOL CDialogTemplate::HasFont() const
{
DLGTEMPLATE* pTemplate = (DLGTEMPLATE*)GlobalLock(m_hTemplate);
BOOL bHasFont = ::HasFont(pTemplate);
GlobalUnlock(m_hTemplate);
return bHasFont;
}
inline WCHAR* _SkipString(_In_z_ WCHAR* p)
{
while (*p++);
return p;
}
BYTE* AFX_CDECL CDialogTemplate::GetFontSizeField(const DLGTEMPLATE* pTemplate)
{
BOOL bDialogEx = IsDialogEx(pTemplate);
WORD* pw;
if (bDialogEx)
pw = (WORD*)((DLGTEMPLATEEX*)pTemplate + 1);
else
pw = (WORD*)(pTemplate + 1);
if (*pw == (WORD)-1) // Skip menu name string or ordinal
pw += 2; // WORDs
else
while(*pw++);
if (*pw == (WORD)-1) // Skip class name string or ordinal
pw += 2; // WORDs
else
while(*pw++);
while (*pw++); // Skip caption string
return (BYTE*)pw;
}
UINT AFX_CDECL CDialogTemplate::GetTemplateSize(const DLGTEMPLATE* pTemplate)
{
BOOL bDialogEx = IsDialogEx(pTemplate);
BYTE* pb = GetFontSizeField(pTemplate);
if (::HasFont(pTemplate))
{
// Skip font size and name
pb += FontAttrSize(bDialogEx); // Skip font size, weight, (italic, charset)
pb += 2 * (wcslen((WCHAR*)pb) + 1);
}
WORD nCtrl = bDialogEx ? (WORD)((DLGTEMPLATEEX*)pTemplate)->cDlgItems :
(WORD)pTemplate->cdit;
while (nCtrl > 0)
{
pb = (BYTE*)(((DWORD_PTR)pb + 3) & ~DWORD_PTR(3)); // DWORD align
pb += (bDialogEx ? sizeof(DLGITEMTEMPLATEEX) : sizeof(DLGITEMTEMPLATE));
if (*(WORD*)pb == (WORD)-1) // Skip class name string or ordinal
pb += 2 * sizeof(WORD);
else
pb = (BYTE*)_SkipString((WCHAR*)pb);
if (*(WORD*)pb == (WORD)-1) // Skip text string or ordinal
pb += 2 * sizeof(WORD);
else
pb = (BYTE*)_SkipString((WCHAR*)pb);
WORD cbExtra = *(WORD*)pb; // Skip extra data
if (cbExtra != 0 && !bDialogEx)
cbExtra -= 2;
pb += sizeof(WORD) + cbExtra;
--nCtrl;
}
//IA64: Max dialog template size of 4GB should be fine
return UINT(pb - (BYTE*)pTemplate);
}
BOOL AFX_CDECL CDialogTemplate::GetFont(const DLGTEMPLATE* pTemplate,
CString& strFace, WORD& nFontSize)
{
ASSERT(pTemplate != NULL);
if (!::HasFont(pTemplate))
return FALSE;
BYTE* pb = GetFontSizeField(pTemplate);
nFontSize = *(WORD*)pb;
pb += FontAttrSize(IsDialogEx(pTemplate));
#if defined(_UNICODE)
// Copy font name
strFace = (LPCTSTR)pb;
#else
// Convert Unicode font name to MBCS
WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)pb, -1,
strFace.GetBufferSetLength(LF_FACESIZE), LF_FACESIZE, NULL, NULL);
strFace.ReleaseBuffer();
#endif
return TRUE;
}
BOOL CDialogTemplate::GetFont(CString& strFace, WORD& nFontSize) const
{
ASSERT(m_hTemplate != NULL);
DLGTEMPLATE* pTemplate = (DLGTEMPLATE*)GlobalLock(m_hTemplate);
BOOL bResult = GetFont(pTemplate, strFace, nFontSize);
GlobalUnlock(m_hTemplate);
return bResult;
}
BOOL CDialogTemplate::SetFont(LPCTSTR lpFaceName, WORD nFontSize)
{
ASSERT(m_hTemplate != NULL);
if (m_dwTemplateSize == 0)
return FALSE;
DLGTEMPLATE* pTemplate = (DLGTEMPLATE*)GlobalLock(m_hTemplate);
BOOL bDialogEx = IsDialogEx(pTemplate);
BOOL bHasFont = ::HasFont(pTemplate);
int cbFontAttr = FontAttrSize(bDialogEx);
if (bDialogEx)
((DLGTEMPLATEEX*)pTemplate)->style |= DS_SETFONT;
else
pTemplate->style |= DS_SETFONT;
int nFaceNameLen = lstrlen(lpFaceName);
if( nFaceNameLen >= LF_FACESIZE )
{
// Name too long
return FALSE;
}
#ifdef _UNICODE
int cbNew = cbFontAttr + ((nFaceNameLen + 1) * sizeof(TCHAR));
BYTE* pbNew = (BYTE*)lpFaceName;
#else
WCHAR wszFaceName [LF_FACESIZE];
int cbNew = cbFontAttr + 2 * MultiByteToWideChar(CP_ACP, 0, lpFaceName, -1, wszFaceName, LF_FACESIZE);
BYTE* pbNew = (BYTE*)wszFaceName;
#endif
if (cbNew < cbFontAttr)
{
return FALSE;
}
BYTE* pb = GetFontSizeField(pTemplate);
int cbOld = (int)(bHasFont ? cbFontAttr + 2 * (wcslen((WCHAR*)(pb + cbFontAttr)) + 1) : 0);
BYTE* pOldControls = (BYTE*)(((DWORD_PTR)pb + cbOld + 3) & ~DWORD_PTR(3));
BYTE* pNewControls = (BYTE*)(((DWORD_PTR)pb + cbNew + 3) & ~DWORD_PTR(3));
WORD nCtrl = bDialogEx ? (WORD)((DLGTEMPLATEEX*)pTemplate)->cDlgItems :
(WORD)pTemplate->cdit;
if (cbNew != cbOld && nCtrl > 0)
{
size_t nBuffLeftSize=(size_t)(m_dwTemplateSize - (pOldControls - (BYTE*)pTemplate));
if (nBuffLeftSize > m_dwTemplateSize)
{
return FALSE;
}
Checked::memmove_s(pNewControls,nBuffLeftSize, pOldControls, nBuffLeftSize);
}
*(WORD*)pb = nFontSize;
Checked::memmove_s(pb + cbFontAttr, cbNew - cbFontAttr, pbNew, cbNew - cbFontAttr);
//IA64: Max dialog template size of 4GB should be fine
m_dwTemplateSize += ULONG(pNewControls - pOldControls);
GlobalUnlock(m_hTemplate);
m_bSystemFont = FALSE;
return TRUE;
}
BOOL CDialogTemplate::SetSystemFont(WORD wSize)
{
LOGFONT lf;
LPCTSTR pszFace = _T("System");
WORD wDefSize = 10;
HFONT hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
if (hFont == NULL)
hFont = (HFONT)::GetStockObject(SYSTEM_FONT);
if (hFont != NULL)
{
if (::GetObject(hFont, sizeof(LOGFONT), &lf) != 0)
{
pszFace = lf.lfFaceName;
HDC hDC = ::GetDC(NULL);
if (lf.lfHeight < 0)
lf.lfHeight = -lf.lfHeight;
wDefSize = (WORD)MulDiv(lf.lfHeight, 72, GetDeviceCaps(hDC, LOGPIXELSY));
::ReleaseDC(NULL, hDC);
}
}
if (wSize == 0)
wSize = wDefSize;
return SetFont(pszFace, wSize);
}
void CDialogTemplate::<API key>(SIZE* pSize) const
{
ASSERT(m_hTemplate != NULL);
ASSERT_POINTER(pSize, SIZE);
DLGTEMPLATE* pTemplate = (DLGTEMPLATE*)GlobalLock(m_hTemplate);
if (IsDialogEx(pTemplate))
{
pSize->cx = ((DLGTEMPLATEEX*)pTemplate)->cx;
pSize->cy = ((DLGTEMPLATEEX*)pTemplate)->cy;
}
else
{
pSize->cx = pTemplate->cx;
pSize->cy = pTemplate->cy;
}
GlobalUnlock(m_hTemplate);
}
void CDialogTemplate::GetSizeInPixels(SIZE* pSize) const
{
ASSERT(m_hTemplate != NULL);
ASSERT_POINTER(pSize, SIZE);
if (m_bSystemFont)
{
<API key>(pSize);
DWORD dwDLU = GetDialogBaseUnits();
pSize->cx = (pSize->cx * LOWORD(dwDLU)) / 4;
pSize->cy = (pSize->cy * HIWORD(dwDLU)) / 8;
}
else
{
CString strFace;
WORD wSize = 10;
GetFont(strFace, wSize);
SIZE size;
<API key>(&size);
<API key>(strFace, wSize, size.cx, size.cy, pSize);
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace <API key>.AppData
{
public class <API key>
{
public long Id;
public short AttributeID;
public String Name;
public String Data;
public long ExerciseRecordID;
}
} |
<?php
/**
* Elgg search listing
*
* @package Elgg
* @subpackage Core
*/
$entities = $vars['results']['entities'];
$count = $vars['results']['count'] - count($entities);
if (!is_array($entities) || !count($entities)) {
return FALSE;
}
$query = http_build_query(
array(
'q' => $vars['params']['query'],
'entity_type' => $vars['params']['type'],
'entity_subtype' => $vars['params']['subtype'],
'limit' => get_input('limit', 10),
'offset' => get_input('offset', 0),
'search_type' => $vars['params']['search_type'],
//@todo include vars for sorting, order, and friend-only.
)
);
$url = "{$vars['url']}pg/search?$query";
// get pagination
if (array_key_exists('pagination', $vars) && $vars['pagination']) {
$nav .= elgg_view('navigation/pagination',array(
'baseurl' => $url,
'offset' => $vars['params']['offset'],
'count' => $vars['results']['count'],
'limit' => $vars['params']['limit'],
));
} else {
$nav = '';
}
// figure out what we're dealing with.
$type_str = NULL;
if (array_key_exists('type', $vars['params']) && array_key_exists('subtype', $vars['params'])) {
$type_str_tmp = "item:{$vars['params']['type']}:{$vars['params']['subtype']}";
$type_str_echoed = elgg_echo($type_str_tmp);
if ($type_str_echoed != $type_str_tmp) {
$type_str = $type_str_echoed;
}
}
if (!$type_str && array_key_exists('type', $vars['params'])) {
$type_str = elgg_echo("item:{$vars['params']['type']}");
}
if (!$type_str) {
$type_str = elgg_echo('search:unknown_entity');
}
// allow overrides for titles
$search_type_str = elgg_echo("search_types:{$vars['params']['search_type']}");
if (array_key_exists('search_type', $vars['params'])
&& $search_type_str != "search_types:{$vars['params']['search_type']}") {
$type_str = $search_type_str;
}
// get pagination
if (array_key_exists('pagination', $vars['params']) && $vars['params']['pagination']) {
$nav .= elgg_view('navigation/pagination',array(
'baseurl' => $url,
'offset' => $vars['params']['offset'],
'count' => $vars['results']['count'],
'limit' => $vars['params']['limit'],
));
} else {
$nav = '';
}
// get any more links.
$more_check = $vars['results']['count'] - ($vars['params']['offset'] + $vars['params']['limit']);
$more = ($more_check > 0) ? $more_check : 0;
if ($more) {
$title_key = ($more == 1) ? 'comment' : 'comments';
$more_str = sprintf(elgg_echo('search:more'), $count, $type_str);
$more_link = "<div class='search_listing'><a href=\"$url\">$more_str</a></div>";
} else {
$more_link = '';
}
$body = elgg_view_title($type_str);
foreach ($entities as $entity) {
if ($view = <API key>($vars['params'], 'entity')) {
$body .= elgg_view($view, array(
'entity' => $entity,
'params' => $vars['params'],
'results' => $vars['results']
));
}
}
echo $body;
echo $more_link;
echo $nav; |
#ifndef MODEL_READER
#define MODEL_READER
#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
struct aiScene * get_aiScene(char * path);
#endif |
package com.espertech.esper.util;
import com.espertech.esper.client.EventBean;
import com.espertech.esper.client.scopetest.EPAssertionUtil;
import com.espertech.esper.event.map.MapEventBean;
import junit.framework.TestCase;
import java.util.*;
public class TestCollectionUtil extends TestCase
{
public void <API key>() {
<API key>("a", "", "a");
<API key>("a,b", "a", "b");
<API key>("a,b,c", "a,b", "c");
<API key>("a,b,c,d", "a,b,c", "d");
}
public void <API key>() {
<API key>("", "", "");
<API key>("a,b", "a", "b");
<API key>("a,b", "", "a,b");
<API key>("b", "", "b");
<API key>("a,b,c", "a,b", "c");
<API key>("a,b,c", "", "a,b,c");
<API key>("a,b,c", "a", "b,c");
<API key>("a,b,c,d", "a,b,c", "d");
}
public void testArrayShrink() {
runAssertionShrink("a,c", "a,b,c", 1);
runAssertionShrink("b,c", "a,b,c", 0);
runAssertionShrink("a,b", "a,b,c", 2);
runAssertionShrink("a", "a,b", 1);
runAssertionShrink("b", "a,b", 0);
runAssertionShrink("", "a", 0);
}
private void runAssertionShrink(String expected, String existing, int index) {
String[] expectedArr = expected.length() == 0 ? new String[0] : expected.split(",");
String[] existingArr = existing.length() == 0 ? new String[0] : existing.split(",");
String[] resultAddColl = (String[]) CollectionUtil.<API key>(existingArr, index);
EPAssertionUtil.<API key>(expectedArr, resultAddColl);
}
private void <API key>(String expected, String existing, String coll) {
String[] expectedArr = expected.length() == 0 ? new String[0] : expected.split(",");
String[] existingArr = existing.length() == 0 ? new String[0] : existing.split(",");
Collection<String> addCollection = Arrays.asList(coll.length() == 0 ? new String[0] : coll.split(","));
String[] resultAddColl = (String[]) CollectionUtil.<API key>(existingArr, addCollection);
EPAssertionUtil.<API key>(expectedArr, resultAddColl);
String[] resultAddArr = (String[]) CollectionUtil.<API key>(existingArr, addCollection.toArray());
EPAssertionUtil.<API key>(expectedArr, resultAddArr);
}
private void <API key>(String expected, String existing, String single) {
String[] expectedArr = expected.length() == 0 ? new String[0] : expected.split(",");
String[] existingArr = existing.length() == 0 ? new String[0] : existing.split(",");
String[] result = (String[]) CollectionUtil.<API key>(existingArr, single);
EPAssertionUtil.<API key>(expectedArr, result);
}
public void <API key>() {
EventBean[] e = new EventBean[10];
for (int i = 0; i < e.length; i++) {
e[i] = new MapEventBean(null);
}
assertFalse(e[0].equals(e[1]));
Object[][] testData = new Object[][] {
{new EventBean[] {}, new EventBean[] {}, "p2"},
{new EventBean[] {}, new EventBean[] {e[0], e[1]}, "p2"},
{new EventBean[] {e[0]}, new EventBean[] {}, "p1"},
{new EventBean[] {e[0]}, new EventBean[] {e[0]}, "p1"},
{new EventBean[] {e[0]}, new EventBean[] {e[1]}, new EventBean[] {e[0], e[1]}},
{new EventBean[] {e[0], e[1]}, new EventBean[] {e[1]}, "p1"},
{new EventBean[] {e[0], e[1]}, new EventBean[] {e[0]}, "p1"},
{new EventBean[] {e[0]}, new EventBean[] {e[0], e[1]}, "p2"},
{new EventBean[] {e[1]}, new EventBean[] {e[0], e[1]}, "p2"},
{new EventBean[] {e[2]}, new EventBean[] {e[0], e[1]}, new EventBean[] {e[0], e[1], e[2]}},
{new EventBean[] {e[2], e[0]}, new EventBean[] {e[0], e[1]}, new EventBean[] {e[0], e[1], e[2]}},
{new EventBean[] {e[2], e[0]}, new EventBean[] {e[0], e[1], e[2]}, new EventBean[] {e[0], e[1], e[2]}}
};
for (int i = 0; i < testData.length; i++) {
EventBean[] p1 = (EventBean[]) testData[i][0];
EventBean[] p2 = (EventBean[]) testData[i][1];
Object expectedObj = testData[i][2];
Object result = CollectionUtil.<API key>(p1, p2);
if (expectedObj.equals("p1")) {
assertTrue(result == p1);
}
else if (expectedObj.equals("p2")) {
assertTrue(result == p2);
}
else {
EventBean[] resultArray = (EventBean[]) result;
EventBean[] expectedArray = (EventBean[]) result;
EPAssertionUtil.<API key>(resultArray, expectedArray);
}
}
}
public void testAddArray() {
tryAddStringArr("b,a".split(","), CollectionUtil.addArrays(new String[] {"b"}, new String[] {"a"}));
tryAddStringArr("a".split(","), CollectionUtil.addArrays(null, new String[] {"a"}));
tryAddStringArr("b".split(","), CollectionUtil.addArrays(new String[] {"b"}, null));
tryAddStringArr("a,b,c,d".split(","), CollectionUtil.addArrays(new String[] {"a", "b"}, new String[] {"c", "d"}));
assertEquals(null, CollectionUtil.addArrays(null, null));
Object result = CollectionUtil.addArrays(new int[] {1,2}, new int[] {3,4});
EPAssertionUtil.<API key>(new int[] {1,2,3,4}, (int[]) result);
try {
CollectionUtil.addArrays("a", null);
fail();
}
catch (<API key> ex) {
assertEquals("Parameter is not an array: a", ex.getMessage());
}
try {
CollectionUtil.addArrays(null, "b");
fail();
}
catch (<API key> ex) {
assertEquals("Parameter is not an array: b", ex.getMessage());
}
}
private void tryAddStringArr(String[] expected, Object result) {
assertTrue(result.getClass().isArray());
assertEquals(String.class, result.getClass().getComponentType());
EPAssertionUtil.<API key>(expected, (String[]) result);
}
public void testCopySort() {
Object[][] testdata = new Object[][] {
{new String[]{"a", "b"}, new String[] {"a", "b"}},
{new String[]{"b", "a"}, new String[] {"a", "b"}},
{new String[]{"a"}, new String[] {"a"}},
{new String[]{"c", "b", "a"}, new String[] {"a", "b", "c"}},
{new String[0], new String[0]},
};
for (int i = 0; i < testdata.length; i++)
{
String[] expected = (String[]) testdata[i][1];
String[] input = (String[]) testdata[i][0];
String[] received = CollectionUtil.copySortArray(input);
if (!Arrays.equals(expected, received)) {
fail("Failed for input " + Arrays.toString(input) + " expected " + Arrays.toString(expected) + " received " + Arrays.toString(received));
}
assertNotSame(input, expected);
}
}
public void testCompare()
{
Object[][] testdata = new Object[][] {
{new String[]{"a", "b"}, new String[]{"a", "b"}, true},
{new String[]{"a"}, new String[]{"a", "b"}, false},
{new String[]{"a"}, new String[]{"a"}, true},
{new String[]{"b"}, new String[]{"a"}, false},
{new String[]{"b", "a"}, new String[]{"a", "b"}, true},
{new String[]{"a", "b", "b"}, new String[]{"a", "b"}, false},
{new String[]{"a", "b", "b"}, new String[]{"b", "a", "b"}, true},
{new String[0], new String[0], true},
};
for (int i = 0; i < testdata.length; i++)
{
String[] left = (String[]) testdata[i][0];
String[] right = (String[]) testdata[i][1];
boolean expected = (Boolean) testdata[i][2];
assertEquals("Failed for input " + Arrays.toString(left), expected, CollectionUtil.sortCompare(left, right));
assertTrue(Arrays.equals(left, (String[]) testdata[i][0]));
assertTrue(Arrays.equals(right, (String[]) testdata[i][1]));
}
}
public void testToString()
{
Object[][] testdata = new Object[][] {
{new String[]{"a", "b"}, "a, b"},
{new String[]{"a"}, "a"},
{new String[]{""}, ""},
{new String[]{"", ""}, ""},
{new String[]{null, "b"}, "b"},
{new String[0], ""},
{null, "null"}
};
for (int i = 0; i < testdata.length; i++)
{
String expected = (String) testdata[i][1];
String[] input = (String[]) testdata[i][0];
assertEquals("Failed for input " + Arrays.toString(input), expected, CollectionUtil.toString(toSet(input)));
}
}
private Set<String> toSet(String[] arr)
{
if (arr == null)
{
return null;
}
if (arr.length == 0)
{
return new HashSet<String>();
}
Set<String> set = new LinkedHashSet<String>();
for (String a : arr)
{
set.add(a);
}
return set;
}
} |
#include "StdInc.h"
#include "CGarrisonInt.h"
#include "../gui/CGuiHandler.h"
#include "../CGameInfo.h"
#include "../CPlayerInterface.h"
#include "../widgets/Buttons.h"
#include "../widgets/TextControls.h"
#include "../windows/CCreatureWindow.h"
#include "../windows/GUIClasses.h"
#include "../../CCallback.h"
#include "../../lib/CGeneralTextHandler.h"
#include "../../lib/CCreatureHandler.h"
#include "../../lib/mapObjects/CGHeroInstance.h"
#include "../../lib/CGameState.h"
void CGarrisonSlot::setHighlight(bool on)
{
if (on)
selectionImage->enable(); //show
else
selectionImage->disable(); //hide
}
void CGarrisonSlot::hover (bool on)
{
/Hoverable::hover(on);
if(on)
{
std::string temp;
if(creature)
{
if(owner->getSelection())
{
if(owner->getSelection() == this)
{
temp = CGI->generaltexth->tcommands[4]; //View %s
boost::algorithm::replace_first(temp,"%s",creature->nameSing);
}
else if (owner->getSelection()->creature == creature)
{
temp = CGI->generaltexth->tcommands[2]; //Combine %s armies
boost::algorithm::replace_first(temp,"%s",creature->nameSing);
}
else if (owner->getSelection()->creature)
{
temp = CGI->generaltexth->tcommands[7]; //Exchange %s with %s
boost::algorithm::replace_first(temp,"%s",owner->getSelection()->creature->nameSing);
boost::algorithm::replace_first(temp,"%s",creature->nameSing);
}
else
{
logGlobal->warn("Warning - shouldn't be - highlighted void slot %d", owner->getSelection()->ID.getNum());
logGlobal->warn("Highlighted set to nullptr");
owner->selectSlot(nullptr);
}
}
else
{
if(upg == EGarrisonType::UP)
{
temp = CGI->generaltexth->tcommands[12]; //Select %s (in garrison)
}
else if(owner->armedObjs[0] && (owner->armedObjs[0]->ID == Obj::TOWN || owner->armedObjs[0]->ID == Obj::HERO))
{
temp = CGI->generaltexth->tcommands[32]; //Select %s (visiting)
}
else
{
temp = CGI->generaltexth->allTexts[481]; //Select %s
}
boost::algorithm::replace_first(temp,"%s",creature->nameSing);
}
}
else
{
if(owner->getSelection())
{
const CArmedInstance *highl = owner->getSelection()->getObj();
if( highl->needsLastStack() //we are moving stack from hero's
&& highl->stacksCount() == 1 //it's only stack
&& owner->getSelection()->upg != upg //we're moving it to the other garrison
)
{
temp = CGI->generaltexth->tcommands[5]; //Cannot move last army to garrison
}
else
{
temp = CGI->generaltexth->tcommands[6]; //Move %s
boost::algorithm::replace_first(temp,"%s",owner->getSelection()->creature->nameSing);
}
}
else
{
temp = CGI->generaltexth->tcommands[11]; //Empty
}
}
GH.statusbar->setText(temp);
}
else
{
GH.statusbar->clear();
}
}
const CArmedInstance * CGarrisonSlot::getObj() const
{
return owner->armedObjs[upg];
}
@return Whether the unit in the slot belongs to the current player.
bool CGarrisonSlot::our() const
{
return owner->owned[upg];
}
@return Whether the unit in the slot belongs to an ally but not to the current player.
bool CGarrisonSlot::ally() const
{
if(!getObj())
return false;
return PlayerRelations::ALLIES == LOCPLINT->cb->getPlayerRelations(LOCPLINT->playerID, getObj()->tempOwner);
}
The creature slot has been clicked twice, therefore the creature info should be shown
@return Whether the view should be refreshed
bool CGarrisonSlot::viewInfo()
{
UpgradeInfo pom;
LOCPLINT->cb->getUpgradeInfo(getObj(), ID, pom);
bool canUpgrade = getObj()->tempOwner == LOCPLINT->playerID && pom.oldID>=0; //upgrade is possible
bool canDismiss = getObj()->tempOwner == LOCPLINT->playerID && (getObj()->stacksCount()>1 || !getObj()->needsLastStack());
std::function<void(CreatureID)> upgr = nullptr;
std::function<void()> dism = nullptr;
if(canUpgrade) upgr = [=] (CreatureID newID) { LOCPLINT->cb->upgradeCreature(getObj(), ID, newID); };
if(canDismiss) dism = [=](){ LOCPLINT->cb->dismissCreature(getObj(), ID); };
owner->selectSlot(nullptr);
owner->setSplittingMode(false);
for(auto & elem : owner->splitButtons)
elem->block(true);
redraw();
GH.pushInt(new CStackWindow(myStack, dism, pom, upgr));
return true;
}
The selection is empty, therefore the creature should be moved
@return Whether the view should be refreshed
bool CGarrisonSlot::<API key>()
{
bool artSelected = false;
if (<API key>* chw = dynamic_cast<<API key>*>(GH.topInt())) //dirty solution
{
const std::shared_ptr<CArtifactsOfHero::SCommonPart> commonInfo = chw->artSets.front()->commonInfo;
if (const CArtifactInstance *art = commonInfo->src.art)
{
const CGHeroInstance *srcHero = commonInfo->src.AOH->getHero();
artSelected = true;
if (myStack) // try dropping the artifact only if the slot isn't empty
{
ArtifactLocation src(srcHero, commonInfo->src.slotID);
ArtifactLocation dst(myStack, ArtifactPosition::CREATURE_SLOT);
if (art->canBePutAt(dst, true))
{ //equip clicked stack
if(dst.getArt())
{
//creature can wear only one active artifact
//if we are placing a new one, the old one will be returned to the hero's backpack
LOCPLINT->cb->swapArtifacts(dst, ArtifactLocation(srcHero, dst.getArt()->firstBackpackSlot(srcHero)));
}
LOCPLINT->cb->swapArtifacts(src, dst);
}
}
}
}
if (!artSelected && creature)
{
owner->selectSlot(this);
if(creature)
{
for(auto & elem : owner->splitButtons)
elem->block(!our());
}
}
redraw();
return true;
}
The creature is only being partially moved
@return Whether the view should be refreshed
bool CGarrisonSlot::split()
{
const CGarrisonSlot * selection = owner->getSelection();
owner->p2 = ID; // store the second stack pos
owner->pb = upg; // store the second stack owner (up or down army)
owner->setSplittingMode(false);
int minLeft=0, minRight=0;
if(upg != selection->upg) // not splitting within same army
{
if(selection->getObj()->stacksCount() == 1 // we're splitting away the last stack
&& selection->getObj()->needsLastStack() )
{
minLeft = 1;
}
// destination army can't be emptied, unless we're rebalancing two stacks of same creature
if(getObj()->stacksCount() == 1
&& selection->creature == creature
&& getObj()->needsLastStack() )
{
minRight = 1;
}
}
int countLeft = selection->myStack ? selection->myStack->count : 0;
int countRight = myStack ? myStack->count : 0;
GH.pushInt(new CSplitWindow(selection->creature, std::bind(&CGarrisonInt::splitStacks, owner, _1, _2),
minLeft, minRight, countLeft, countRight));
return true;
}
If certain creates cannot be moved, the selection should change
Force reselection in these cases
* When attempting to take creatures from ally
* When attempting to swap creatures with an ally
* When attempting to take unremovable units
@return Whether reselection must be done
bool CGarrisonSlot::<API key>() const
{
const CGarrisonSlot * selection = owner->getSelection();
bool withAlly = selection->our() ^ our();
if (!creature || !selection->creature)
return false;
// Attempt to take creatures from ally (select theirs first)
if (!selection->our())
return true;
// Attempt to swap creatures with ally (select ours first)
if (selection->creature != creature && withAlly)
return true;
if (!owner->removableUnits)
{
if (selection->upg == EGarrisonType::UP)
return true;
else
return creature || upg == EGarrisonType::UP;
}
return false;
}
void CGarrisonSlot::clickRight(tribool down, bool previousState)
{
if(creature && down)
{
GH.pushInt(new CStackWindow(myStack, true));
}
}
void CGarrisonSlot::clickLeft(tribool down, bool previousState)
{
if(down)
{
bool refr = false;
const CGarrisonSlot * selection = owner->getSelection();
if(!selection)
refr = <API key>();
else if(selection == this)
refr = viewInfo();
// Re-highlight if troops aren't removable or not ours.
else if (<API key>())
{
if(creature)
owner->selectSlot(this);
redraw();
refr = true;
}
else
{
const CArmedInstance * selectedObj = owner->armedObjs[selection->upg];
bool <API key> = false;
if(selectedObj->stacksCount() == 1
&& owner->getSelection()->upg != upg
&& dynamic_cast<const CGHeroInstance*>(selectedObj))
{
<API key> = true;
}
if((owner->getSplittingMode() || LOCPLINT->shiftPressed()) // split window
&& (!creature || creature == selection->creature))
{
refr = split();
}
else if(!creature && <API key>) // split all except last creature
LOCPLINT->cb->splitStack(selectedObj, owner->armedObjs[upg], selection->ID, ID, selection->myStack->count - 1);
else if(creature != selection->creature) // swap
LOCPLINT->cb->swapCreatures(owner->armedObjs[upg], selectedObj, ID, selection->ID);
else if(<API key>) // merge last stack to other hero stack
refr = split();
else // merge
LOCPLINT->cb->mergeStacks(selectedObj, owner->armedObjs[upg], selection->ID, ID);
}
if(refr)
{
// Refresh Statusbar
hover(false);
hover(true);
}
}
}
void CGarrisonSlot::update()
{
if (getObj() != nullptr)
{
addUsedEvents(LCLICK | RCLICK | HOVER);
myStack = getObj()->getStackPtr(ID);
creature = myStack ? myStack->type : nullptr;
}
else
{
removeUsedEvents(LCLICK | RCLICK | HOVER);
myStack = nullptr;
creature = nullptr;
}
if (creature)
{
creatureImage->enable();
creatureImage->setFrame(creature->iconIndex);
stackCount->enable();
stackCount->setText(boost::lexical_cast<std::string>(myStack->count));
}
else
{
creatureImage->disable();
stackCount->disable();
}
}
CGarrisonSlot::CGarrisonSlot(CGarrisonInt *Owner, int x, int y, SlotID IID, CGarrisonSlot::EGarrisonType Upg, const CStackInstance * Creature):
ID(IID),
owner(Owner),
myStack(Creature),
creature(Creature ? Creature->type : nullptr),
upg(Upg)
{
<API key>;
if (getObj())
addUsedEvents(LCLICK | RCLICK | HOVER);
pos.x += x;
pos.y += y;
std::string imgName = owner->smallIcons ? "cprsmall" : "TWCRPORT";
creatureImage = new CAnimImage(imgName, creature ? creature->iconIndex : 0);
if (!creature)
creatureImage->disable();
selectionImage = new CAnimImage(imgName, 1);
selectionImage->disable();
if(Owner->smallIcons)
{
pos.w = 32;
pos.h = 32;
}
else
{
pos.w = 58;
pos.h = 64;
}
stackCount = new CLabel(pos.w, pos.h, owner->smallIcons ? FONT_TINY : FONT_MEDIUM, BOTTOMRIGHT, Colors::WHITE);
if (!creature)
stackCount->disable();
else
stackCount->setText(boost::lexical_cast<std::string>(myStack->count));
}
void CGarrisonInt::addSplitBtn(CButton * button)
{
addChild(button);
button->recActions = defActions;
splitButtons.push_back(button);
button->block(getSelection() == nullptr);
}
void CGarrisonInt::createSlots()
{
<API key>;
int distance = interx + (smallIcons? 32 : 58);
for(int i=0; i<2; i++)
{
std::vector<CGarrisonSlot*> garrisonSlots;
garrisonSlots.resize(7);
if (armedObjs[i])
{
for(auto & elem : armedObjs[i]->Slots())
{
garrisonSlots[elem.first.getNum()] = new CGarrisonSlot(this, i*garOffset.x + (elem.first.getNum()*distance), i*garOffset.y, elem.first, static_cast<CGarrisonSlot::EGarrisonType>(i), elem.second);
}
}
for(int j=0; j<7; j++)
{
if(!garrisonSlots[j])
garrisonSlots[j] = new CGarrisonSlot(this, i*garOffset.x + (j*distance), i*garOffset.y, SlotID(j), static_cast<CGarrisonSlot::EGarrisonType>(i), nullptr);
if (twoRows && j>=4)
{
garrisonSlots[j]->moveBy(Point(-126, 37));
}
}
std::copy(garrisonSlots.begin(), garrisonSlots.end(), std::back_inserter(availableSlots));
}
}
void CGarrisonInt::recreateSlots()
{
selectSlot(nullptr);
setSplittingMode(false);
for(auto & elem : splitButtons)
elem->block(true);
for(CGarrisonSlot * slot : availableSlots)
slot->update();
}
void CGarrisonInt::splitClick()
{
if(!getSelection())
return;
setSplittingMode(!getSplittingMode());
redraw();
}
void CGarrisonInt::splitStacks(int, int amountRight)
{
LOCPLINT->cb->splitStack(armedObjs[getSelection()->upg], armedObjs[pb], getSelection()->ID, p2, amountRight);
}
CGarrisonInt::CGarrisonInt(int x, int y, int inx, const Point &garsOffset,
SDL_Surface *pomsur, const Point& SurOffset,
const CArmedInstance *s1, const CArmedInstance *s2,
bool _removableUnits, bool smallImgs, bool _twoRows ) :
highlighted(nullptr),
inSplittingMode(false),
interx(inx),
garOffset(garsOffset),
pb(false),
smallIcons(smallImgs),
removableUnits(_removableUnits),
twoRows(_twoRows)
{
setArmy(s1, false);
setArmy(s2, true);
pos.x += x;
pos.y += y;
createSlots();
}
const CGarrisonSlot * CGarrisonInt::getSelection()
{
return highlighted;
}
void CGarrisonInt::selectSlot(CGarrisonSlot *slot)
{
if (slot != highlighted)
{
if (highlighted)
highlighted->setHighlight(false);
highlighted = slot;
for (auto button : splitButtons)
button->block(highlighted == nullptr || !slot->our());
if (highlighted)
highlighted->setHighlight(true);
}
}
void CGarrisonInt::setSplittingMode(bool on)
{
assert(on == false || highlighted != nullptr); //can't be in splitting mode without selection
if (inSplittingMode || on)
{
for(CGarrisonSlot * slot : availableSlots)
{
if(slot!=getSelection())
slot->setHighlight( ( on && (slot->our() || slot->ally()) && (slot->creature == nullptr || slot->creature == getSelection()->creature)));
}
inSplittingMode = on;
}
}
bool CGarrisonInt::getSplittingMode()
{
return inSplittingMode;
}
void CGarrisonInt::setArmy(const CArmedInstance *army, bool bottomGarrison)
{
owned[bottomGarrison] = army ? (army->tempOwner == LOCPLINT->playerID || army->tempOwner == PlayerColor::UNFLAGGABLE) : false;
armedObjs[bottomGarrison] = army;
}
CGarrisonWindow::CGarrisonWindow( const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits ):
CWindowObject(PLAYER_COLORED, "GARRISON")
{
<API key>;
garr = new CGarrisonInt(92, 127, 4, Point(0,96), background->bg, Point(93,127), up, down, removableUnits);
{
CButton *split = new CButton(Point(88, 314), "IDV6432.DEF", CButton::tooltip(CGI->generaltexth->tcommands[3], ""), [&](){ garr->splitClick(); } );
removeChild(split);
garr->addSplitBtn(split);
}
quit = new CButton(Point(399, 314), "IOK6432.DEF", CButton::tooltip(CGI->generaltexth->tcommands[8], ""), [&](){ close(); }, SDLK_RETURN);
std::string titleText;
if (down->tempOwner == up->tempOwner)
titleText = CGI->generaltexth->allTexts[709];
else
{
//assume that this is joining monsters dialog
if(up->Slots().size() > 0)
{
titleText = CGI->generaltexth->allTexts[35];
boost::algorithm::replace_first(titleText, "%s", up->Slots().begin()->second->type->namePl);
}
else
logGlobal->error("Invalid armed instance for garrison window.");
}
new CLabel(275, 30, FONT_BIG, CENTER, Colors::YELLOW, titleText);
new CAnimImage("CREST58", up->getOwner().getNum(), 0, 28, 124);
new CAnimImage("PortraitsLarge", down->portrait, 0, 29, 222);
}
CGarrisonHolder::CGarrisonHolder()
{
}
void CWindowWithGarrison::updateGarrisons()
{
garr->recreateSlots();
} |
/**
* External dependencies
*/
import { expect } from 'chai';
/**
* Internal dependencies
*/
import { action as ActionTypes } from 'lib/upgrades/constants';
import Dispatcher from 'dispatcher';
import <API key> from './../store';
describe( 'Domains Email Forwarding Store', () => {
const DOMAIN_NAME = 'dummy.com',
MAILBOX_NAME = 'dummy',
EMAIL = 'dummy@dummy.com',
FORWARD_ADDRESS = 'foo@foo.com',
EMAIL_FORWARDS = [ {
active: true,
domain: DOMAIN_NAME,
email: EMAIL,
forward_address: FORWARD_ADDRESS,
mailbox: MAILBOX_NAME
} ];
it( 'should be an object', () => {
expect( <API key> ).to.be.an( 'object' );
} );
it( 'should have initial state equal an empty object', () => {
expect( <API key>.get() ).to.be.eql( {} );
} );
it( 'should return initial domain state for the domain that has no data', () => {
expect( <API key>.getByDomainName( DOMAIN_NAME ) ).to.be.eql( {
hasLoadedFromServer: false,
isFetching: false,
list: null,
needsUpdate: true
} );
} );
it( 'should return an object with disabled needsUpdate and enabled isFetching flag when fetching domain data triggered', () => {
Dispatcher.handleViewAction( {
type: ActionTypes.<API key>,
domainName: DOMAIN_NAME
} );
expect( <API key>.getByDomainName( DOMAIN_NAME ) ).to.be.eql( {
hasLoadedFromServer: false,
isFetching: true,
list: null,
needsUpdate: false
} );
} );
it( 'should return an object with enabled needsUpdate and disabled isFetching flag when fetching domain data failed', () => {
Dispatcher.handleViewAction( {
type: ActionTypes.<API key>,
domainName: DOMAIN_NAME
} );
expect( <API key>.getByDomainName( DOMAIN_NAME ) ).to.be.eql( {
hasLoadedFromServer: false,
isFetching: false,
list: null,
needsUpdate: true
} );
} );
it( 'should return a list with email forwards when fetching domain data completed', () => {
Dispatcher.handleViewAction( {
type: ActionTypes.<API key>,
domainName: DOMAIN_NAME,
forwards: EMAIL_FORWARDS
} );
expect( <API key>.getByDomainName( DOMAIN_NAME ) ).to.be.eql( {
hasLoadedFromServer: true,
isFetching: false,
list: EMAIL_FORWARDS,
needsUpdate: false
} );
} );
it( 'should return an empty email forwards list when deleting mailbox completed', () => {
Dispatcher.handleViewAction( {
type: ActionTypes.<API key>,
domainName: DOMAIN_NAME,
mailbox: MAILBOX_NAME
} );
expect( <API key>.getByDomainName( DOMAIN_NAME ) ).to.be.eql( {
hasLoadedFromServer: true,
isFetching: false,
list: [],
needsUpdate: true
} );
} );
it( 'should return an email forwards list with temporary mailbox when adding mailbox completed', () => {
Dispatcher.handleViewAction( {
type: ActionTypes.<API key>,
domainName: DOMAIN_NAME,
mailbox: MAILBOX_NAME,
destination: FORWARD_ADDRESS
} );
expect( <API key>.getByDomainName( DOMAIN_NAME ) ).to.be.eql( {
hasLoadedFromServer: true,
isFetching: false,
list: [ {
active: true,
domain: DOMAIN_NAME,
email: EMAIL,
forward_address: FORWARD_ADDRESS,
mailbox: MAILBOX_NAME,
temporary: true
} ],
needsUpdate: true
} );
} );
} ); |
(function ($) {
/**
* Rewrite autocomplete inputs to pass the language of the node currently being
* edited in the path.
*
* This functionality ensures node autocompletes get suggestions for the node's
* language rather than the current interface language.
*/
Backdrop.behaviors.i18n = {
attach : function (context) {
if (Backdrop.settings && Backdrop.settings.i18n) {
$('form[id^=node-form]', context).find('input.autocomplete[value^=' + Backdrop.settings.i18n.interface_path + ']').each(function () {
$(this).val($(this).val().replace(Backdrop.settings.i18n.interface_path, Backdrop.settings.i18n.content_path));
});
}
}
};
})(jQuery); |
#include "afddefs.h"
DESCR__S_M3
/*
** NAME
** get_data - searches output log files for data
**
** SYNOPSIS
** void get_data(void)
**
** DESCRIPTION
** This function searches for the selected data in the output
** log file of the AFD. The following things can be selected:
** start & end time, file name, file length, directory and
** recipient. Only selected data will be shown in the list
** widget.
**
** RETURN VALUES
** None.
**
** AUTHOR
** H.Kiehl
**
** HISTORY
** 22.02.1998 H.Kiehl Created
** 17.02.1999 H.Kiehl Multiple recipients.
** 13.04.2002 H.Kiehl Separator definable via SEPARATOR_CHAR.
** 15.06.2005 H.Kiehl Added duplicate check.
** 15.08.2005 H.Kiehl Added Exec type.
**
*/
DESCR__E_M3
#include <stdio.h> /* sprintf() */
#include <string.h> /* strerror() */
#include <stdlib.h> /* malloc(), realloc(), free(), strtod() */
#include <time.h> /* time() */
#ifdef TM_IN_SYS_TIME
# include <sys/time.h>
#endif
#include <unistd.h> /* close() */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_MMAP
# include <sys/mman.h> /* mmap(), munmap() */
# ifndef MAP_FILE /* Required for BSD */
# define MAP_FILE 0 /* All others do not need it */
# endif
#endif
#include <errno.h>
#include <Xm/Xm.h>
#include <Xm/List.h>
#include <Xm/Text.h>
#include <Xm/LabelP.h>
#include "logdefs.h"
#include "mafd_ctrl.h"
#include "show_dlog.h"
#include "sdr_str.h"
#define MACRO_DEBUG
/* External global variables. */
extern Display *display;
extern Window main_window;
extern Widget appshell, /* CHECK_INTERRUPT() */
listbox_w,
scrollbar_w,
special_button_w,
statusbox_w,
summarybox_w;
extern int <API key>,
radio_set,
gt_lt_sign,
special_button_flag,
file_name_length,
<API key>,
no_of_log_files,
no_of_search_dirs,
no_of_search_dirids,
no_of_search_hosts;
extern unsigned int all_list_items;
extern XT_PTR_TYPE dr_toggles_set;
extern size_t search_file_size;
extern time_t start_time_val,
end_time_val;
extern char *p_work_dir,
search_file_name[],
**search_dir,
**search_dirid,
**search_recipient,
summary_str[],
total_summary_str[];
extern struct item_list *il;
extern struct info_data id;
extern struct sol_perm perm;
/* Local global variables. */
static unsigned int total_no_files,
unprintable_chars;
static time_t local_start_time,
local_end_time,
first_date_found;
static off_t file_size;
static double trans_time;
static char line[<API key> + SHOW_LONG_FORMAT + 1],
log_file[MAX_PATH_LENGTH],
*p_delete_reason,
*p_file_name,
*p_file_size,
*p_host_name,
*p_log_file,
*p_proc_user;
static XmStringTable str_list;
/* Local function prototypes. */
static char *search_time(char *, time_t, time_t, time_t, size_t);
static void display_data(int, time_t, time_t),
extract_data(char *, int),
no_criteria(register char *, char *, int, char *),
file_name_only(register char *, char *, int, char *),
file_size_only(register char *, char *, int, char *),
file_name_and_size(register char *, char *, int,
char *),
recipient_only(register char *, char *, int, char *),
<API key>(register char *, char *, int,
char *),
<API key>(register char *, char *, int,
char *),
<API key>(register char *, char *, int,
char *);
#define <API key>() \
{ \
if (((loops + 1) * LINES_BUFFERED - item_counter) <= LINES_BUFFERED)\
{ \
int new_int_size, \
new_char_size; \
\
new_char_size = (loops + 1) * LINES_BUFFERED; \
new_int_size = new_char_size * sizeof(int); \
\
if (((il[file_no].offset = realloc(il[file_no].offset, new_int_size)) == NULL) || \
((il[file_no].line_offset = realloc(il[file_no].line_offset, new_int_size)) == NULL))\
{ \
(void)xrec(FATAL_DIALOG, "realloc() error : %s (%s %d)",\
strerror(errno), __FILE__, __LINE__);\
return; \
} \
} \
}
#define IGNORE_ENTRY() \
{ \
while (*ptr != '\n')\
ptr++; \
ptr++; i
continue; \
}
#define INSERT_TIME_REASON(reason_pos) \
{ \
(void)memset(line, ' ', <API key> + file_name_length + 1);\
<API key> = (time_t)str2timet(ptr_start_line, NULL, 16);\
if (first_date_found == -1) \
{ \
first_date_found = <API key>; \
} \
p_ts = localtime(&<API key>); \
CONVERT_TIME(); \
(void)memcpy(p_delete_reason, sdrstr[(reason_pos)], MAX_REASON_LENGTH);\
}
#define COMMON_BLOCK() \
{ \
int count = 0; \
char job_id_str[MAX_INT_HEX_LENGTH + 1]; \
\
ptr++; \
il[file_no].offset[item_counter] = (int)(ptr - p_start_log_file);\
\
while ((*ptr != '\n') && (*ptr != SEPARATOR_CHAR) &&\
(count < MAX_INT_HEX_LENGTH)) \
{ \
job_id_str[count] = *ptr; \
count++; ptr++; \
} \
if (*ptr != SEPARATOR_CHAR) \
{ \
IGNORE_ENTRY(); \
} \
job_id_str[count] = '\0'; \
if (id.offset) \
{ \
ptr++; \
id.job_id = (unsigned int)strtoul(job_id_str, NULL, 16);\
count = 0; \
while ((*ptr != '\n') && (*ptr != SEPARATOR_CHAR) &&\
(count < MAX_INT_HEX_LENGTH)) \
{ \
job_id_str[count] = *ptr; \
count++; ptr++; \
} \
if (*ptr != SEPARATOR_CHAR) \
{ \
IGNORE_ENTRY(); \
} \
job_id_str[count] = '\0'; \
id.dir_id = (unsigned int)strtoul(job_id_str, NULL, 16);\
ptr++; \
while ((*ptr != SEPARATOR_CHAR) && (*ptr != '\n'))\
{ \
ptr++; /* Ignore unique ID. */ \
} \
} \
else \
{ \
unsigned int tmp_id; \
\
tmp_id = (unsigned int)strtoul(job_id_str, NULL, 16);\
if ((id.delete_reason_no == AGE_OUTPUT) || \
(id.delete_reason_no == NO_MESSAGE_FILE_DEL) ||\
(id.delete_reason_no == DUP_OUTPUT)) \
{ \
id.job_id = tmp_id; \
id.dir_id = 0; \
} \
else \
{ \
id.job_id = 0; \
id.dir_id = tmp_id; \
} \
} \
\
if ((no_of_search_dirs > 0) || (no_of_search_dirids > 0))\
{ \
int gotcha = NO, \
kk; \
\
id.dir[0] = '\0'; \
get_info(GOT_JOB_ID_DIR_ONLY); \
count = strlen((char *)id.dir); \
id.dir[count] = SEPARATOR_CHAR; \
id.dir[count + 1] = '\0'; \
\
for (kk = 0; kk < no_of_search_dirids; kk++) \
{ \
if (sfilter(search_dirid[kk], id.dir_id_str, 0) == 0)\
{ \
gotcha = YES; \
break; \
} \
} \
if (gotcha == NO) \
{ \
for (kk = 0; kk < no_of_search_dirs; kk++)\
{ \
if (sfilter(search_dir[kk], (char *)id.dir, SEPARATOR_CHAR) == 0)\
{ \
gotcha = YES; \
break; \
} \
} \
} \
if (gotcha == NO) \
{ \
IGNORE_ENTRY(); \
} \
} \
\
if (*ptr == SEPARATOR_CHAR) \
{ \
ptr++; \
j = 0; \
while ((*ptr != SEPARATOR_CHAR) && (*ptr != '\n') &&\
(j < <API key>)) \
{ \
*(p_proc_user + j) = *ptr; \
ptr++; j++; \
} \
} \
while (*ptr != '\n') \
{ \
ptr++; \
} \
item_counter++; \
str_list[i] = <API key>(line); \
ptr++; \
}
#define CHECK_LIST_LIMIT() \
{ \
if ((perm.list_limit > 0) && (item_counter > perm.list_limit))\
{ \
char msg_buffer[40]; \
\
(void)sprintf(msg_buffer, "List limit (%d) reached!",\
perm.list_limit); \
show_message(statusbox_w, msg_buffer); \
break; \
} \
}
#define <API key>(reason_pos) \
{ \
int ii; \
\
for (ii = 0; ii < no_of_search_hosts; ii++) \
{ \
if (sfilter(search_recipient[ii], ptr_start_line + LOG_DATE_LENGTH + 1, ' ') == 0)\
{ \
break; \
} \
} \
if (ii == no_of_search_hosts) \
{ \
IGNORE_ENTRY(); \
} \
else \
{ \
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;\
while (*ptr != SEPARATOR_CHAR) \
{ \
ptr++; \
} \
ptr++; \
if (*ptr == '/') \
{ \
/* Ignore the remote file name. */ \
while (*ptr != SEPARATOR_CHAR) \
{ \
ptr++; \
} \
ptr++; \
} \
\
j = 0; \
while (*ptr != SEPARATOR_CHAR) \
{ \
ptr++; j++; \
} \
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16); \
if ((gt_lt_sign == EQUAL_SIGN) && \
(tmp_file_size == search_file_size)) \
{ \
(void)memset(line, ' ', <API key> + file_name_length + 1);\
(void)memcpy(p_delete_reason, sdrstr[(reason_pos)], MAX_REASON_LENGTH);\
\
/* Write file size. */ \
print_file_size(p_file_size, tmp_file_size); \
} \
else if ((gt_lt_sign == LESS_THEN_SIGN) && \
(tmp_file_size < search_file_size)) \
{ \
(void)memset(line, ' ', <API key> + file_name_length + 1);\
(void)memcpy(p_delete_reason, sdrstr[(reason_pos)], MAX_REASON_LENGTH);\
\
/* Write file size. */ \
print_file_size(p_file_size, tmp_file_size); \
} \
else if ((gt_lt_sign == GREATER_THEN_SIGN) && \
(tmp_file_size > search_file_size)) \
{ \
(void)memset(line, ' ', <API key> + file_name_length + 1);\
(void)memcpy(p_delete_reason, sdrstr[(reason_pos)], MAX_REASON_LENGTH);\
\
/* Write file size. */ \
print_file_size(p_file_size, tmp_file_size); \
} \
else \
{ \
IGNORE_ENTRY(); \
} \
} \
}
#define <API key>(reason_pos) \
{ \
int ii; \
\
for (ii = 0; ii < no_of_search_hosts; ii++) \
{ \
if (sfilter(search_recipient[ii], ptr_start_line + LOG_DATE_LENGTH + 1, ' ') == 0)\
{ \
break; \
} \
} \
if (ii == no_of_search_hosts) \
{ \
IGNORE_ENTRY(); \
} \
else \
{ \
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;\
if (sfilter(search_file_name, ptr, SEPARATOR_CHAR) == 0)\
{ \
il[file_no].line_offset[item_counter] = (int)(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset - p_start_log_file);\
INSERT_TIME_REASON((reason_pos)); \
j = 0; \
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))\
{ \
if ((unsigned char)(*(ptr + j)) < ' ') \
{ \
*(p_file_name + j) = '?'; \
unprintable_chars++; \
} \
else \
{ \
*(p_file_name + j) = *(ptr + j); \
} \
j++; \
} \
ptr += j; \
} \
else \
{ \
IGNORE_ENTRY(); \
} \
} \
}
#define FILE_SIZE_ONLY(reason_pos) \
{ \
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;\
while (*ptr != SEPARATOR_CHAR) \
{ \
ptr++; \
} \
ptr++; \
if (*ptr == '/') \
{ \
/* Ignore the remote file name. */ \
while (*ptr != SEPARATOR_CHAR) \
{ \
ptr++; \
} \
ptr++; \
} \
\
j = 0; \
while (*ptr != SEPARATOR_CHAR) \
{ \
ptr++; j++; \
} \
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16); \
if ((gt_lt_sign == EQUAL_SIGN) && \
(tmp_file_size == search_file_size)) \
{ \
(void)memset(line, ' ', <API key> + file_name_length + 1);\
(void)memcpy(p_delete_reason, sdrstr[(reason_pos)], MAX_REASON_LENGTH);\
\
/* Write file size. */ \
print_file_size(p_file_size, tmp_file_size); \
} \
else if ((gt_lt_sign == LESS_THEN_SIGN) && \
(tmp_file_size < search_file_size)) \
{ \
(void)memset(line, ' ', <API key> + file_name_length + 1);\
(void)memcpy(p_delete_reason, sdrstr[(reason_pos)], MAX_REASON_LENGTH);\
\
/* Write file size. */ \
print_file_size(p_file_size, tmp_file_size); \
} \
else if ((gt_lt_sign == GREATER_THEN_SIGN) && \
(tmp_file_size > search_file_size)) \
{ \
(void)memset(line, ' ', <API key> + file_name_length + 1);\
(void)memcpy(p_delete_reason, sdrstr[(reason_pos)], MAX_REASON_LENGTH);\
\
/* Write file size. */ \
print_file_size(p_file_size, tmp_file_size); \
} \
else \
{ \
IGNORE_ENTRY(); \
} \
}
void
get_data(void)
{
int i,
j,
end_file_no = -1,
start_file_no = -1;
time_t end,
start;
char status_message[MAX_MESSAGE_LENGTH];
struct stat stat_buf;
XmString xstr;
/* Prepare log file name. */
p_log_file = log_file;
no_of_log_files = <API key>;
p_log_file += sprintf(log_file, "%s%s/%s", p_work_dir, LOG_DIR,
DELETE_BUFFER_FILE);
local_start_time = start_time_val;
local_end_time = end_time_val;
for (i = 0; i < no_of_log_files; i++)
{
(void)sprintf(p_log_file, "%d", i);
if (stat(log_file, &stat_buf) == 0)
{
if (((stat_buf.st_mtime + SWITCH_FILE_TIME) >= local_start_time) ||
(start_file_no == -1))
{
start_file_no = i;
}
if (local_end_time == -1)
{
if (end_file_no == -1)
{
end_file_no = i;
}
}
else if ((stat_buf.st_mtime >= local_end_time) || (end_file_no == -1))
{
end_file_no = i;
}
}
}
if ((str_list = (XmStringTable)XtMalloc(LINES_BUFFERED * sizeof(XmString))) == NULL)
{
(void)xrec(FATAL_DIALOG, "XtMalloc() error : %s (%s %d)",
strerror(errno), __FILE__, __LINE__);
return;
}
/* Allocate memory for item list. */
no_of_log_files = start_file_no - end_file_no + 1;
if ((il = malloc((no_of_log_files + 1) * sizeof(struct item_list))) == NULL)
{
(void)xrec(FATAL_DIALOG, "malloc() error : %s (%s %d)",
strerror(errno), __FILE__, __LINE__);
return;
}
for (i = 0; i < no_of_log_files; i++)
{
il[i].fp = NULL;
il[i].no_of_items = 0;
il[i].offset = NULL;
il[i].line_offset = NULL;
}
/* Initialise all pointer in line. */
p_file_name = line + 16;
p_file_size = p_file_name + file_name_length + 1;
p_host_name = p_file_size + <API key> + 2;
p_delete_reason = p_host_name + MAX_HOSTNAME_LENGTH + 1;
p_proc_user = p_delete_reason + MAX_REASON_LENGTH + 1;
*(line + <API key> + file_name_length) = '\0';
special_button_flag = STOP_BUTTON;
xstr = XmStringCreateLtoR("Stop", <API key>);
XtVaSetValues(special_button_w, XmNlabelString, xstr, NULL);
XmStringFree(xstr);
summary_str[0] = ' ';
summary_str[1] = '\0';
SHOW_SUMMARY_DATA();
(void)strcpy(status_message, "Searching -");
SHOW_MESSAGE();
CHECK_INTERRUPT();
start = time(NULL);
file_size = 0;
trans_time = 0.0;
total_no_files = 0;
first_date_found = -1;
unprintable_chars = 0;
j = 0;
for (i = start_file_no;
((i >= end_file_no) && (special_button_flag != STOP_BUTTON_PRESSED));
i
{
(void)sprintf(p_log_file, "%d", i);
(void)extract_data(log_file, j);
if ((perm.list_limit > 0) && (total_no_files >= perm.list_limit))
{
break;
}
}
end = time(NULL);
if ((perm.list_limit == 0) || (total_no_files < perm.list_limit))
{
if (total_no_files == 0)
{
i = sprintf(status_message, "No data found. ");
}
else
{
i = 0;
}
#if SIZEOF_TIME_T == 4
i += sprintf(status_message + i, "Search time: %lds",
#else
i += sprintf(status_message + i, "Search time: %llds",
#endif
(pri_time_t)(end - start));
if (unprintable_chars > 0)
{
(void)sprintf(status_message + i, " (%u unprintable chars!)",
unprintable_chars);
}
SHOW_MESSAGE();
}
special_button_flag = SEARCH_BUTTON;
xstr = XmStringCreateLtoR("Search", <API key>);
XtVaSetValues(special_button_w, XmNlabelString, xstr, NULL);
XmStringFree(xstr);
XtFree((char *)str_list);
return;
}
/*+++++++++++++++++++++++++++++ extract_data() ++++++++++++++++++++++++++*/
static void
extract_data(char *current_log_file, int file_no)
{
int fd;
time_t time_val,
earliest_entry,
latest_entry;
register char *ptr,
*ptr_start;
char *src,
*tmp_ptr,
*ptr_end;
struct stat stat_buf;
/* Check if file is there and get its size. */
if (stat(current_log_file, &stat_buf) < 0)
{
if (errno == ENOENT)
{
/* For some reason the file is not there. So lets */
/* assume we have found nothing. */
return;
}
else
{
(void)xrec(WARN_DIALOG, "Failed to stat() %s : %s (%s %d)",
current_log_file, strerror(errno), __FILE__, __LINE__);
return;
}
}
/* Make sure there is data in the log file. */
if (stat_buf.st_size == 0)
{
return;
}
if ((fd = open(current_log_file, O_RDONLY)) < 0)
{
(void)xrec(FATAL_DIALOG, "Failed to open() %s : %s (%s %d)",
current_log_file, strerror(errno), __FILE__, __LINE__);
return;
}
if ((il[file_no].fp = fdopen(fd, "r")) == NULL)
{
(void)xrec(FATAL_DIALOG, "fdopen() error : %s (%s %d)",
strerror(errno), __FILE__, __LINE__);
return;
}
#ifdef HAVE_MMAP
if ((src = mmap(NULL, stat_buf.st_size, PROT_READ,
(MAP_FILE | MAP_SHARED), fd, 0)) == (caddr_t) -1)
{
(void)xrec(FATAL_DIALOG, "Failed to mmap() %s : %s (%s %d)",
current_log_file, strerror(errno), __FILE__, __LINE__);
(void)close(fd);
return;
}
#else
if ((src = malloc(stat_buf.st_size)) == NULL)
{
(void)xrec(FATAL_DIALOG, "malloc() error : %s (%s %d)",
strerror(errno), __FILE__, __LINE__);
(void)close(fd);
return;
}
if (read(fd, src, stat_buf.st_size) != stat_buf.st_size)
{
(void)xrec(FATAL_DIALOG, "Failed to read() from %s : %s (%s %d)",
current_log_file, strerror(errno), __FILE__, __LINE__);
free(src);
(void)close(fd);
return;
}
#endif
/*
* Now we have the source data in the buffer 'src'. Lets
* search for the stuff the user wants to see. First
* collect this data in the buffer 'dst' and only after
* we have found all data will 'dst' be displayed. The
* destination buffer 'dst' will be realloced in sizes
* 10 * <API key> characters. Hope this will reduce
* memory usage a little bit.
*/
/* Get latest entry. */
tmp_ptr = src + stat_buf.st_size - 2;
while ((*tmp_ptr != '\n') && (src != tmp_ptr))
{
tmp_ptr
}
if (*tmp_ptr == '\n')
{
ptr = tmp_ptr + 1;
}
else
{
ptr = tmp_ptr;
}
time_val = (time_t)str2timet(ptr, NULL, 16);
latest_entry = time_val;
/* Get earliest entry. */
ptr = src;
time_val = (time_t)str2timet(ptr, NULL, 16);
earliest_entry = time_val;
if (local_start_time == -1)
{
ptr_start = src;
ptr_end = search_time(src, local_end_time, earliest_entry,
latest_entry, stat_buf.st_size);
}
else
{
/*
* Search for the first entry of 'local_start_time'. Get the very
* first time entry and see if this is not already higher than
* 'local_start_time', ie this is our first entry.
*/
if (earliest_entry >= local_start_time)
{
ptr_start = src;
}
else
{
ptr_start = search_time(src, local_start_time, earliest_entry,
latest_entry, stat_buf.st_size);
}
ptr_end = search_time(src, local_end_time, earliest_entry,
latest_entry, stat_buf.st_size);
}
if (ptr_start == ptr_end)
{
/* Free all memory we have allocated. */
#ifdef HAVE_MMAP
if (munmap(src, stat_buf.st_size) < 0)
{
(void)xrec(ERROR_DIALOG, "munmap() error : %s (%s %d)",
strerror(errno), __FILE__, __LINE__);
}
#else
free(src);
#endif
return;
}
/*
* So, start and end are found. Now lets do the real search,
* ie search for specific file names, recipient, etc.
*/
ptr = ptr_start;
if ((search_file_name[0] == '\0') && (search_file_size == -1) &&
(no_of_search_hosts == 0))
{
no_criteria(ptr_start, ptr_end, file_no, src);
}
else if ((search_file_name[0] != '\0') && (search_file_size == -1) &&
(no_of_search_hosts == 0))
{
file_name_only(ptr_start, ptr_end, file_no, src);
}
else if ((search_file_name[0] == '\0') && (search_file_size != -1) &&
(no_of_search_hosts == 0))
{
file_size_only(ptr_start, ptr_end, file_no, src);
}
else if ((search_file_name[0] != '\0') && (search_file_size != -1) &&
(no_of_search_hosts == 0))
{
file_name_and_size(ptr_start, ptr_end, file_no, src);
}
else if ((search_file_name[0] == '\0') && (search_file_size == -1) &&
(no_of_search_hosts != 0))
{
recipient_only(ptr_start, ptr_end, file_no, src);
}
else if ((search_file_name[0] != '\0') && (search_file_size == -1) &&
(no_of_search_hosts != 0))
{
<API key>(ptr_start, ptr_end, file_no, src);
}
else if ((search_file_name[0] == '\0') && (search_file_size != -1) &&
(no_of_search_hosts != 0))
{
<API key>(ptr_start, ptr_end, file_no, src);
}
else if ((search_file_name[0] != '\0') && (search_file_size != -1) &&
(no_of_search_hosts != 0))
{
<API key>(ptr_start, ptr_end, file_no, src);
}
else
{
(void)xrec(FATAL_DIALOG, "What's this!? Impossible! (%s %d)",
__FILE__, __LINE__);
return;
}
/* Free all memory we have allocated. */
get_info_free();
#ifdef HAVE_MMAP
if (munmap(src, stat_buf.st_size) < 0)
{
(void)xrec(ERROR_DIALOG, "munmap() error : %s (%s %d)",
strerror(errno), __FILE__, __LINE__);
}
#else
free(src);
#endif
return;
}
static char *
search_time(char *src,
time_t search_time_val,
time_t earliest_entry,
time_t latest_entry,
size_t size)
{
char *ptr,
*bs_ptr;
time_t time_val;
if ((search_time_val == -1) || (latest_entry < search_time_val))
{
return(src + size);
}
else
{
/*
* YUCK! Now we have to search for it! We know the
* time of the very first entry and the last entry. So
* lets see if 'search_time_val' is closer to the beginning
* or end in our buffer. Thats where we will start our
* search.
*/
if (abs(search_time_val - earliest_entry) >
abs(latest_entry - search_time_val))
{
/* Start search from end. */
bs_ptr = src + size - 2;
do
{
ptr = bs_ptr;
ptr -= LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3;
while ((ptr >= src) && (*ptr != '\n'))
{
ptr
}
bs_ptr = ptr - 1;
ptr++;
time_val = (time_t)str2timet(ptr, NULL, 16);
} while ((time_val >= search_time_val) && (ptr > src));
while (*ptr != '\n')
{
ptr++;
}
}
else /* Start search from beginning. */
{
ptr = src;
do
{
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3;
while (*ptr != '\n')
{
ptr++;
}
ptr++;
time_val = (time_t)str2timet(ptr, NULL, 16);
} while ((time_val < search_time_val) && (ptr < (src + size)));
while (*ptr != '\n')
{
ptr
}
}
return(ptr + 1);
}
}
/* Description: Reads everyting from ptr to ptr_end. It only checks if */
/* the transfer type is the correct one. */
static void
no_criteria(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
off_t tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
/* The easiest case! */
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
#ifdef MACRO_DEBUG
(void)memset(line, ' ', <API key> + file_name_length + 1);
<API key> = (time_t)str2timet(ptr_start_line, NULL, 16);
if (first_date_found == -1)
{
first_date_found = <API key>;
}
p_ts = localtime(&<API key>);
CONVERT_TIME();
(void)memcpy(p_delete_reason, sdrstr[id.delete_reason_no],
MAX_REASON_LENGTH);
#else
INSERT_TIME_REASON(id.delete_reason_no);
#endif
il[file_no].line_offset[item_counter] = (int)(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset - p_start_log_file);
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
j = 0;
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))
{
if ((unsigned char)(*(ptr + j)) < ' ')
{
*(p_file_name + j) = '?';
unprintable_chars++;
}
else
{
*(p_file_name + j) = *(ptr + j);
}
j++;
}
ptr += j;
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1,
MAX_HOSTNAME_LENGTH);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Write file size. */
j = 0;
while (*(ptr + j) != SEPARATOR_CHAR)
{
j++;
}
ptr += j;
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16);
print_file_size(p_file_size, tmp_file_size);
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
/* Description: Reads everyting from ptr to ptr_end and search for the */
/* file name search_file_name. It also checks if the */
/* transfer type is the correct one. */
static void
file_name_only(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
double tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
if (sfilter(search_file_name, ptr, SEPARATOR_CHAR) == 0)
{
il[file_no].line_offset[item_counter] = (int)(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset - p_start_log_file);
INSERT_TIME_REASON(id.delete_reason_no);
j = 0;
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))
{
if ((unsigned char)(*(ptr + j)) < ' ')
{
*(p_file_name + j) = '?';
unprintable_chars++;
}
else
{
*(p_file_name + j) = *(ptr + j);
}
j++;
}
ptr += j;
}
else
{
IGNORE_ENTRY();
}
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1, MAX_HOSTNAME_LENGTH);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Write file size. */
j = 0;
while (*(ptr + j) != SEPARATOR_CHAR)
{
j++;
}
ptr += j;
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16);
print_file_size(p_file_size, (off_t)tmp_file_size);
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
/* Description: Reads everyting from ptr to ptr_end and search for any */
/* file that is <, >, or = search_file_size. It also checks */
/* if the transfer type is the correct one. */
static void
file_size_only(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
double tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
FILE_SIZE_ONLY(id.delete_reason_no);
ptr = ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
il[file_no].line_offset[item_counter] = (int)(ptr - p_start_log_file);
<API key> = (time_t)str2timet(ptr_start_line, NULL, 16);
if (first_date_found == -1)
{
first_date_found = <API key>;
}
p_ts = localtime(&<API key>);
CONVERT_TIME();
j = 0;
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))
{
if ((unsigned char)(*(ptr + j)) < ' ')
{
*(p_file_name + j) = '?';
unprintable_chars++;
}
else
{
*(p_file_name + j) = *(ptr + j);
}
j++;
}
ptr += j;
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1, MAX_HOSTNAME_LENGTH);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* File size is already stored. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
/* Description: Reads everyting from ptr to ptr_end and search for the */
/* file name search_file_name that is <, >, or = */
/* search_file_size. It also checks if the transfer type is */
/* the correct one. */
static void
file_name_and_size(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
double tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
if (sfilter(search_file_name, ptr, SEPARATOR_CHAR) != 0)
{
IGNORE_ENTRY();
}
il[file_no].line_offset[item_counter] = (int)(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset - p_start_log_file);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Write file size. */
j = 0;
while (*(ptr + j) != SEPARATOR_CHAR)
{
j++;
}
ptr += j;
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16);
if ((gt_lt_sign == EQUAL_SIGN) &&
(tmp_file_size != search_file_size))
{
IGNORE_ENTRY();
}
else if ((gt_lt_sign == LESS_THEN_SIGN) &&
(tmp_file_size >= search_file_size))
{
IGNORE_ENTRY();
}
else if ((gt_lt_sign == GREATER_THEN_SIGN) &&
(tmp_file_size <= search_file_size))
{
IGNORE_ENTRY();
}
ptr = ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
(void)memset(line, ' ', <API key> + file_name_length + 1);
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1, MAX_HOSTNAME_LENGTH);
<API key> = (time_t)str2timet(ptr_start_line, NULL, 16);
if (first_date_found == -1)
{
first_date_found = <API key>;
}
p_ts = localtime(&<API key>);
CONVERT_TIME();
(void)memcpy(p_delete_reason, sdrstr[id.delete_reason_no],
MAX_REASON_LENGTH);
j = 0;
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))
{
if ((unsigned char)(*(ptr + j)) < ' ')
{
*(p_file_name + j) = '?';
unprintable_chars++;
}
else
{
*(p_file_name + j) = *(ptr + j);
}
j++;
}
ptr += j;
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Ignore file size. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
print_file_size(p_file_size, (off_t)tmp_file_size);
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
/* Description: Reads everyting from ptr to ptr_end and search for the */
/* recipient 'search_recipient. It also checks if the */
/* transfer type is the correct one. */
static void
recipient_only(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
double tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
for (j = 0; j < no_of_search_hosts; j++)
{
if (sfilter(search_recipient[j], ptr_start_line + LOG_DATE_LENGTH + 1, ' ') == 0)
{
INSERT_TIME_REASON(id.delete_reason_no);
break;
}
}
if (j == no_of_search_hosts)
{
IGNORE_ENTRY();
}
il[file_no].line_offset[item_counter] = (int)(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset - p_start_log_file);
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
j = 0;
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))
{
if ((unsigned char)(*(ptr + j)) < ' ')
{
*(p_file_name + j) = '?';
unprintable_chars++;
}
else
{
*(p_file_name + j) = *(ptr + j);
}
j++;
}
ptr += j;
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1, MAX_HOSTNAME_LENGTH);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Write file size. */
j = 0;
while (*(ptr + j) != SEPARATOR_CHAR)
{
j++;
}
ptr += j;
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16);
print_file_size(p_file_size, tmp_file_size);
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
static void
<API key>(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
double tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
<API key>(id.delete_reason_no);
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1, MAX_HOSTNAME_LENGTH);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Write file size. */
j = 0;
while (*(ptr + j) != SEPARATOR_CHAR)
{
j++;
}
ptr += j;
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16);
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
static void
<API key>(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
double tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
<API key>(id.delete_reason_no);
ptr = ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
il[file_no].line_offset[item_counter] = (int)(ptr - p_start_log_file);
<API key> = (time_t)str2timet(ptr_start_line, NULL, 16);
if (first_date_found == -1)
{
first_date_found = <API key>;
}
p_ts = localtime(&<API key>);
CONVERT_TIME();
j = 0;
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))
{
if ((unsigned char)(*(ptr + j)) < ' ')
{
*(p_file_name + j) = '?';
unprintable_chars++;
}
else
{
*(p_file_name + j) = *(ptr + j);
}
j++;
}
ptr += j;
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1, MAX_HOSTNAME_LENGTH);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* File size is already stored. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
static void
<API key>(register char *ptr,
char *ptr_end,
int file_no,
char *p_start_log_file)
{
register int i,
j;
int item_counter = 0,
loops = 0;
time_t now,
prev_time_val = 0L,
<API key> = 0L;
double tmp_file_size;
char hex_dr_str[4],
*ptr_start_line;
struct tm *p_ts;
hex_dr_str[3] = '\0';
do
{
/* Allocate memory for offset to job ID. */
<API key>();
for (i = 0; ((i < LINES_BUFFERED) && (ptr < ptr_end)); i++)
{
if (((i % 200) == 0) &&
((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL))
{
prev_time_val = now;
CHECK_INTERRUPT();
if (special_button_flag != STOP_BUTTON)
{
loops
break;
}
}
ptr_start_line = ptr;
if (*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2) == SEPARATOR_CHAR)
{
id.delete_reason_no = (int)(*(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1) - '0');
id.offset = 0;
}
else
{
hex_dr_str[0] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 1);
hex_dr_str[1] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 2);
hex_dr_str[2] = *(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3);
if (hex_dr_str[0] == '0')
{
hex_dr_str[0] = ' ';
if (hex_dr_str[1] == '0')
{
hex_dr_str[1] = ' ';
}
}
id.delete_reason_no = (int)strtol(hex_dr_str, NULL, 16);
id.offset = 2;
}
if ((id.delete_reason_no > MAX_DELETE_REASONS) ||
((dr_toggles_set & (1 << id.delete_reason_no)) == 0))
{
IGNORE_ENTRY();
}
for (j = 0; j < no_of_search_hosts; j++)
{
if (sfilter(search_recipient[j], ptr_start_line + LOG_DATE_LENGTH + 1, ' ') == 0)
{
break;
}
}
if (j == no_of_search_hosts)
{
IGNORE_ENTRY();
}
else
{
ptr += LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
if (sfilter(search_file_name, ptr, SEPARATOR_CHAR) != 0)
{
IGNORE_ENTRY();
}
}
il[file_no].line_offset[item_counter] = (int)(ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset - p_start_log_file);
/* If necessary, ignore rest of file name. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Get file size. */
j = 0;
while (*(ptr + j) != SEPARATOR_CHAR)
{
j++;
}
ptr += j;
tmp_file_size = (off_t)str2offt((ptr - j), NULL, 16);
if ((gt_lt_sign == EQUAL_SIGN) &&
(tmp_file_size != search_file_size))
{
IGNORE_ENTRY();
}
else if ((gt_lt_sign == LESS_THEN_SIGN) &&
(tmp_file_size >= search_file_size))
{
IGNORE_ENTRY();
}
else if ((gt_lt_sign == GREATER_THEN_SIGN) &&
(tmp_file_size <= search_file_size))
{
IGNORE_ENTRY();
}
ptr = ptr_start_line + LOG_DATE_LENGTH + 1 + MAX_HOSTNAME_LENGTH + 3 + id.offset;
(void)memset(line, ' ', <API key> + file_name_length + 1);
(void)memcpy(p_host_name, ptr_start_line + LOG_DATE_LENGTH + 1, MAX_HOSTNAME_LENGTH);
<API key> = (time_t)str2timet(ptr_start_line, NULL, 16);
if (first_date_found == -1)
{
first_date_found = <API key>;
}
p_ts = localtime(&<API key>);
CONVERT_TIME();
(void)memcpy(p_delete_reason, sdrstr[id.delete_reason_no],
MAX_REASON_LENGTH);
j = 0;
while ((*(ptr + j) != SEPARATOR_CHAR) && (j < file_name_length))
{
if ((unsigned char)(*(ptr + j)) < ' ')
{
*(p_file_name + j) = '?';
unprintable_chars++;
}
else
{
*(p_file_name + j) = *(ptr + j);
}
j++;
}
ptr += j;
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
ptr++;
/* Write file size. */
while (*ptr != SEPARATOR_CHAR)
{
ptr++;
}
print_file_size(p_file_size, (off_t)tmp_file_size);
/* Write transfer duration, job ID and additional reason. */
/* Also check if we have to check for directory name. */
COMMON_BLOCK();
file_size += tmp_file_size;
}
loops++;
/* Display what we have in buffer. */
display_data(i, first_date_found, <API key>);
/* Check if user has done anything. */
if ((time(&now) - prev_time_val) > CHECK_TIME_INTERVAL)
{
prev_time_val = now;
CHECK_INTERRUPT();
}
CHECK_LIST_LIMIT();
} while ((ptr < ptr_end) && (special_button_flag == STOP_BUTTON));
il[file_no].no_of_items = item_counter;
return;
}
static void
display_data(int i,
time_t first_date_found,
time_t <API key>)
{
register int j;
static int rotate;
char status_message[MAX_MESSAGE_LENGTH];
XmString xstr;
XExposeEvent xeev;
Dimension w, h;
<API key>(listbox_w, str_list, i, 0);
for (j = 0; j < i; j++)
{
XmStringFree(str_list[j]);
}
total_no_files += i;
rotate++;
if (rotate == 0)
{
(void)strcpy(status_message, "Searching -");
}
else if (rotate == 1)
{
(void)strcpy(status_message, "Searching \\");
}
else if (rotate == 2)
{
(void)strcpy(status_message, "Searching |");
}
else
{
(void)strcpy(status_message, "Searching /");
rotate = -1;
}
calculate_summary(summary_str, first_date_found, <API key>,
total_no_files, file_size);
(void)strcpy(total_summary_str, summary_str);
all_list_items = total_no_files;
xeev.type = Expose;
xeev.display = display;
xeev.window = main_window;
xeev.x = 0; xeev.y = 0;
XtVaGetValues(summarybox_w, XmNwidth, &w, XmNheight, &h, NULL);
xeev.width = w; xeev.height = h;
xstr = XmStringCreateLtoR(summary_str, <API key>);
XtVaSetValues(summarybox_w, XmNlabelString, xstr, NULL);
(XtClass(summarybox_w))->core_class.expose(summarybox_w, (XEvent *)&xeev, NULL);
XmStringFree(xstr);
xstr = XmStringCreateLtoR(status_message, <API key>);
XtVaSetValues(statusbox_w, XmNlabelString, xstr, NULL);
XmStringFree(xstr);
return;
} |
angularpressApp.directive('postArticle', function (post, wpAjax, $location, $rootScope,$routeParams) {
return{
restrict : 'E',
replace : true,
templateUrl: wpAjax.themeLocation.templateDir + '/library/scripts/directives/partials/post-article.html',
controller : 'PrimaryNavCtrl',
link : function (scope, element, attrs) {
angular.element('.<API key>').spin('large');
scope.is_link_visible = true;
scope.<API key>();
//$http request
if ($routeParams.primaryNav !== 'portfolio-post') {
post.get_post_ID(
function (data) {
//add borderbottom for blog posts and remove on frontpage
angular.element(".entry-body").css({
borderBottom: "0.063em solid #DDDDDD"
});
$rootScope.$on('$routeChangeSuccess', function () {
if ($location.path() === '/') {
angular.element(".entry-body").css({borderBottom: "none"});
}
});
angular.element('.<API key>').spin(false);
scope.$watch('$viewContentLoaded', function () {
//responsible to site <title> on posts. See MainCtrl. Related:SidebarCtrl
angular.element("nav a[rel=prev] span:nth-child(2),nav a[rel=next] span:nth-child(1)").on('click', function () {
scope.$emit('linkText', angular.element(this).text());
});
});
scope.siteurl = wpAjax.themeLocation.siteUrl;
scope.postUrl = scope.siteurl + $location.path();
/** @namespace data.previous_url */
scope.postPreviousUrl = data.previous_url;
/** @namespace data.next_url */
scope.postNextUrl = data.next_url;
scope.postId = data.post.id;
scope.postSlug = data.post.slug;
scope.postStatus = data.post.status;
scope.postType = data.post.type;
scope.postTitle = data.post.title;
scope.postContent = data.post.content;
scope.postDate = data.post.date;
scope.postAuthor = data.post.author.name;
//show footer links
scope.is_link_visible = false;
//is edit post link visible
scope.is_visible = angular.element('body').hasClass('admin-bar') && scope.postid !== '';
//show or hide previous/next link post
scope.is_previous_visible = data.previous_url !== undefined;
scope.is_next_visible = data.next_url !== undefined;
}, attrs.name);
}
//GET PORTFOLIO POST. NEED REFACTORING
else {
post.get_portfolio_post(
function (data) {
//add borderbottom for blog posts and remove on frontpage
angular.element(".entry-body").css({
borderBottom: "0.063em solid #DDDDDD"
});
$rootScope.$on('$routeChangeSuccess', function () {
if ($location.path() === '/') {
angular.element(".entry-body").css({borderBottom: "none"});
}
});
angular.element('.<API key>').spin(false);
scope.$watch('$viewContentLoaded', function () {
//responsible to site <title> on posts. See MainCtrl. Related:SidebarCtrl
angular.element("nav a[rel=prev] span:nth-child(2),nav a[rel=next] span:nth-child(1)").on('click', function () {
scope.$emit('linkText', angular.element(this).text());
});
});
scope.siteurl = wpAjax.themeLocation.siteUrl;
scope.postUrl = scope.siteurl + $location.path();
/** @namespace data.previous_url */
scope.postPreviousUrl = data.previous_url;
/** @namespace data.next_url */
scope.postNextUrl = data.next_url;
scope.postId = data.posts[0].ID;
scope.postSlug = data.posts[0].post_name;
scope.postStatus = data.posts[0].post_status;
scope.postType = data.posts[0].post_type;
scope.postTitle = data.posts[0].post_title;
scope.postContent = data.posts[0].post_content;
scope.postDate = data.posts[0].post_date;
scope.postAuthor = data.posts[0].post_author;
//show footer links
scope.is_link_visible = false;
//is edit post link visible
scope.is_visible = angular.element('body').hasClass('admin-bar') && scope.postid !== '';
//show or hide previous/next link post
scope.is_previous_visible = data.previous_url !== undefined;
scope.is_next_visible = data.next_url !== undefined;
}, attrs.name);
}
}
}
}); |
#pragma once
#include "lib/platform/util/StdString.h"
namespace CEC
{
class CCECTypeUtils
{
public:
/*!
* @brief Get the device type for the given logical address.
* @param address The address to get the type for.
* @return The type, or <API key> if unknown.
*/
static cec_device_type GetType(const cec_logical_address address)
{
switch (address)
{
case <API key>:
return <API key>;
case <API key>:
case <API key>:
case <API key>:
return <API key>;
case <API key>:
case <API key>:
case <API key>:
return <API key>;
case CECDEVICE_TUNER1:
case CECDEVICE_TUNER2:
case CECDEVICE_TUNER3:
case CECDEVICE_TUNER4:
return <API key>;
case CECDEVICE_TV:
return CEC_DEVICE_TYPE_TV;
default:
return <API key>;
}
}
/*!
* @brief Get the ackmask for all devices of the same type as the given logical address.
* @param address The address to get the ackmask for.
* @return The ackmask for this type.
*/
static uint16_t GetMaskForType(cec_logical_address address)
{
return GetMaskForType(GetType(address));
}
/*!
* @brief Get the ackmask for all devices of the given type.
* @param type The type to get the ackmask for.
* @return The ackmask for this type, or 0 of no types match.
*/
static uint16_t GetMaskForType(const cec_device_type type)
{
switch (type)
{
case <API key>:
{
<API key> addr;
addr.Clear();
addr.Set(<API key>);
return addr.AckMask();
}
case <API key>:
{
<API key> addr;
addr.Clear();
addr.Set(<API key>);
addr.Set(<API key>);
addr.Set(<API key>);
return addr.AckMask();
}
case <API key>:
{
<API key> addr;
addr.Clear();
addr.Set(<API key>);
addr.Set(<API key>);
addr.Set(<API key>);
return addr.AckMask();
}
case <API key>:
{
<API key> addr;
addr.Clear();
addr.Set(CECDEVICE_TUNER1);
addr.Set(CECDEVICE_TUNER2);
addr.Set(CECDEVICE_TUNER3);
addr.Set(CECDEVICE_TUNER4);
return addr.AckMask();
}
case CEC_DEVICE_TYPE_TV:
{
<API key> addr;
addr.Clear();
addr.Set(CECDEVICE_TV);
return addr.AckMask();
}
default:
return 0;
}
}
static const char *ToString(const cec_device_type type)
{
switch (type)
{
case <API key>:
return "audio system";
case <API key>:
return "playback device";
case <API key>:
return "recording device";
case <API key>:
return "reserved";
case <API key>:
return "tuner";
case CEC_DEVICE_TYPE_TV:
return "TV";
default:
return "unknown";
}
}
static const char *ToString(const cec_menu_state state)
{
switch (state)
{
case <API key>:
return "activated";
case <API key>:
return "deactivated";
default:
return "unknown";
}
}
static const char *ToString(const cec_version version)
{
switch (version)
{
case CEC_VERSION_1_2:
return "1.2";
case CEC_VERSION_1_2A:
return "1.2a";
case CEC_VERSION_1_3:
return "1.3";
case CEC_VERSION_1_3A:
return "1.3a";
case CEC_VERSION_1_4:
return "1.4";
default:
return "unknown";
}
}
static const char *ToString(const cec_power_status status)
{
switch (status)
{
case CEC_POWER_STATUS_ON:
return "on";
case <API key>:
return "standby";
case <API key>:
return "in transition from on to standby";
case <API key>:
return "in transition from standby to on";
default:
return "unknown";
}
}
static const char *ToString(const cec_logical_address address)
{
switch(address)
{
case <API key>:
return "Audio";
case CECDEVICE_BROADCAST:
return "Broadcast";
case CECDEVICE_FREEUSE:
return "Free use";
case <API key>:
return "Playback 1";
case <API key>:
return "Playback 2";
case <API key>:
return "Playback 3";
case <API key>:
return "Recorder 1";
case <API key>:
return "Recorder 2";
case <API key>:
return "Recorder 3";
case CECDEVICE_RESERVED1:
return "Reserved 1";
case CECDEVICE_RESERVED2:
return "Reserved 2";
case CECDEVICE_TUNER1:
return "Tuner 1";
case CECDEVICE_TUNER2:
return "Tuner 2";
case CECDEVICE_TUNER3:
return "Tuner 3";
case CECDEVICE_TUNER4:
return "Tuner 4";
case CECDEVICE_TV:
return "TV";
default:
return "unknown";
}
}
static const char *ToString(const <API key> mode)
{
switch (mode)
{
case <API key>:
return "skip forward wind";
case <API key>:
return "eject";
case <API key>:
return "reverse rewind";
case <API key>:
return "stop";
default:
return "unknown";
}
}
static const char *ToString(const cec_deck_info status)
{
switch (status)
{
case CEC_DECK_INFO_PLAY:
return "play";
case <API key>:
return "record";
case <API key>:
return "play reverse";
case CEC_DECK_INFO_STILL:
return "still";
case CEC_DECK_INFO_SLOW:
return "slow";
case <API key>:
return "slow reverse";
case <API key>:
return "fast forward";
case <API key>:
return "fast reverse";
case <API key>:
return "no media";
case CEC_DECK_INFO_STOP:
return "stop";
case <API key>:
return "info skip forward wind";
case <API key>:
return "info skip reverse rewind";
case <API key>:
return "info index search forward";
case <API key>:
return "info index search reverse";
case <API key>:
return "other";
case <API key>:
return "LG other";
default:
return "unknown";
}
}
static const char *ToString(const cec_opcode opcode)
{
switch (opcode)
{
case <API key>:
return "active source";
case <API key>:
return "image view on";
case <API key>:
return "text view on";
case <API key>:
return "inactive source";
case <API key>:
return "request active source";
case <API key>:
return "routing change";
case <API key>:
return "routing information";
case <API key>:
return "set stream path";
case CEC_OPCODE_STANDBY:
return "standby";
case <API key>:
return "record off";
case <API key>:
return "record on";
case <API key>:
return "record status";
case <API key>:
return "record tv screen";
case <API key>:
return "clear analogue timer";
case <API key>:
return "clear digital timer";
case <API key>:
return "clear external timer";
case <API key>:
return "set analogue timer";
case <API key>:
return "set digital timer";
case <API key>:
return "set external timer";
case <API key>:
return "set timer program title";
case <API key>:
return "timer cleared status";
case <API key>:
return "timer status";
case <API key>:
return "cec version";
case <API key>:
return "get cec version";
case <API key>:
return "give physical address";
case <API key>:
return "get menu language";
case <API key>:
return "report physical address";
case <API key>:
return "set menu language";
case <API key>:
return "deck control";
case <API key>:
return "deck status";
case <API key>:
return "give deck status";
case CEC_OPCODE_PLAY:
return "play";
case <API key>:
return "give tuner status";
case <API key>:
return "select analogue service";
case <API key>:
return "set digital service";
case <API key>:
return "tuner device status";
case <API key>:
return "tuner step decrement";
case <API key>:
return "tuner step increment";
case <API key>:
return "device vendor id";
case <API key>:
return "give device vendor id";
case <API key>:
return "vendor command";
case <API key>:
return "vendor command with id";
case <API key>:
return "vendor remote button down";
case <API key>:
return "vendor remote button up";
case <API key>:
return "set osd string";
case <API key>:
return "give osd name";
case <API key>:
return "set osd name";
case <API key>:
return "menu request";
case <API key>:
return "menu status";
case <API key>:
return "user control pressed";
case <API key>:
return "user control release";
case <API key>:
return "give device power status";
case <API key>:
return "report power status";
case <API key>:
return "feature abort";
case CEC_OPCODE_ABORT:
return "abort";
case <API key>:
return "give audio status";
case <API key>:
return "give audio mode status";
case <API key>:
return "report audio status";
case <API key>:
return "set system audio mode";
case <API key>:
return "system audio mode request";
case <API key>:
return "system audio mode status";
case <API key>:
return "set audio rate";
case <API key>:
return "start ARC";
case <API key>:
return "report ARC started";
case <API key>:
return "report ARC ended";
case <API key>:
return "request ARC start";
case <API key>:
return "request ARC end";
case CEC_OPCODE_END_ARC:
return "end ARC";
case CEC_OPCODE_CDC:
return "CDC";
case CEC_OPCODE_NONE:
return "poll";
default:
return "UNKNOWN";
}
}
static const char *ToString(const <API key> mode)
{
switch(mode)
{
case <API key>:
return "on";
case <API key>:
return "off";
default:
return "unknown";
}
}
static const char *ToString(const cec_audio_status UNUSED(status))
{
// TODO this is a mask
return "TODO";
}
static const char *ToString(const cec_vendor_id vendor)
{
switch (vendor)
{
case CEC_VENDOR_SAMSUNG:
return "Samsung";
case CEC_VENDOR_LG:
return "LG";
case <API key>:
return "Panasonic";
case CEC_VENDOR_PIONEER:
return "Pioneer";
case CEC_VENDOR_ONKYO:
return "Onkyo";
case CEC_VENDOR_YAMAHA:
return "Yamaha";
case CEC_VENDOR_PHILIPS:
return "Philips";
case CEC_VENDOR_SONY:
return "Sony";
case CEC_VENDOR_TOSHIBA:
case CEC_VENDOR_TOSHIBA2:
return "Toshiba";
case CEC_VENDOR_AKAI:
return "Akai";
case CEC_VENDOR_AOC:
return "AOC";
case CEC_VENDOR_BENQ:
return "Benq";
case CEC_VENDOR_DAEWOO:
return "Daewoo";
case CEC_VENDOR_GRUNDIG:
return "Grundig";
case CEC_VENDOR_MEDION:
return "Medion";
case CEC_VENDOR_SHARP:
return "Sharp";
case CEC_VENDOR_VIZIO:
return "Vizio";
case CEC_VENDOR_BROADCOM:
return "Broadcom";
case CEC_VENDOR_LOEWE:
return "Loewe";
case CEC_VENDOR_DENON:
return "Denon";
case CEC_VENDOR_MARANTZ:
return "Marantz";
case <API key>:
case <API key>:
return "Harman/Kardon";
case <API key>:
return "Pulse Eight";
default:
return "Unknown";
}
}
static const char *ToString(const cec_client_version version)
{
switch (version)
{
case <API key>:
return "pre-1.5";
case <API key>:
return "1.5.0";
case <API key>:
return "1.5.1";
case <API key>:
return "1.5.2";
case <API key>:
return "1.5.3";
case <API key>:
return "1.6.0";
case <API key>:
return "1.6.1";
case <API key>:
return "1.6.2";
case <API key>:
return "1.6.3";
case <API key>:
return "1.7.0";
case <API key>:
return "1.7.1";
case <API key>:
return "1.7.2";
case <API key>:
return "1.8.0";
case <API key>:
return "1.8.1";
case <API key>:
return "1.8.2";
case <API key>:
return "1.9.0";
case <API key>:
return "2.0.0-pre";
case <API key>:
return "2.0.0";
case <API key>:
return "2.0.1";
case <API key>:
return "2.0.2";
case <API key>:
return "2.0.3";
case <API key>:
return "2.0.4";
case <API key>:
return "2.0.5";
case <API key>:
return "2.1.0";
case <API key>:
return "2.1.1";
case <API key>:
return "2.1.2";
case <API key>:
return "2.1.3";
case <API key>:
return "2.1.4";
case <API key>:
return "2.2.0";
default:
return "Unknown";
}
}
static const char *ToString(const cec_server_version version)
{
switch (version)
{
case <API key>:
return "pre-1.5";
case <API key>:
return "1.5.0";
case <API key>:
return "1.5.1";
case <API key>:
return "1.5.2";
case <API key>:
return "1.5.3";
case <API key>:
return "1.6.0";
case <API key>:
return "1.6.1";
case <API key>:
return "1.6.2";
case <API key>:
return "1.6.3";
case <API key>:
return "1.7.0";
case <API key>:
return "1.7.1";
case <API key>:
return "1.7.2";
case <API key>:
return "1.8.0";
case <API key>:
return "1.8.1";
case <API key>:
return "1.8.2";
case <API key>:
return "1.9.0";
case <API key>:
return "2.0.0-pre";
case <API key>:
return "2.0.0";
case <API key>:
return "2.0.1";
case <API key>:
return "2.0.2";
case <API key>:
return "2.0.3";
case <API key>:
return "2.0.4";
case <API key>:
return "2.0.5";
case <API key>:
return "2.1.0";
case <API key>:
return "2.1.1";
case <API key>:
return "2.1.2";
case <API key>:
return "2.1.3";
case <API key>:
return "2.1.4";
case <API key>:
return "2.2.0";
default:
return "Unknown";
}
}
static const char *ToString(const cec_abort_reason reason)
{
switch(reason)
{
case <API key>:
return "unrecognised opcode";
case <API key>:
return "not in correct mode to respond";
case <API key>:
return "cannot provide source";
case <API key>:
return "invalid operand";
case <API key>:
return "refused";
default:
return "unknown";
}
}
static const char *ToString(const <API key> key)
{
switch (key)
{
case <API key>:
return "select";
case <API key>:
return "up";
case <API key>:
return "down";
case <API key>:
return "left";
case <API key>:
return "right";
case <API key>:
return "right+up";
case <API key>:
return "right+down";
case <API key>:
return "left+up";
case <API key>:
return "left+down";
case <API key>:
return "root menu";
case <API key>:
return "setup menu";
case <API key>:
return "contents menu";
case <API key>:
return "favourite menu";
case <API key>:
return "exit";
case <API key>:
return "top menu";
case <API key>:
return "dvd menu";
case <API key>:
return "number entry mode";
case <API key>:
return "11";
case <API key>:
return "12";
case <API key>:
return "0";
case <API key>:
return "1";
case <API key>:
return "2";
case <API key>:
return "3";
case <API key>:
return "4";
case <API key>:
return "5";
case <API key>:
return "6";
case <API key>:
return "7";
case <API key>:
return "8";
case <API key>:
return "9";
case <API key>:
return ".";
case <API key>:
return "enter";
case <API key>:
return "clear";
case <API key>:
return "next favourite";
case <API key>:
return "channel up";
case <API key>:
return "channel down";
case <API key>:
return "previous channel";
case <API key>:
return "sound select";
case <API key>:
return "input select";
case <API key>:
return "display information";
case <API key>:
return "help";
case <API key>:
return "page up";
case <API key>:
return "page down";
case <API key>:
return "power";
case <API key>:
return "volume up";
case <API key>:
return "volume down";
case <API key>:
return "mute";
case <API key>:
return "play";
case <API key>:
return "stop";
case <API key>:
return "pause";
case <API key>:
return "record";
case <API key>:
return "rewind";
case <API key>:
return "Fast forward";
case <API key>:
return "eject";
case <API key>:
return "forward";
case <API key>:
return "backward";
case <API key>:
return "stop record";
case <API key>:
return "pause record";
case <API key>:
return "angle";
case <API key>:
return "sub picture";
case <API key>:
return "video on demand";
case <API key>:
return "electronic program guide";
case <API key>:
return "timer programming";
case <API key>:
return "initial configuration";
case <API key>:
return "select broadcast type";
case <API key>:
return "select sound presentation";
case <API key>:
return "play (function)";
case <API key>:
return "pause play (function)";
case <API key>:
return "record (function)";
case <API key>:
return "pause record (function)";
case <API key>:
return "stop (function)";
case <API key>:
return "mute (function)";
case <API key>:
return "restore volume";
case <API key>:
return "tune";
case <API key>:
return "select media";
case <API key>:
return "select AV input";
case <API key>:
return "select audio input";
case <API key>:
return "power toggle";
case <API key>:
return "power off";
case <API key>:
return "power on";
case <API key>:
return "F1 (blue)";
case <API key>:
return "F2 (red)";
case <API key>:
return "F3 (green)";
case <API key>:
return "F4 (yellow)";
case <API key>:
return "F5";
case <API key>:
return "data";
case <API key>:
return "return (Samsung)";
case <API key>:
return "channels list (Samsung)";
default:
return "unknown";
}
}
static const char *ToString(const cec_adapter_type type)
{
switch (type)
{
case <API key>:
return "Pulse-Eight USB-CEC Adapter";
case <API key>:
return "Pulse-Eight USB-CEC Daughterboard";
case ADAPTERTYPE_RPI:
return "Raspberry Pi";
case ADAPTERTYPE_TDA995x:
return "TDA995x";
default:
return "unknown";
}
}
static bool <API key>(uint16_t iParent, uint16_t iChild)
{
for (int iPtr = 3; iPtr >= 0; iPtr
{
if (((iParent >> 4*iPtr) & 0xF) > 0 &&
((iParent >> 4*iPtr) & 0xF) != ((iChild >> 4*iPtr) & 0xF))
return false;
}
return true;
}
static CStdString ToString(const cec_command& command)
{
CStdString dataStr;
dataStr.Format(">> %1x%1x", command.initiator, command.destination);
if (command.opcode_set == 1)
dataStr.AppendFormat(":%02x", command.opcode);
for (uint8_t iPtr = 0; iPtr < command.parameters.size; iPtr++)
dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]);
return dataStr;
}
};
} |
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes (jersey-bundle 1.19 API)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameHeadingFont">
<B>All Classes</B></FONT>
<BR>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="com/sun/jersey/api/client/<API key>.html" title="class in com.sun.jersey.api.client" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/model/AbstractField.html" title="class in com.sun.jersey.api.model" target="classFrame">AbstractField</A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="class in com.sun.jersey.api.model" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/provider/jaxb/<API key>.html" title="class in com.sun.jersey.core.provider.jaxb" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/provider/jaxb/<API key>.html" title="class in com.sun.jersey.core.provider.jaxb" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/provider/jaxb/<API key>.html" title="class in com.sun.jersey.core.provider.jaxb" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/provider/jaxb/<API key>.JaxbTypeChecker.html" title="interface in com.sun.jersey.core.provider.jaxb" target="classFrame"><I><API key>.JaxbTypeChecker</I></A>
<BR>
<A HREF="com/sun/jersey/core/provider/<API key>.html" title="class in com.sun.jersey.core.provider" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/model/AbstractMethod.html" title="class in com.sun.jersey.api.model" target="classFrame">AbstractMethod</A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="interface in com.sun.jersey.api.model" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="interface in com.sun.jersey.api.model" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/model/AbstractResource.html" title="class in com.sun.jersey.api.model" target="classFrame">AbstractResource</A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="class in com.sun.jersey.api.model" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="class in com.sun.jersey.api.model" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="interface in com.sun.jersey.api.model" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="interface in com.sun.jersey.api.model" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/provider/jaxb/<API key>.html" title="class in com.sun.jersey.core.provider.jaxb" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/<API key>.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="class in com.sun.jersey.api.model" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="class in com.sun.jersey.api.model" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/model/<API key>.html" title="class in com.sun.jersey.api.model" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/<API key>.html" title="class in com.sun.jersey.server.wadl.generators" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/<API key>.HasType.html" title="interface in com.sun.jersey.server.wadl.generators" target="classFrame"><I><API key>.HasType</I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/<API key>.WantsName.html" title="interface in com.sun.jersey.server.wadl.generators" target="classFrame"><I><API key>.WantsName</I></A>
<BR>
<A HREF="com/sun/jersey/core/header/<API key>.html" title="class in com.sun.jersey.core.header" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/header/AcceptableMediaType.html" title="class in com.sun.jersey.core.header" target="classFrame">AcceptableMediaType</A>
<BR>
<A HREF="com/sun/jersey/core/header/AcceptableToken.html" title="class in com.sun.jersey.core.header" target="classFrame">AcceptableToken</A>
<BR>
<A HREF="com/sun/jersey/core/osgi/Activator.html" title="class in com.sun.jersey.core.osgi" target="classFrame">Activator</A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="class in com.sun.jersey.spi.container" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="class in com.sun.jersey.spi.container" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/AnnotatedContext.html" title="class in com.sun.jersey.core.spi.component" target="classFrame">AnnotatedContext</A>
<BR>
<A HREF="com/sun/jersey/core/reflection/AnnotatedMethod.html" title="class in com.sun.jersey.core.reflection" target="classFrame">AnnotatedMethod</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">AnnotationDocType</A>
<BR>
<A HREF="com/sun/jersey/spi/scanning/<API key>.html" title="class in com.sun.jersey.spi.scanning" target="classFrame"><API key></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/AnnotationVisitor.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">AnnotationVisitor</A>
<BR>
<A HREF="javax/ws/rs/core/Application.html" title="class in javax.ws.rs.core" target="classFrame">Application</A>
<BR>
<A HREF="com/sun/jersey/api/core/ApplicationAdapter.html" title="class in com.sun.jersey.api.core" target="classFrame">ApplicationAdapter</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/<API key>.html" title="class in com.sun.jersey.server.wadl" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/<API key>.ExternalGrammar.html" title="class in com.sun.jersey.server.wadl" target="classFrame"><API key>.ExternalGrammar</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/ApplicationDocs.html" title="class in com.sun.jersey.server.wadl.generators" target="classFrame">ApplicationDocs</A>
<BR>
<A HREF="javax/ws/rs/ApplicationPath.html" title="annotation in javax.ws.rs" target="classFrame">ApplicationPath</A>
<BR>
<A HREF="com/sun/jersey/api/client/async/AsyncClientHandler.html" title="interface in com.sun.jersey.api.client.async" target="classFrame"><I>AsyncClientHandler</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/client/AsyncViewResource.html" title="class in com.sun.jersey.api.client" target="classFrame">AsyncViewResource</A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/client/AsyncWebResource.html" title="class in com.sun.jersey.api.client" target="classFrame">AsyncWebResource</A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/Attribute.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">Attribute</A>
<BR>
<A HREF="com/sun/jersey/core/util/Base64.html" title="class in com.sun.jersey.core.util" target="classFrame">Base64</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.html" title="class in com.sun.jersey.core.spi.scanning.uri" target="classFrame">BundleSchemeScanner</A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/ByteVector.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">ByteVector</A>
<BR>
<A HREF="javax/ws/rs/core/CacheControl.html" title="class in javax.ws.rs.core" target="classFrame">CacheControl</A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="class in com.sun.jersey.spi.container" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">ClassDocType</A>
<BR>
<A HREF="com/sun/jersey/api/core/<API key>.html" title="class in com.sun.jersey.api.core" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/core/<API key>.html" title="class in com.sun.jersey.api.core" target="classFrame"><API key></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/ClassReader.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">ClassReader</A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/ClassVisitor.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">ClassVisitor</A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/ClassWriter.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">ClassWriter</A>
<BR>
<A HREF="com/sun/jersey/api/client/Client.html" title="class in com.sun.jersey.api.client" target="classFrame">Client</A>
<BR>
<A HREF="com/sun/jersey/api/client/config/ClientConfig.html" title="interface in com.sun.jersey.api.client.config" target="classFrame"><I>ClientConfig</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/ClientFilter.html" title="class in com.sun.jersey.api.client.filter" target="classFrame">ClientFilter</A>
<BR>
<A HREF="com/sun/jersey/api/client/ClientHandler.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I>ClientHandler</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="class in com.sun.jersey.api.client" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/client/ClientRequest.html" title="class in com.sun.jersey.api.client" target="classFrame">ClientRequest</A>
<BR>
<A HREF="com/sun/jersey/api/client/ClientRequest.Builder.html" title="class in com.sun.jersey.api.client" target="classFrame">ClientRequest.Builder</A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/client/ClientResponse.html" title="class in com.sun.jersey.api.client" target="classFrame">ClientResponse</A>
<BR>
<A HREF="com/sun/jersey/api/client/ClientResponse.Status.html" title="enum in com.sun.jersey.api.client" target="classFrame">ClientResponse.Status</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/ClientSide.html" title="class in com.sun.jersey.spi.inject" target="classFrame">ClientSide</A>
<BR>
<A HREF="com/sun/jersey/spi/CloseableService.html" title="interface in com.sun.jersey.spi" target="classFrame"><I>CloseableService</I></A>
<BR>
<A HREF="com/sun/jersey/core/util/Closing.html" title="class in com.sun.jersey.core.util" target="classFrame">Closing</A>
<BR>
<A HREF="com/sun/jersey/core/util/Closing.Closure.html" title="interface in com.sun.jersey.core.util" target="classFrame"><I>Closing.Closure</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="class in com.sun.jersey.api.client" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/provider/CompletableReader.html" title="interface in com.sun.jersey.core.provider" target="classFrame"><I>CompletableReader</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/<API key>.html" title="class in com.sun.jersey.core.spi.component" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ComponentContext.html" title="interface in com.sun.jersey.core.spi.component" target="classFrame"><I>ComponentContext</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ComponentDestructor.html" title="class in com.sun.jersey.core.spi.component" target="classFrame">ComponentDestructor</A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ComponentInjector.html" title="class in com.sun.jersey.core.spi.component" target="classFrame">ComponentInjector</A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ComponentProvider.html" title="interface in com.sun.jersey.core.spi.component" target="classFrame"><I>ComponentProvider</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/<API key>.html" title="interface in com.sun.jersey.core.spi.component" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ComponentScope.html" title="enum in com.sun.jersey.core.spi.component" target="classFrame">ComponentScope</A>
<BR>
<A HREF="com/sun/jersey/api/ConflictException.html" title="class in com.sun.jersey.api" target="classFrame">ConflictException</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/<API key>.html" title="class in com.sun.jersey.api.client.filter" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/inject/ConstrainedTo.html" title="annotation in com.sun.jersey.spi.inject" target="classFrame">ConstrainedTo</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/ConstrainedToType.html" title="class in com.sun.jersey.spi.inject" target="classFrame">ConstrainedToType</A>
<BR>
<A HREF="javax/ws/rs/Consumes.html" title="annotation in javax.ws.rs" target="classFrame">Consumes</A>
<BR>
<A HREF="com/sun/jersey/api/container/ContainerException.html" title="class in com.sun.jersey.api.container" target="classFrame">ContainerException</A>
<BR>
<A HREF="com/sun/jersey/api/container/ContainerFactory.html" title="class in com.sun.jersey.api.container" target="classFrame">ContainerFactory</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/ContainerListener.html" title="class in com.sun.jersey.api.client.filter" target="classFrame">ContainerListener</A>
<BR>
<A HREF="com/sun/jersey/spi/container/ContainerListener.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I>ContainerListener</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/ContainerNotifier.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I>ContainerNotifier</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/ContainerProvider.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I>ContainerProvider</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/ContainerRequest.html" title="class in com.sun.jersey.spi.container" target="classFrame">ContainerRequest</A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/ContainerResponse.html" title="class in com.sun.jersey.spi.container" target="classFrame">ContainerResponse</A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/header/ContentDisposition.html" title="class in com.sun.jersey.core.header" target="classFrame">ContentDisposition</A>
<BR>
<A HREF="com/sun/jersey/core/header/ContentDisposition.<API key>.html" title="class in com.sun.jersey.core.header" target="classFrame">ContentDisposition.<API key></A>
<BR>
<A HREF="javax/ws/rs/core/Context.html" title="annotation in javax.ws.rs.core" target="classFrame">Context</A>
<BR>
<A HREF="javax/ws/rs/ext/ContextResolver.html" title="interface in javax.ws.rs.ext" target="classFrame"><I>ContextResolver</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/<API key>.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/core/Cookie.html" title="class in javax.ws.rs.core" target="classFrame">Cookie</A>
<BR>
<A HREF="javax/ws/rs/CookieParam.html" title="annotation in javax.ws.rs" target="classFrame">CookieParam</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/<API key>.html" title="class in com.sun.jersey.api.client.filter" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/<API key>.html" title="class in com.sun.jersey.api.container.filter" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/client/config/DefaultClientConfig.html" title="class in com.sun.jersey.api.client.config" target="classFrame">DefaultClientConfig</A>
<BR>
<A HREF="com/sun/jersey/api/core/<API key>.html" title="class in com.sun.jersey.api.core" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/DefaultValue.html" title="annotation in javax.ws.rs" target="classFrame">DefaultValue</A>
<BR>
<A HREF="javax/ws/rs/DELETE.html" title="annotation in javax.ws.rs" target="classFrame">DELETE</A>
<BR>
<A HREF="com/sun/jersey/spi/monitoring/DispatchingListener.html" title="interface in com.sun.jersey.spi.monitoring" target="classFrame"><I>DispatchingListener</I></A>
<BR>
<A HREF="com/sun/jersey/spi/monitoring/<API key>.html" title="interface in com.sun.jersey.spi.monitoring" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.xhtml" target="classFrame">Elements</A>
<BR>
<A HREF="javax/ws/rs/Encoded.html" title="annotation in javax.ws.rs" target="classFrame">Encoded</A>
<BR>
<A HREF="com/sun/jersey/core/provider/EntityHolder.html" title="class in com.sun.jersey.core.provider" target="classFrame">EntityHolder</A>
<BR>
<A HREF="javax/ws/rs/core/EntityTag.html" title="class in javax.ws.rs.core" target="classFrame">EntityTag</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/Errors.html" title="class in com.sun.jersey.spi.inject" target="classFrame">Errors</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/Errors.Closure.html" title="interface in com.sun.jersey.spi.inject" target="classFrame"><I>Errors.Closure</I></A>
<BR>
<A HREF="com/sun/jersey/spi/inject/Errors.ErrorMessage.html" title="class in com.sun.jersey.spi.inject" target="classFrame">Errors.ErrorMessage</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/Errors.<API key>.html" title="class in com.sun.jersey.spi.inject" target="classFrame">Errors.<API key></A>
<BR>
<A HREF="javax/ws/rs/ext/ExceptionMapper.html" title="interface in javax.ws.rs.ext" target="classFrame"><I>ExceptionMapper</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/core/ExtendedUriInfo.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I>ExtendedUriInfo</I></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="interface in com.sun.jersey.core.util" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/FieldVisitor.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">FieldVisitor</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.html" title="class in com.sun.jersey.core.spi.scanning.uri" target="classFrame">FileSchemeScanner</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/FilesScanner.html" title="class in com.sun.jersey.core.spi.scanning" target="classFrame">FilesScanner</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/Filterable.html" title="class in com.sun.jersey.api.client.filter" target="classFrame">Filterable</A>
<BR>
<A HREF="com/sun/jersey/api/representation/Form.html" title="class in com.sun.jersey.api.representation" target="classFrame">Form</A>
<BR>
<A HREF="com/sun/jersey/core/header/<API key>.html" title="class in com.sun.jersey.core.header" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/header/<API key>.<API key>.html" title="class in com.sun.jersey.core.header" target="classFrame"><API key>.<API key></A>
<BR>
<A HREF="javax/ws/rs/FormParam.html" title="annotation in javax.ws.rs" target="classFrame">FormParam</A>
<BR>
<A HREF="com/sun/jersey/api/client/async/FutureListener.html" title="interface in com.sun.jersey.api.client.async" target="classFrame"><I>FutureListener</I></A>
<BR>
<A HREF="javax/ws/rs/core/GenericEntity.html" title="class in javax.ws.rs.core" target="classFrame">GenericEntity</A>
<BR>
<A HREF="com/sun/jersey/api/client/GenericType.html" title="class in com.sun.jersey.api.client" target="classFrame">GenericType</A>
<BR>
<A HREF="javax/ws/rs/GET.html" title="annotation in javax.ws.rs" target="classFrame">GET</A>
<BR>
<A HREF="com/sun/jersey/spi/monitoring/<API key>.html" title="interface in com.sun.jersey.spi.monitoring" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/header/GrammarUtil.html" title="class in com.sun.jersey.core.header" target="classFrame">GrammarUtil</A>
<BR>
<A HREF="com/sun/jersey/api/container/grizzly/<API key>.html" title="class in com.sun.jersey.api.container.grizzly" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/container/grizzly/<API key>.html" title="class in com.sun.jersey.api.container.grizzly" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/<API key>.html" title="class in com.sun.jersey.api.client.filter" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/<API key>.html" title="class in com.sun.jersey.api.container.filter" target="classFrame"><API key></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/Handle.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">Handle</A>
<BR>
<A HREF="javax/ws/rs/HEAD.html" title="annotation in javax.ws.rs" target="classFrame">HEAD</A>
<BR>
<A HREF="com/sun/jersey/spi/<API key>.html" title="interface in com.sun.jersey.spi" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="javax/ws/rs/HeaderParam.html" title="annotation in javax.ws.rs" target="classFrame">HeaderParam</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.html" title="class in com.sun.jersey.api.client.filter" target="classFrame">HTTPBasicAuthFilter</A>
<BR>
<A HREF="com/sun/jersey/api/core/HttpContext.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I>HttpContext</I></A>
<BR>
<A HREF="com/sun/jersey/core/header/HttpDateFormat.html" title="class in com.sun.jersey.core.header" target="classFrame">HttpDateFormat</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/<API key>.html" title="class in com.sun.jersey.api.client.filter" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/header/reader/HttpHeaderReader.html" title="class in com.sun.jersey.core.header.reader" target="classFrame">HttpHeaderReader</A>
<BR>
<A HREF="com/sun/jersey/core/header/reader/HttpHeaderReader.Event.html" title="enum in com.sun.jersey.core.header.reader" target="classFrame">HttpHeaderReader.Event</A>
<BR>
<A HREF="com/sun/jersey/core/header/reader/HttpHeaderReader.ListElementCreator.html" title="interface in com.sun.jersey.core.header.reader" target="classFrame"><I>HttpHeaderReader.ListElementCreator</I></A>
<BR>
<A HREF="javax/ws/rs/core/HttpHeaders.html" title="interface in javax.ws.rs.core" target="classFrame"><I>HttpHeaders</I></A>
<BR>
<A HREF="javax/ws/rs/HttpMethod.html" title="annotation in javax.ws.rs" target="classFrame">HttpMethod</A>
<BR>
<A HREF="com/sun/jersey/api/core/HttpRequestContext.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I>HttpRequestContext</I></A>
<BR>
<A HREF="com/sun/jersey/api/core/HttpResponseContext.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I>HttpResponseContext</I></A>
<BR>
<A HREF="com/sun/jersey/api/container/httpserver/HttpServerFactory.html" title="class in com.sun.jersey.api.container.httpserver" target="classFrame">HttpServerFactory</A>
<BR>
<A HREF="com/sun/jersey/client/urlconnection/HTTPSProperties.html" title="class in com.sun.jersey.client.urlconnection" target="classFrame">HTTPSProperties</A>
<BR>
<A HREF="com/sun/jersey/client/urlconnection/<API key>.html" title="interface in com.sun.jersey.client.urlconnection" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/view/ImplicitProduces.html" title="annotation in com.sun.jersey.api.view" target="classFrame">ImplicitProduces</A>
<BR>
<A HREF="com/sun/jersey/core/header/InBoundHeaders.html" title="class in com.sun.jersey.core.header" target="classFrame">InBoundHeaders</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/Inject.html" title="annotation in com.sun.jersey.spi.inject" target="classFrame">Inject</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/Injectable.html" title="interface in com.sun.jersey.spi.inject" target="classFrame"><I>Injectable</I></A>
<BR>
<A HREF="com/sun/jersey/spi/inject/InjectableProvider.html" title="interface in com.sun.jersey.spi.inject" target="classFrame"><I>InjectableProvider</I></A>
<BR>
<A HREF="com/sun/jersey/spi/inject/<API key>.html" title="interface in com.sun.jersey.spi.inject" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/inject/<API key>.InjectableScopePair.html" title="class in com.sun.jersey.spi.inject" target="classFrame"><API key>.InjectableScopePair</A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/<API key>.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/core/InjectParam.html" title="annotation in com.sun.jersey.api.core" target="classFrame">InjectParam</A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/IoCDestroyable.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I>IoCDestroyable</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.html" title="class in com.sun.jersey.core.spi.component.ioc" target="classFrame">IoCProviderFactory</A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ioc/<API key>.html" title="interface in com.sun.jersey.core.spi.component.ioc" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/client/async/ITypeListener.html" title="interface in com.sun.jersey.api.client.async" target="classFrame"><I>ITypeListener</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/JarFileScanner.html" title="class in com.sun.jersey.core.spi.scanning" target="classFrame">JarFileScanner</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.html" title="class in com.sun.jersey.core.spi.scanning.uri" target="classFrame">JarZipSchemeScanner</A>
<BR>
<A HREF="com/sun/jersey/spi/container/JavaMethodInvoker.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I>JavaMethodInvoker</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="class in com.sun.jersey.spi.container" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/JResponse.html" title="class in com.sun.jersey.api" target="classFrame">JResponse</A>
<BR>
<A HREF="com/sun/jersey/api/JResponse.AJResponseBuilder.html" title="class in com.sun.jersey.api" target="classFrame">JResponse.AJResponseBuilder</A>
<BR>
<A HREF="com/sun/jersey/api/JResponse.JResponseBuilder.html" title="class in com.sun.jersey.api" target="classFrame">JResponse.JResponseBuilder</A>
<BR>
<A HREF="com/sun/jersey/api/JResponseAsResponse.html" title="class in com.sun.jersey.api" target="classFrame">JResponseAsResponse</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONConfigurated.html" title="interface in com.sun.jersey.api.json" target="classFrame"><I>JSONConfigurated</I></A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONConfiguration.html" title="class in com.sun.jersey.api.json" target="classFrame">JSONConfiguration</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONConfiguration.Builder.html" title="class in com.sun.jersey.api.json" target="classFrame">JSONConfiguration.Builder</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONConfiguration.MappedBuilder.html" title="class in com.sun.jersey.api.json" target="classFrame">JSONConfiguration.MappedBuilder</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONConfiguration.<API key>.html" title="class in com.sun.jersey.api.json" target="classFrame">JSONConfiguration.<API key></A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONConfiguration.NaturalBuilder.html" title="class in com.sun.jersey.api.json" target="classFrame">JSONConfiguration.NaturalBuilder</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONConfiguration.Notation.html" title="enum in com.sun.jersey.api.json" target="classFrame">JSONConfiguration.Notation</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONJAXBContext.html" title="class in com.sun.jersey.api.json" target="classFrame">JSONJAXBContext</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONJAXBContext.JSONNotation.html" title="enum in com.sun.jersey.api.json" target="classFrame">JSONJAXBContext.JSONNotation</A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONMarshaller.html" title="interface in com.sun.jersey.api.json" target="classFrame"><I>JSONMarshaller</I></A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONUnmarshaller.html" title="interface in com.sun.jersey.api.json" target="classFrame"><I>JSONUnmarshaller</I></A>
<BR>
<A HREF="com/sun/jersey/api/json/JSONWithPadding.html" title="class in com.sun.jersey.api.json" target="classFrame">JSONWithPadding</A>
<BR>
<A HREF="com/sun/jersey/core/util/KeyComparator.html" title="interface in com.sun.jersey.core.util" target="classFrame"><I>KeyComparator</I></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="class in com.sun.jersey.core.util" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="class in com.sun.jersey.core.util" target="classFrame"><API key></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/Label.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">Label</A>
<BR>
<A HREF="com/sun/jersey/core/header/LanguageTag.html" title="class in com.sun.jersey.core.header" target="classFrame">LanguageTag</A>
<BR>
<A HREF="com/sun/jersey/core/util/LazyVal.html" title="class in com.sun.jersey.core.util" target="classFrame">LazyVal</A>
<BR>
<A HREF="com/sun/jersey/core/header/LinkHeader.html" title="class in com.sun.jersey.core.header" target="classFrame">LinkHeader</A>
<BR>
<A HREF="com/sun/jersey/core/header/LinkHeader.LinkHeaderBuilder.html" title="class in com.sun.jersey.core.header" target="classFrame">LinkHeader.LinkHeaderBuilder</A>
<BR>
<A HREF="com/sun/jersey/core/header/LinkHeaders.html" title="class in com.sun.jersey.core.header" target="classFrame">LinkHeaders</A>
<BR>
<A HREF="com/sun/jersey/localization/Localizable.html" title="interface in com.sun.jersey.localization" target="classFrame"><I>Localizable</I></A>
<BR>
<A HREF="com/sun/jersey/localization/LocalizableMessage.html" title="class in com.sun.jersey.localization" target="classFrame">LocalizableMessage</A>
<BR>
<A HREF="com/sun/jersey/localization/<API key>.html" title="class in com.sun.jersey.localization" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/localization/Localizer.html" title="class in com.sun.jersey.localization" target="classFrame">Localizer</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/LoggingFilter.html" title="class in com.sun.jersey.api.client.filter" target="classFrame">LoggingFilter</A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/LoggingFilter.html" title="class in com.sun.jersey.api.container.filter" target="classFrame">LoggingFilter</A>
<BR>
<A HREF="com/sun/jersey/api/container/<API key>.html" title="class in com.sun.jersey.api.container" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/header/MatchingEntityTag.html" title="class in com.sun.jersey.core.header" target="classFrame">MatchingEntityTag</A>
<BR>
<A HREF="javax/ws/rs/MatrixParam.html" title="annotation in javax.ws.rs" target="classFrame">MatrixParam</A>
<BR>
<A HREF="javax/ws/rs/core/MediaType.html" title="class in javax.ws.rs.core" target="classFrame">MediaType</A>
<BR>
<A HREF="com/sun/jersey/core/header/MediaTypes.html" title="class in com.sun.jersey.core.header" target="classFrame">MediaTypes</A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/MessageBodyFactory.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame">MessageBodyFactory</A>
<BR>
<A HREF="javax/ws/rs/ext/MessageBodyReader.html" title="interface in javax.ws.rs.ext" target="classFrame"><I>MessageBodyReader</I></A>
<BR>
<A HREF="com/sun/jersey/spi/MessageBodyWorkers.html" title="interface in com.sun.jersey.spi" target="classFrame"><I>MessageBodyWorkers</I></A>
<BR>
<A HREF="javax/ws/rs/ext/MessageBodyWriter.html" title="interface in javax.ws.rs.ext" target="classFrame"><I>MessageBodyWriter</I></A>
<BR>
<A HREF="com/sun/jersey/api/MessageException.html" title="class in com.sun.jersey.api" target="classFrame">MessageException</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">MethodDocType</A>
<BR>
<A HREF="com/sun/jersey/core/reflection/MethodList.html" title="class in com.sun.jersey.core.reflection" target="classFrame">MethodList</A>
<BR>
<A HREF="com/sun/jersey/core/reflection/MethodList.Filter.html" title="interface in com.sun.jersey.core.reflection" target="classFrame"><I>MethodList.Filter</I></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/MethodVisitor.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">MethodVisitor</A>
<BR>
<A HREF="javax/ws/rs/core/MultivaluedMap.html" title="interface in javax.ws.rs.core" target="classFrame"><I>MultivaluedMap</I></A>
<BR>
<A HREF="com/sun/jersey/core/util/MultivaluedMapImpl.html" title="class in com.sun.jersey.core.util" target="classFrame">MultivaluedMapImpl</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">NamedValueType</A>
<BR>
<A HREF="javax/ws/rs/core/NewCookie.html" title="class in javax.ws.rs.core" target="classFrame">NewCookie</A>
<BR>
<A HREF="com/sun/jersey/api/NotFoundException.html" title="class in com.sun.jersey.api" target="classFrame">NotFoundException</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/ObjectFactory.html" title="class in com.sun.jersey.server.wadl.generators" target="classFrame">ObjectFactory</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">ObjectFactory</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.xhtml" target="classFrame">ObjectFactory</A>
<BR>
<A HREF="com/sun/jersey/api/client/filter/<API key>.html" title="interface in com.sun.jersey.api.client.filter" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/Opcodes.html" title="interface in jersey.repackaged.org.objectweb.asm" target="classFrame"><I>Opcodes</I></A>
<BR>
<A HREF="javax/ws/rs/OPTIONS.html" title="annotation in javax.ws.rs" target="classFrame">OPTIONS</A>
<BR>
<A HREF="com/sun/jersey/core/osgi/OsgiRegistry.html" title="class in com.sun.jersey.core.osgi" target="classFrame">OsgiRegistry</A>
<BR>
<A HREF="com/sun/jersey/core/header/OutBoundHeaders.html" title="class in com.sun.jersey.core.header" target="classFrame">OutBoundHeaders</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/PackageNamesScanner.html" title="class in com.sun.jersey.core.spi.scanning" target="classFrame">PackageNamesScanner</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/PackageNamesScanner.ResourcesProvider.html" title="class in com.sun.jersey.core.spi.scanning" target="classFrame">PackageNamesScanner.ResourcesProvider</A>
<BR>
<A HREF="com/sun/jersey/api/core/<API key>.html" title="class in com.sun.jersey.api.core" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">ParamDocType</A>
<BR>
<A HREF="com/sun/jersey/api/model/Parameter.html" title="class in com.sun.jersey.api.model" target="classFrame">Parameter</A>
<BR>
<A HREF="com/sun/jersey/api/model/Parameter.Source.html" title="enum in com.sun.jersey.api.model" target="classFrame">Parameter.Source</A>
<BR>
<A HREF="com/sun/jersey/api/model/Parameterized.html" title="interface in com.sun.jersey.api.model" target="classFrame"><I>Parameterized</I></A>
<BR>
<A HREF="com/sun/jersey/core/header/ParameterizedHeader.html" title="class in com.sun.jersey.core.header" target="classFrame">ParameterizedHeader</A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.html" title="class in com.sun.jersey.api" target="classFrame">ParamException</A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.<API key>.html" title="class in com.sun.jersey.api" target="classFrame">ParamException.<API key></A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.FormParamException.html" title="class in com.sun.jersey.api" target="classFrame">ParamException.FormParamException</A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.<API key>.html" title="class in com.sun.jersey.api" target="classFrame">ParamException.<API key></A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.<API key>.html" title="class in com.sun.jersey.api" target="classFrame">ParamException.<API key></A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.PathParamException.html" title="class in com.sun.jersey.api" target="classFrame">ParamException.PathParamException</A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.QueryParamException.html" title="class in com.sun.jersey.api" target="classFrame">ParamException.QueryParamException</A>
<BR>
<A HREF="com/sun/jersey/api/ParamException.URIParamException.html" title="class in com.sun.jersey.api" target="classFrame">ParamException.URIParamException</A>
<BR>
<A HREF="com/sun/jersey/spi/container/ParamQualifier.html" title="annotation in com.sun.jersey.spi.container" target="classFrame">ParamQualifier</A>
<BR>
<A HREF="com/sun/jersey/api/core/ParentRef.html" title="annotation in com.sun.jersey.api.core" target="classFrame">ParentRef</A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="class in com.sun.jersey.api.client" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/Path.html" title="annotation in javax.ws.rs" target="classFrame">Path</A>
<BR>
<A HREF="com/sun/jersey/api/model/PathAnnotated.html" title="interface in com.sun.jersey.api.model" target="classFrame"><I>PathAnnotated</I></A>
<BR>
<A HREF="javax/ws/rs/PathParam.html" title="annotation in javax.ws.rs" target="classFrame">PathParam</A>
<BR>
<A HREF="com/sun/jersey/spi/scanning/<API key>.html" title="class in com.sun.jersey.spi.scanning" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/core/PathSegment.html" title="interface in javax.ws.rs.core" target="classFrame"><I>PathSegment</I></A>
<BR>
<A HREF="com/sun/jersey/api/model/PathValue.html" title="class in com.sun.jersey.api.model" target="classFrame">PathValue</A>
<BR>
<A HREF="com/sun/jersey/spi/resource/PerRequest.html" title="annotation in com.sun.jersey.spi.resource" target="classFrame">PerRequest</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/<API key>.html" title="class in com.sun.jersey.spi.inject" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/PerSession.html" title="annotation in com.sun.jersey.spi.container.servlet" target="classFrame">PerSession</A>
<BR>
<A HREF="javax/ws/rs/POST.html" title="annotation in javax.ws.rs" target="classFrame">POST</A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/PostReplaceFilter.html" title="class in com.sun.jersey.api.container.filter" target="classFrame">PostReplaceFilter</A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/PostReplaceFilter.ConfigFlag.html" title="enum in com.sun.jersey.api.container.filter" target="classFrame">PostReplaceFilter.ConfigFlag</A>
<BR>
<A HREF="com/sun/jersey/core/util/Priority.html" title="annotation in com.sun.jersey.core.util" target="classFrame">Priority</A>
<BR>
<A HREF="com/sun/jersey/core/util/PriorityUtil.html" title="class in com.sun.jersey.core.util" target="classFrame">PriorityUtil</A>
<BR>
<A HREF="com/sun/jersey/core/util/PriorityUtil.InstanceComparator.html" title="class in com.sun.jersey.core.util" target="classFrame">PriorityUtil.InstanceComparator</A>
<BR>
<A HREF="com/sun/jersey/core/util/PriorityUtil.TypeComparator.html" title="class in com.sun.jersey.core.util" target="classFrame">PriorityUtil.TypeComparator</A>
<BR>
<A HREF="javax/ws/rs/Produces.html" title="annotation in javax.ws.rs" target="classFrame">Produces</A>
<BR>
<A HREF="javax/ws/rs/ext/Provider.html" title="annotation in javax.ws.rs.ext" target="classFrame">Provider</A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ProviderFactory.html" title="class in com.sun.jersey.core.spi.component" target="classFrame">ProviderFactory</A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ProviderFactory.Destroyable.html" title="interface in com.sun.jersey.core.spi.component" target="classFrame"><I>ProviderFactory.Destroyable</I></A>
<BR>
<A HREF="javax/ws/rs/ext/Providers.html" title="interface in javax.ws.rs.ext" target="classFrame"><I>Providers</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ProviderServices.html" title="class in com.sun.jersey.core.spi.component" target="classFrame">ProviderServices</A>
<BR>
<A HREF="com/sun/jersey/core/spi/component/ProviderServices.ProviderListener.html" title="interface in com.sun.jersey.core.spi.component" target="classFrame"><I>ProviderServices.ProviderListener</I></A>
<BR>
<A HREF="javax/ws/rs/PUT.html" title="annotation in javax.ws.rs" target="classFrame">PUT</A>
<BR>
<A HREF="com/sun/jersey/core/header/QualityFactor.html" title="interface in com.sun.jersey.core.header" target="classFrame"><I>QualityFactor</I></A>
<BR>
<A HREF="com/sun/jersey/core/header/<API key>.html" title="class in com.sun.jersey.core.header" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/QueryParam.html" title="annotation in javax.ws.rs" target="classFrame">QueryParam</A>
<BR>
<A HREF="com/sun/jersey/core/util/ReaderWriter.html" title="class in com.sun.jersey.core.util" target="classFrame">ReaderWriter</A>
<BR>
<A HREF="com/sun/jersey/core/reflection/ReflectionHelper.html" title="class in com.sun.jersey.core.reflection" target="classFrame">ReflectionHelper</A>
<BR>
<A HREF="com/sun/jersey/core/reflection/ReflectionHelper.ClassTypePair.html" title="class in com.sun.jersey.core.reflection" target="classFrame">ReflectionHelper.ClassTypePair</A>
<BR>
<A HREF="com/sun/jersey/core/reflection/ReflectionHelper.<API key>.html" title="class in com.sun.jersey.core.reflection" target="classFrame">ReflectionHelper.<API key></A>
<BR>
<A HREF="com/sun/jersey/core/reflection/ReflectionHelper.TypeClassPair.html" title="class in com.sun.jersey.core.reflection" target="classFrame">ReflectionHelper.TypeClassPair</A>
<BR>
<A HREF="com/sun/jersey/spi/container/ReloadListener.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I>ReloadListener</I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/<API key>.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/core/Request.html" title="interface in javax.ws.rs.core" target="classFrame"><I>Request</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/RequestBuilder.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I>RequestBuilder</I></A>
<BR>
<A HREF="com/sun/jersey/spi/dispatch/RequestDispatcher.html" title="interface in com.sun.jersey.spi.dispatch" target="classFrame"><I>RequestDispatcher</I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">RequestDocType</A>
<BR>
<A HREF="com/sun/jersey/spi/monitoring/RequestListener.html" title="interface in com.sun.jersey.spi.monitoring" target="classFrame"><I>RequestListener</I></A>
<BR>
<A HREF="com/sun/jersey/spi/monitoring/<API key>.html" title="interface in com.sun.jersey.spi.monitoring" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/client/RequestWriter.html" title="class in com.sun.jersey.api.client" target="classFrame">RequestWriter</A>
<BR>
<A HREF="com/sun/jersey/api/client/RequestWriter.RequestEntityWriter.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I>RequestWriter.RequestEntityWriter</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/RequestWriter.<API key>.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I>RequestWriter.<API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/template/ResolvedViewable.html" title="class in com.sun.jersey.spi.template" target="classFrame">ResolvedViewable</A>
<BR>
<A HREF="com/sun/jersey/server/spi/component/<API key>.html" title="class in com.sun.jersey.server.spi.component" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/spi/component/<API key>.html" title="class in com.sun.jersey.server.spi.component" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/spi/component/<API key>.html" title="class in com.sun.jersey.server.spi.component" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/spi/component/<API key>.html" title="interface in com.sun.jersey.server.spi.component" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/server/spi/component/<API key>.html" title="interface in com.sun.jersey.server.spi.component" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/server/spi/component/<API key>.html" title="annotation in com.sun.jersey.server.spi.component" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/core/ResourceConfig.html" title="class in com.sun.jersey.api.core" target="classFrame">ResourceConfig</A>
<BR>
<A HREF="com/sun/jersey/api/core/<API key>.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/core/ResourceContext.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I>ResourceContext</I></A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/<API key>.html" title="class in com.sun.jersey.api.container.filter" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc" target="classFrame">ResourceDocAccessor</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">ResourceDocType</A>
<BR>
<A HREF="com/sun/jersey/spi/container/ResourceFilter.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I>ResourceFilter</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/ResourceFilters.html" title="annotation in com.sun.jersey.spi.container" target="classFrame">ResourceFilters</A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="class in com.sun.jersey.spi.container" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/model/ResourceModelIssue.html" title="class in com.sun.jersey.api.model" target="classFrame">ResourceModelIssue</A>
<BR>
<A HREF="javax/ws/rs/core/Response.html" title="class in javax.ws.rs.core" target="classFrame">Response</A>
<BR>
<A HREF="javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core" target="classFrame">Response.ResponseBuilder</A>
<BR>
<A HREF="javax/ws/rs/core/Response.Status.html" title="enum in javax.ws.rs.core" target="classFrame">Response.Status</A>
<BR>
<A HREF="javax/ws/rs/core/Response.Status.Family.html" title="enum in javax.ws.rs.core" target="classFrame">Response.Status.Family</A>
<BR>
<A HREF="javax/ws/rs/core/Response.StatusType.html" title="interface in javax.ws.rs.core" target="classFrame"><I>Response.StatusType</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/<API key>.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/ResponseBuilderImpl.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame">ResponseBuilderImpl</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">ResponseDocType</A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/ResponseImpl.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame">ResponseImpl</A>
<BR>
<A HREF="com/sun/jersey/spi/monitoring/ResponseListener.html" title="interface in com.sun.jersey.spi.monitoring" target="classFrame"><I>ResponseListener</I></A>
<BR>
<A HREF="com/sun/jersey/spi/monitoring/<API key>.html" title="interface in com.sun.jersey.spi.monitoring" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/Responses.html" title="class in com.sun.jersey.api" target="classFrame">Responses</A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/<API key>.html" title="class in com.sun.jersey.api.container.filter" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/servlet/<API key>.html" title="class in com.sun.jersey.api.container.filter.servlet" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/ext/RuntimeDelegate.html" title="class in javax.ws.rs.ext" target="classFrame">RuntimeDelegate</A>
<BR>
<A HREF="javax/ws/rs/ext/RuntimeDelegate.HeaderDelegate.html" title="interface in javax.ws.rs.ext" target="classFrame"><I>RuntimeDelegate.HeaderDelegate</I></A>
<BR>
<A HREF="com/sun/ws/rs/ext/RuntimeDelegateImpl.html" title="class in com.sun.ws.rs.ext" target="classFrame">RuntimeDelegateImpl</A>
<BR>
<A HREF="com/sun/jersey/core/util/SaxHelper.html" title="class in com.sun.jersey.core.util" target="classFrame">SaxHelper</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/Scanner.html" title="interface in com.sun.jersey.core.spi.scanning" target="classFrame"><I>Scanner</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/ScannerException.html" title="class in com.sun.jersey.core.spi.scanning" target="classFrame">ScannerException</A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/ScannerListener.html" title="interface in com.sun.jersey.core.spi.scanning" target="classFrame"><I>ScannerListener</I></A>
<BR>
<A HREF="com/sun/jersey/api/core/<API key>.html" title="class in com.sun.jersey.api.core" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/core/SecurityContext.html" title="interface in javax.ws.rs.core" target="classFrame"><I>SecurityContext</I></A>
<BR>
<A HREF="com/sun/jersey/spi/inject/ServerSide.html" title="class in com.sun.jersey.spi.inject" target="classFrame">ServerSide</A>
<BR>
<A HREF="com/sun/jersey/spi/service/<API key>.html" title="class in com.sun.jersey.spi.service" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/service/ServiceFinder.html" title="class in com.sun.jersey.spi.service" target="classFrame">ServiceFinder</A>
<BR>
<A HREF="com/sun/jersey/spi/service/ServiceFinder.<API key>.html" title="class in com.sun.jersey.spi.service" target="classFrame">ServiceFinder.<API key></A>
<BR>
<A HREF="com/sun/jersey/spi/service/ServiceFinder.<API key>.html" title="class in com.sun.jersey.spi.service" target="classFrame">ServiceFinder.<API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/ServletContainer.html" title="class in com.sun.jersey.spi.container.servlet" target="classFrame">ServletContainer</A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/ServletContainer.<API key>.html" title="class in com.sun.jersey.spi.container.servlet" target="classFrame">ServletContainer.<API key></A>
<BR>
<A HREF="com/sun/jersey/spi/resource/Singleton.html" title="annotation in com.sun.jersey.spi.resource" target="classFrame">Singleton</A>
<BR>
<A HREF="com/sun/jersey/spi/inject/<API key>.html" title="class in com.sun.jersey.spi.inject" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/client/Statuses.html" title="class in com.sun.jersey.api.client" target="classFrame">Statuses</A>
<BR>
<A HREF="javax/ws/rs/core/StreamingOutput.html" title="interface in javax.ws.rs.core" target="classFrame"><I>StreamingOutput</I></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="class in com.sun.jersey.core.util" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="class in com.sun.jersey.core.util" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="class in com.sun.jersey.core.util" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="class in com.sun.jersey.core.util" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/StringReader.html" title="interface in com.sun.jersey.spi" target="classFrame"><I>StringReader</I></A>
<BR>
<A HREF="com/sun/jersey/spi/StringReader.<API key>.html" title="annotation in com.sun.jersey.spi" target="classFrame">StringReader.<API key></A>
<BR>
<A HREF="com/sun/jersey/spi/<API key>.html" title="interface in com.sun.jersey.spi" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/StringReaderWorkers.html" title="interface in com.sun.jersey.spi" target="classFrame"><I>StringReaderWorkers</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/template/TemplateContext.html" title="interface in com.sun.jersey.spi.template" target="classFrame"><I>TemplateContext</I></A>
<BR>
<A HREF="com/sun/jersey/spi/template/<API key>.html" title="class in com.sun.jersey.spi.template" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/template/TemplateProcessor.html" title="interface in com.sun.jersey.spi.template" target="classFrame"><I>TemplateProcessor</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="class in com.sun.jersey.api.client" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/util/ThrowHelper.html" title="class in com.sun.jersey.core.util" target="classFrame">ThrowHelper</A>
<BR>
<A HREF="com/sun/jersey/core/header/Token.html" title="class in com.sun.jersey.core.header" target="classFrame">Token</A>
<BR>
<A HREF="com/sun/jersey/api/core/Traceable.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I>Traceable</I></A>
<BR>
<A HREF="com/sun/jersey/api/core/TraceInformation.html" title="class in com.sun.jersey.api.core" target="classFrame">TraceInformation</A>
<BR>
<A HREF="com/sun/jersey/api/core/TraceInformation.TraceHeaderListener.html" title="interface in com.sun.jersey.api.core" target="classFrame"><I>TraceInformation.TraceHeaderListener</I></A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/Type.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">Type</A>
<BR>
<A HREF="com/sun/jersey/api/client/async/TypeListener.html" title="class in com.sun.jersey.api.client.async" target="classFrame">TypeListener</A>
<BR>
<A HREF="jersey/repackaged/org/objectweb/asm/TypePath.html" title="class in jersey.repackaged.org.objectweb.asm" target="classFrame">TypePath</A>
<BR>
<A HREF="com/sun/jersey/api/client/UniformInterface.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I>UniformInterface</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="class in com.sun.jersey.api.client" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/util/<API key>.html" title="class in com.sun.jersey.core.util" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/core/UriBuilder.html" title="class in javax.ws.rs.core" target="classFrame">UriBuilder</A>
<BR>
<A HREF="javax/ws/rs/core/UriBuilderException.html" title="class in javax.ws.rs.core" target="classFrame">UriBuilderException</A>
<BR>
<A HREF="com/sun/jersey/api/uri/UriBuilderImpl.html" title="class in com.sun.jersey.api.uri" target="classFrame">UriBuilderImpl</A>
<BR>
<A HREF="com/sun/jersey/api/uri/UriComponent.html" title="class in com.sun.jersey.api.uri" target="classFrame">UriComponent</A>
<BR>
<A HREF="com/sun/jersey/api/uri/UriComponent.Type.html" title="enum in com.sun.jersey.api.uri" target="classFrame">UriComponent.Type</A>
<BR>
<A HREF="com/sun/jersey/api/container/filter/UriConnegFilter.html" title="class in com.sun.jersey.api.container.filter" target="classFrame">UriConnegFilter</A>
<BR>
<A HREF="javax/ws/rs/core/UriInfo.html" title="interface in javax.ws.rs.core" target="classFrame"><I>UriInfo</I></A>
<BR>
<A HREF="com/sun/jersey/spi/uri/rules/<API key>.html" title="interface in com.sun.jersey.spi.uri.rules" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/uri/UriPattern.html" title="class in com.sun.jersey.api.uri" target="classFrame">UriPattern</A>
<BR>
<A HREF="com/sun/jersey/spi/uri/rules/UriRule.html" title="interface in com.sun.jersey.spi.uri.rules" target="classFrame"><I>UriRule</I></A>
<BR>
<A HREF="com/sun/jersey/spi/uri/rules/UriRuleContext.html" title="interface in com.sun.jersey.spi.uri.rules" target="classFrame"><I>UriRuleContext</I></A>
<BR>
<A HREF="com/sun/jersey/server/probes/<API key>.html" title="class in com.sun.jersey.server.probes" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/uri/rules/UriRules.html" title="interface in com.sun.jersey.spi.uri.rules" target="classFrame"><I>UriRules</I></A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.html" title="interface in com.sun.jersey.core.spi.scanning.uri" target="classFrame"><I>UriSchemeScanner</I></A>
<BR>
<A HREF="com/sun/jersey/api/uri/UriTemplate.html" title="class in com.sun.jersey.api.uri" target="classFrame">UriTemplate</A>
<BR>
<A HREF="com/sun/jersey/api/uri/UriTemplateParser.html" title="class in com.sun.jersey.api.uri" target="classFrame">UriTemplateParser</A>
<BR>
<A HREF="com/sun/jersey/client/urlconnection/<API key>.html" title="class in com.sun.jersey.client.urlconnection" target="classFrame"><API key></A>
<BR>
<A HREF="javax/ws/rs/core/Variant.html" title="class in javax.ws.rs.core" target="classFrame">Variant</A>
<BR>
<A HREF="javax/ws/rs/core/Variant.VariantListBuilder.html" title="class in javax.ws.rs.core" target="classFrame">Variant.VariantListBuilder</A>
<BR>
<A HREF="com/sun/jersey/core/spi/factory/<API key>.html" title="class in com.sun.jersey.core.spi.factory" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.html" title="class in com.sun.jersey.core.spi.scanning.uri" target="classFrame">VfsSchemeScanner</A>
<BR>
<A HREF="com/sun/jersey/api/view/Viewable.html" title="class in com.sun.jersey.api.view" target="classFrame">Viewable</A>
<BR>
<A HREF="com/sun/jersey/spi/template/ViewProcessor.html" title="interface in com.sun.jersey.spi.template" target="classFrame"><I>ViewProcessor</I></A>
<BR>
<A HREF="com/sun/jersey/client/proxy/ViewProxy.html" title="interface in com.sun.jersey.client.proxy" target="classFrame"><I>ViewProxy</I></A>
<BR>
<A HREF="com/sun/jersey/client/proxy/ViewProxyProvider.html" title="interface in com.sun.jersey.client.proxy" target="classFrame"><I>ViewProxyProvider</I></A>
<BR>
<A HREF="com/sun/jersey/api/client/ViewResource.html" title="class in com.sun.jersey.api.client" target="classFrame">ViewResource</A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="interface in com.sun.jersey.api.client" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/<API key>.html" title="interface in com.sun.jersey.server.wadl" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/WadlBuilder.html" title="class in com.sun.jersey.server.wadl" target="classFrame">WadlBuilder</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/WadlGenerator.html" title="interface in com.sun.jersey.server.wadl" target="classFrame"><I>WadlGenerator</I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/WadlGenerator.Environment.html" title="class in com.sun.jersey.server.wadl" target="classFrame">WadlGenerator.Environment</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/WadlGenerator.<API key>.html" title="class in com.sun.jersey.server.wadl" target="classFrame">WadlGenerator.<API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/WadlGenerator.Resolver.html" title="interface in com.sun.jersey.server.wadl" target="classFrame"><I>WadlGenerator.Resolver</I></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/<API key>.html" title="class in com.sun.jersey.server.wadl.generators" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/wadl/config/WadlGeneratorConfig.html" title="class in com.sun.jersey.api.wadl.config" target="classFrame">WadlGeneratorConfig</A>
<BR>
<A HREF="com/sun/jersey/api/wadl/config/WadlGeneratorConfig.<API key>.html" title="class in com.sun.jersey.api.wadl.config" target="classFrame">WadlGeneratorConfig.<API key></A>
<BR>
<A HREF="com/sun/jersey/api/wadl/config/<API key>.html" title="class in com.sun.jersey.api.wadl.config" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/api/wadl/config/<API key>.html" title="class in com.sun.jersey.api.wadl.config" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/<API key>.html" title="class in com.sun.jersey.server.wadl.generators" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/WadlGeneratorImpl.html" title="class in com.sun.jersey.server.wadl" target="classFrame">WadlGeneratorImpl</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/<API key>.html" title="class in com.sun.jersey.server.wadl.generators" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/<API key>.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.model" target="classFrame">WadlParamType</A>
<BR>
<A HREF="com/sun/jersey/spi/container/WebApplication.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I>WebApplication</I></A>
<BR>
<A HREF="javax/ws/rs/<API key>.html" title="class in javax.ws.rs" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="class in com.sun.jersey.spi.container" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/<API key>.html" title="interface in com.sun.jersey.spi.container" target="classFrame"><I><API key></I></A>
<BR>
<A HREF="com/sun/jersey/api/core/servlet/<API key>.html" title="class in com.sun.jersey.api.core.servlet" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/scanning/servlet/<API key>.html" title="class in com.sun.jersey.spi.scanning.servlet" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/WebComponent.html" title="class in com.sun.jersey.spi.container.servlet" target="classFrame">WebComponent</A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/WebComponent.<API key>.html" title="class in com.sun.jersey.spi.container.servlet" target="classFrame">WebComponent.<API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/WebConfig.html" title="interface in com.sun.jersey.spi.container.servlet" target="classFrame"><I>WebConfig</I></A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/WebConfig.ConfigType.html" title="enum in com.sun.jersey.spi.container.servlet" target="classFrame">WebConfig.ConfigType</A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/WebFilterConfig.html" title="class in com.sun.jersey.spi.container.servlet" target="classFrame">WebFilterConfig</A>
<BR>
<A HREF="com/sun/jersey/api/client/WebResource.html" title="class in com.sun.jersey.api.client" target="classFrame">WebResource</A>
<BR>
<A HREF="com/sun/jersey/api/client/<API key>.html" title="class in com.sun.jersey.api.client" target="classFrame"><API key></A>
<BR>
<A HREF="com/sun/jersey/spi/container/servlet/WebServletConfig.html" title="class in com.sun.jersey.spi.container.servlet" target="classFrame">WebServletConfig</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.xhtml" target="classFrame">XhtmlElementType</A>
<BR>
<A HREF="com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.html" title="class in com.sun.jersey.server.wadl.generators.resourcedoc.xhtml" target="classFrame">XhtmlValueType</A>
<BR>
<A HREF="com/sun/jersey/api/provider/jaxb/XmlHeader.html" title="annotation in com.sun.jersey.api.provider.jaxb" target="classFrame">XmlHeader</A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML> |
# modification, are permitted provided that the following conditions
# are met:
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_sched.a
CFLAGS += -O3
CFLAGS += -g
CFLAGS += $(WERROR_FLAGS)
# all source are stored in SRCS-y
SRCS-$(<API key>) += rte_sched.c rte_red.c rte_approx.c
# install includes
SYMLINK-$(<API key>)-include := rte_sched.h rte_bitmap.h rte_sched_common.h rte_red.h rte_approx.h
# this lib depends upon:
DEPDIRS-$(<API key>) += lib/librte_mempool lib/librte_mbuf
DEPDIRS-$(<API key>) += lib/librte_net lib/librte_timer
include $(RTE_SDK)/mk/rte.lib.mk |
#!/usr/bin/python
# -*- coding:UTF-8 -*-
# This program is free software; you can redistribute it and/or modify
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
from gi.repository import Gtk, GLib
import gettext
_ = gettext.gettext
class Entry(Gtk.ToolItem):
def __init__(self):
super(Entry, self).__init__()
self.search_function = None
self.search_entry = Gtk.Entry()
self.search_entry.set_width_chars(30)
self.search_entry.<API key>(_("Search a package..."))
self.search_entry.set_icon_from_stock(0, Gtk.STOCK_FIND)
self.search_entry.<API key>(0, True)
self.search_string = _("Search a package...")
self.add(self.search_entry)
self.search_entry.connect("key-release-event", self.on_inserting_text)
self.search_entry.connect("icon-press", self.on_press_icon)
self.timeout_id = 0
def clean_text(self):
'''Clean the text in the entry'''
self.search_entry.<API key>(self.search_string)
def emit_search(self):
self.search_function(self.search_entry.get_text(), 20)
return False
def set_searching_text(self, string):
'''Set the default search string'''
self.search_entry.set_text(string)
def on_inserting_text(self, widget, event):
if widget.get_text() != "":
widget.set_icon_from_stock(1, Gtk.STOCK_CLEAR)
else:
widget.set_icon_from_stock(1, None)
if self.timeout_id != 0:
GLib.source_remove(self.timeout_id)
self.timeout_id = GLib.timeout_add(300, self.emit_search)
def on_press_icon(self, widget, position, event):
'''Handle the press-icon event'''
if position == 1:
widget.set_text("")
widget.set_icon_from_stock(1, None)
self.search_function("", 0)
#print("research") |
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using System.Xml.XPath;
namespace demo_site.Areas.HelpPage
{
<summary>
A custom <see cref="<API key>"/> that reads the API documentation from an XML documentation file.
</summary>
public class <API key> : <API key>
{
private XPathNavigator _documentNavigator;
private const string MethodExpression = "/doc/members/member[@name='M:{0}']";
private const string ParameterExpression = "param[@name='{0}']";
<summary>
Initializes a new instance of the <see cref="<API key>"/> class.
</summary>
<param name="documentPath">The physical path to XML document.</param>
public <API key>(string documentPath)
{
if (documentPath == null)
{
throw new <API key>("documentPath");
}
XPathDocument xpath = new XPathDocument(documentPath);
_documentNavigator = xpath.CreateNavigator();
}
public virtual string GetDocumentation(<API key> actionDescriptor)
{
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
if (methodNode != null)
{
XPathNavigator summaryNode = methodNode.SelectSingleNode("summary");
if (summaryNode != null)
{
return summaryNode.Value.Trim();
}
}
return null;
}
public virtual string GetDocumentation(<API key> parameterDescriptor)
{
<API key> <API key> = parameterDescriptor as <API key>;
if (<API key> != null)
{
XPathNavigator methodNode = GetMethodNode(<API key>.ActionDescriptor);
if (methodNode != null)
{
string parameterName = <API key>.ParameterInfo.Name;
XPathNavigator parameterNode = methodNode.SelectSingleNode(String.Format(CultureInfo.InvariantCulture, ParameterExpression, parameterName));
if (parameterNode != null)
{
return parameterNode.Value.Trim();
}
}
}
return null;
}
private XPathNavigator GetMethodNode(<API key> actionDescriptor)
{
<API key> <API key> = actionDescriptor as <API key>;
if (<API key> != null)
{
string selectExpression = String.Format(CultureInfo.InvariantCulture, MethodExpression, GetMemberName(<API key>.MethodInfo));
return _documentNavigator.SelectSingleNode(selectExpression);
}
return null;
}
private static string GetMemberName(MethodInfo method)
{
string name = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", method.DeclaringType.FullName, method.Name);
ParameterInfo[] parameters = method.GetParameters();
if (parameters.Length != 0)
{
string[] parameterTypeNames = parameters.Select(param => GetTypeName(param.ParameterType)).ToArray();
name += String.Format(CultureInfo.InvariantCulture, "({0})", String.Join(",", parameterTypeNames));
}
return name;
}
private static string GetTypeName(Type type)
{
if (type.IsGenericType)
{
// Format the generic type name to something like: Generic{System.Int32,System.String}
Type genericType = type.<API key>();
Type[] genericArguments = type.GetGenericArguments();
string typeName = genericType.FullName;
// Trim the generic parameter counts from the name
typeName = typeName.Substring(0, typeName.IndexOf('`'));
string[] argumentTypeNames = genericArguments.Select(t => GetTypeName(t)).ToArray();
return String.Format(CultureInfo.InvariantCulture, "{0}{{{1}}}", typeName, String.Join(",", argumentTypeNames));
}
return type.FullName;
}
}
} |
/* global angular, cepsAPI */
angular.module("app").controller("editCepsCtrl", function ($scope, $routeParams, cep, cidades, bairros, $location,cepsAPI) {
$scope.cep = cep.data;
$scope.bairros = bairros.data.list;
$scope.cidades = cidades.data.list;
$scope.adicionarCep = function (cep) {
cepsAPI.saveCep(cep).success(function (data) {
delete $scope.cep;
$scope.cepForm.$setPristine();
$location.path("/ceps");
});
};
}); |
<?php
/**
* @package zOOmGallery
* @author Mike de Boer <mailme@mikedeboer.nl>
**/
// Ensure that nothing can write to the standard io, before we get the header out
ob_start( );
include 'JPEG.php';
include 'Photoshop_IRB.php';
// retrieve the filename from the URL parameters
$filename = $GLOBALS['HTTP_GET_VARS']['filename'];
// Retrieve the JPEG header Data
$jpeg_header_data = <API key>( $filename );
// Retrieve any Photoshop IRB data in the file
$IRB_array = get_Photoshop_IRB( $jpeg_header_data );
// Check if Photoshop IRB data was retrieved
if ( $IRB_array === FALSE )
{
// No Photoshop IRB data could be retrieved - abort
ob_end_clean ( );
echo "<p>Photoshop IRB could not be retrieved</p>\n";
return;
}
// Cycle through the resources in the Photoshop IRB
// Until either a thumbnail resource is found or
// there are no more resources
$i = 0;
while ( ( $i < count( $IRB_array ) ) &&
( $IRB_array[$i]['ResID'] != 0x0409 ) &&
( $IRB_array[$i]['ResID'] != 0x040C ) )
{
$i++;
}
// Check if a thumbnail was found
if ( $i < count( $IRB_array ) )
{
// A thumbnail was found, Display it
ob_end_clean ( );
header("Content-type: image/jpeg");
print substr( $IRB_array[$i]['ResData'] , 28 );
}
?> |
using UnityEngine;
using System.Collections;
public class LaserProjectile : MonoBehaviour {
public Vector3 movementSpeed;
public float damage;
Rigidbody rb;
public GameObject parent;
public GameObject LaserHit;
// Use this for initialization
void Start () {
rb = this.gameObject.GetComponent<Rigidbody>();
}
void FixedUpdate()
{
// rb.AddRelativeForce(movementSpeed*2);
transform.Translate(movementSpeed);
}
void OnCollisionEnter(Collision c)
{
if(c.gameObject.CompareTag("Enemy"))
{
ContactPoint[] hitpoint = c.contacts;
Instantiate(LaserHit, hitpoint[0].point, c.transform.rotation);
ApplyDamage(c.gameObject);
Destroy(this.gameObject);
}
else
{
Destroy(this.gameObject);
}
}
void ApplyDamage(GameObject go)
{
Stats stat = go.GetComponent<Stats>();
stat.DamageObject(damage, parent);
}
} |
// Avoid newer issue with CLang:
#ifdef asm_volatile_goto
#undef asm_volatile_goto
#define asm_volatile_goto(x...)
#endif
#include <linux/mmzone.h>
/*
* This is an extended BPF kernel module, with some probes, for the IO Visor
* BPF Compiler Collection (BCC) for an x86_64 architecture. (Tested on a
* Linux kernel 4.3.3)
*
* You should not try to compile directly this code, for its compilation is
* requested by the BCC. BCC also determines the point in the kernel to which
* the probes in this module will attach, and instructs these attachments.
*
* In our case, the point is only called under one thread at a time, ie.,
* there is no concurrent usage of the probe point, so the probe can't be
* trigerred concurrently either.
*/
BPF_HISTOGRAM(delay_dist);
// These are scalar global variables, expressed in the form of a BPF array from
// indexes in [int] to values in 'u64', so these arrays have length = 1.
#define ENTRIES_SCALAR_VAR 1
BPF_TABLE("array", int, u64, <API key>, ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>, ENTRIES_SCALAR_VAR);
// this is a hash having the accum delays in nanoseconds of the calls to
// "compact_zone(...)", and this hash is keyed by the "order" argument
// passed to this kernel function. (Very probably 128 different hash keys is
// way too a conservative allocation for this hash.)
#define <API key> 128
// (Note: we use the types here, "int", "unsigned long", "u64", mainly according
// as we copy the types from the corresponding parameters in the probed kernel
// functions, like in "kernel/mm/compaction.c", and, if the type is not taken
// from the original kernel function, then the type is from the BPF auxiliary
// functions; as last recourse, if no type can be inferred, is to give the type
// ourselves.
// To be clearer, we track the main type assumption with a typedef)
typedef unsigned int order_type;
BPF_TABLE("hash", order_type, u64, <API key>,
<API key>);
// The saved "order" at entry in "compact_zone()"
BPF_TABLE("array", int, order_type, <API key>,
ENTRIES_SCALAR_VAR);
// The counter of how many different kmalloc() related operations happened
// specifically only while the memory compaction was running
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
BPF_TABLE("array", int, u64, <API key>,
ENTRIES_SCALAR_VAR);
// Auxiliary functions to the BPF probes
static
u64 get_time_at_entry(void)
{
u32 idx_zero = 0;
u64 *ptr_time_at_entry = <API key>.lookup(&idx_zero);
// the eBPF probe runs in kernel mode, so the kernel eBPF verifier is
// very strict (for safety and stability), and will reject BPF
// instructions with implicit assumptions, like that a pointer is not
// null: you need to make explicit the veracity that a pointer is not
// null, otherwise the kernel verifier will reject it.
return (ptr_time_at_entry)? *ptr_time_at_entry: 0;
}
static
void set_time_at_entry(u64 new_value)
{
u32 idx_zero = 0;
u64 *ptr_time_at_entry = <API key>.lookup(&idx_zero);
// same as comment above that the kernel verifier requires to check
// explicitly for implicit assumptions
if (ptr_time_at_entry)
*ptr_time_at_entry = new_value;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *total_accum_t_ptr = <API key>.lookup(&idx_zero);
return (total_accum_t_ptr)? total_accum_t_ptr: NULL;
}
static
u64 * <API key>(order_type order)
{
u64 zero = 0;
u64 *total_accum_t_ptr =
<API key>.lookup_or_init(&order, &zero);
return (total_accum_t_ptr)? total_accum_t_ptr: NULL;
}
static
order_type <API key>(void)
{
u32 idx_zero = 0;
order_type *saved_order_ptr =
<API key>.lookup(&idx_zero);
// same as comment above that the kernel verifier requires to check
// explicitly for implicit assumptions
return (saved_order_ptr)? *saved_order_ptr: 0;
}
static
void <API key>(order_type new_value)
{
u32 idx_zero = 0;
order_type *saved_order_ptr =
<API key>.lookup(&idx_zero);
// same as comment above that the kernel verifier requires to check
// explicitly for implicit assumptions
if (saved_order_ptr)
*saved_order_ptr = new_value;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * get_cnt___kmalloc(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * get_cnt_malloc(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * get_cnt_kfree(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
static
u64 * <API key>(void)
{
u32 idx_zero = 0;
u64 *cnt_ptr = <API key>.lookup(&idx_zero);
return (cnt_ptr)? cnt_ptr: NULL;
}
// BPF probes
int <API key>(struct pt_regs *ctx, struct zone *zone,
int order)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// bpf_trace_printk() should only be called in a debug, non-prod
// kernel
// bpf_trace_printk("lost a return probe to clear time\\n");
;
}
// store the new time in the global variables array
time_at_entry = bpf_ktime_get_ns();
set_time_at_entry(time_at_entry);
// I'm confused on the following instruction to get an argument into
// the probed kernel function, I'm very sorry for this.
// The following instruction seems to be needed (?) if the parameter
// passing to the intercepted callee (compact_zone()) is through the
// CPU registers (e.g., through the SI register). I need to consult
// more (e.g., sections "3.2.3" and "A.2.1" of):
// order_type order = ctx->si;
// If this instruction taking the "order" parameter from the SI
// register is correct, then the signature of this BPF function
// needs to be changed, as to remove the unnecessary "order"
// parameter in this BPF function.
<API key>(order);
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry == 0) {
// time_at_entry was not recorded at the entry point.
// Skip this call and do nothing
// bpf_trace_printk("lost an entry probe to set time\\n");
// bpf_trace_printk() should only be called in a debug, non-prod
// kernel
;
} else {
u64 delta = bpf_ktime_get_ns() - time_at_entry;
delay_dist.increment(bpf_log2l(delta / 1000));
// We use auxiliary get/set functions because this probe kernel
// function is not called as intensively frequent as for the
// calls to these getter/setters be too overwhelming in load
u64 * total_accum_nsec = <API key>();
if (total_accum_nsec)
(*total_accum_nsec) += delta;
// update the accum time (in nanoseconds) to compact the memory
// of this "order"
unsigned int <API key> = <API key>();
u64 * accum_nsec_order =
<API key>(<API key>);
if (accum_nsec_order)
(*accum_nsec_order) += delta;
// clear the (saved) time in the global variables array
set_time_at_entry(0);
}
return 0;
}
/*
* Another probed kernel functions: kmalloc() family
*
* (Some of these functions are inlines so they can't be probed.)
*
* These BPF probes do not analyze the kmalloc()-types per-se, but the only the
* ones that happen __while__ a compact_zone() is also happening. To see if a
* compact_zone() is running in another thread, try to see if
* get_time_at_entry() is set when a compact_zone() started
*/
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = get_cnt___kmalloc();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = get_cnt_malloc();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = get_cnt_kfree();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
}
int <API key>(struct pt_regs *ctx)
{
u64 time_at_entry = get_time_at_entry();
if (time_at_entry != 0) {
// it is set. Get a point to the counter and increment it.
u64 * counter = <API key>();
if (counter) (*counter) ++;
}
return 0;
} |
#include <stdio.h>
#include <assert.h>
#include <qglobal.h>
#include "objcache.h"
#ifdef CACHE_STATS
int ObjCache::misses = 0;
int ObjCache::hits = 0;
#endif
ObjCache::ObjCache(unsigned int logSize)
: m_head(-1), m_tail(-1), //m_numEntries(0),
m_size(1<<logSize), m_freeHashNodes(0), m_freeCacheNodes(0), m_lastHandle(-1)
{
int i;
m_cache = new CacheNode[m_size];
m_hash = new HashNode[m_size];
// add all items to list of free buckets
for (i=0;i<m_size-1;i++)
{
m_hash[i].nextHash = i+1;
m_cache[i].next = i+1;
}
}
ObjCache::~ObjCache()
{
delete[] m_cache;
delete[] m_hash;
}
int ObjCache::add(void *obj,void **victim)
{
*victim=0;
HashNode *hnode = hashFind(obj);
//printf("hnode=%p\n",hnode);
if (hnode) // move object to the front of the LRU list, since it is used
// most recently
{
//printf("moveToFront=%d\n",hnode->index);
moveToFront(hnode->index);
#ifdef CACHE_STATS
hits++;
#endif
}
else // object not in the cache.
{
void *lruObj=0;
if (m_freeCacheNodes!=-1) // cache not full -> add element to the cache
{
// remove element from free list
int index = m_freeCacheNodes;
m_freeCacheNodes = m_cache[index].next;
// add to head of the list
if (m_tail==-1)
{
m_tail = index;
}
m_cache[index].prev = -1;
m_cache[index].next = m_head;
if (m_head!=-1)
{
m_cache[m_head].prev = index;
}
m_head = index;
}
else // cache full -> replace element in the cache
{
//printf("Cache full!\n");
lruObj = m_cache[m_tail].obj;
hashRemove(lruObj);
moveToFront(m_tail); // m_tail indexes the emptied element, which becomes m_head
}
//printf("numEntries=%d size=%d\n",m_numEntries,m_size);
m_cache[m_head].obj = obj;
hnode = hashInsert(obj);
hnode->index = m_head;
*victim = lruObj;
#ifdef CACHE_STATS
misses++;
#endif
}
return m_head;
}
void ObjCache::del(int index)
{
assert(index!=-1);
assert(m_cache[index].obj!=0);
hashRemove(m_cache[index].obj);
moveToFront(index);
m_head = m_cache[index].next;
if (m_head==-1)
m_tail=-1;
else
m_cache[m_head].prev=-1;
m_cache[index].obj=0;
m_cache[index].prev=-1;
m_cache[index].next = m_freeCacheNodes;
m_freeCacheNodes = index;
}
#ifdef CACHE_DEBUG
#define cache_debug_printf printf
void ObjCache::printLRU()
{
cache_debug_printf("MRU->LRU: ");
int index = m_head;
while (index!=-1)
{
cache_debug_printf("%d=%p ",index,m_cache[index].obj);
index = m_cache[index].next;
}
cache_debug_printf("\n");
cache_debug_printf("LRU->MRU: ");
index = m_tail;
while (index!=-1)
{
cache_debug_printf("%d=%p ",index,m_cache[index].obj);
index = m_cache[index].prev;
}
cache_debug_printf("\n");
}
#endif
#ifdef CACHE_STATS
#define cache_stats_printf printf
void ObjCache::printStats()
{
cache_stats_printf("ObjCache: hits=%d misses=%d hit ratio=%f\n",hits,misses,hits*100.0/(hits+misses));
}
#endif
void ObjCache::moveToFront(int index)
{
int prev,next;
if (m_head!=index)
{
next = m_cache[index].next;
prev = m_cache[index].prev;
// de-chain node at index
m_cache[prev].next = next;
if (next!=-1) m_cache[next].prev = prev; else m_tail = prev;
// add to head
m_cache[index].prev = -1;
m_cache[index].next = m_head;
m_cache[m_head].prev = index;
m_head = index;
}
}
unsigned int ObjCache::hash(void *addr)
{
static bool isPtr64 = sizeof(addr)==8;
if (isPtr64)
{
uint64 key = (uint64)addr;
// Thomas Wang's 64 bit Mix Function
key += ~(key << 32);
key ^= (key >> 22);
key += ~(key << 13);
key ^= (key >> 8);
key += (key << 3);
key ^= (key >> 15);
key += ~(key << 27);
key ^= (key >> 31);
return key & (m_size-1);
}
else
{
// Thomas Wang's 32 bit Mix Function
unsigned long key = (unsigned long)addr;
key += ~(key << 15);
key ^= (key >> 10);
key += (key << 3);
key ^= (key >> 6);
key += ~(key << 11);
key ^= (key >> 16);
return key & (m_size-1);
}
}
ObjCache::HashNode *ObjCache::hashFind(void *obj)
{
HashNode *node = 0;
int index = m_hash[hash(obj)].head;
//printf("hashFind: obj=%p index=%d\n",obj,index);
while (index!=-1 &&
m_hash[index].obj!=obj
) // search for right object in the list
{
index = m_hash[index].nextHash;
}
// found the obj at index, so it is in the cache!
if (index!=-1)
{
node = &m_hash[index];
}
return node;
}
ObjCache::HashNode *ObjCache::hashInsert(void *obj)
{
int index = hash(obj);
//printf("Inserting %p index=%d\n",obj,index);
// remove element from empty list
int newElement = m_freeHashNodes;
assert(newElement!=-1);
m_freeHashNodes = m_hash[m_freeHashNodes].nextHash;
if (m_hash[index].head!=-1) // hash collision -> goto end of the list
{
index = m_hash[index].head;
while (m_hash[index].nextHash!=-1)
{
index = m_hash[index].nextHash;
}
// add to end of the list
m_hash[index].nextHash = newElement;
}
else // first element in the hash list
{
m_hash[index].head = newElement;
}
// add to the end of the list
m_hash[newElement].nextHash = -1;
m_hash[newElement].obj = obj;
return &m_hash[newElement];
}
void ObjCache::hashRemove(void *obj)
{
int index = hash(obj);
// find element
int curIndex = m_hash[index].head;
int prevIndex=-1;
while (m_hash[curIndex].obj!=obj)
{
prevIndex = curIndex;
curIndex = m_hash[curIndex].nextHash;
}
if (prevIndex==-1) // remove from start
{
m_hash[index].head = m_hash[curIndex].nextHash;
}
else // remove in the middle
{
m_hash[prevIndex].nextHash = m_hash[curIndex].nextHash;
}
// add curIndex element to empty list
m_hash[curIndex].nextHash = m_freeHashNodes;
m_hash[curIndex].index = -1;
m_hash[curIndex].obj = 0;
m_freeHashNodes = curIndex;
}
#ifdef CACHE_TEST
int main()
{
int i;
struct obj
{
obj() : handle(-1) {}
int handle;
};
obj *objs = new obj[100];
ObjCache c(3);
for (i=0;i<32;i++)
{
int objId=(i%3)+(i>>2)*4;
printf("
#ifdef CACHE_DEBUG
c.printLRU();
#endif
obj *victim=0;
if (objs[objId].handle==-1)
{
objs[objId].handle = c.add(&objs[objId],(void**)&victim);
if (victim) victim->handle=-1;
}
else
{
c.use(objs[objId].handle);
}
printf("i=%d objId=%d using %p victim=%p\n",i,objId,&objs[objId],victim);
}
for (i=0;i<100;i++)
{
if (objs[i].handle!=-1)
{
printf("
c.del(objs[i].handle);
objs[i].handle=-1;
#ifdef CACHE_DEBUG
c.printLRU();
#endif
}
}
c.printStats();
return 0;
}
#endif |
# Brief: make the library and test cases, do test check
# Common options
CC = gcc
INCLUDES = -I. -I./include -I./deps/include
CFLAGS = -Wall -g
LDFLAGS =
# Build library
LIB_INCLUDES = -I./src
LIB_CFLAGS =
LIB_LDFLAGS = -L./deps/lib # -lglog -lgflags -lpthread -lm
SOURCE_DIRS = src
LIB_SOURCES = $(shell find $(SOURCE_DIRS) -name '*.c' -print | sort | tr "\n" " ")
LIB_PREFIXES = $(LIB_SOURCES:.c=)
LIB_OBJECTS = $(LIB_SOURCES:.c=.o)
LIBRARY = libcalgos.a
AR = ar
.PHONY: all
all: $(LIBRARY)
$(LIBRARY): $(LIB_OBJECTS)
-rm -f $@
$(AR) -crsv $@ $(LIB_OBJECTS)
$(LIB_OBJECTS): $(LIB_SOURCES)
for p in $(LIB_PREFIXES); do \
$(CC) $(INCLUDES) $(LIB_INCLUDES) $(CFLAGS) $(LIB_CFLAGS) \
$${p}.c -c -o $${p}.o ; \
done
# Run test
.PHONY: check
check: test
for p in $(TEST_PROGRAMS); do \
./$${p} ; \
done
# Build test
TEST_INCLUDES = -I./deps/test/include
TEST_CFLAGS = $(CFLAGS)
TEST_LDFLAGS = -L./deps/test/lib # -lgtest_main -lgtest
TEST_DIRS = tests
TEST_SOURCES = $(shell find $(TEST_DIRS) -name '*.c' -print | sort | tr "\n" " ")
TEST_PREFIXES = $(TEST_SOURCES:.c=)
TEST_PROGRAMS = $(TEST_PREFIXES)
.PHONY: test
test: $(TEST_PROGRAMS)
$(TEST_PROGRAMS): $(LIBRARY) $(TEST_SOURCES)
for p in $(TEST_PREFIXES); do \
$(CC) $(INCLUDES) $(LIB_INCLUDES) $(TEST_INCLUDES) $(CFLAGS) $(TEST_CFLAGS) \
$${p}.c $(LIBRARY) $(LIB_LDFLAGS) $(TEST_LDFLAGS) $(LDFLAGS) -o $${p} ; \
done
# Clean
ALL_LIBRARIES = $(LIBRARY)
ALL_PROGRAMS = $(TEST_PROGRAMS)
ALL_OBJECTS = $(shell find . $(SOURCE_DIRS) -name '*.o' -print | sort | tr "\n" " ")
.PHONY: clean
clean:
-rm -rf $(ALL_LIBRARIES) $(ALL_PROGRAMS) $(ALL_OBJECTS) |
#!/bin/bash
BASE_VER="KANGAROO.M7.MKIV.v067"
VER=""
KERNEL_VER=$BASE_VER$VER
export LOCALVERSION="."`echo $KERNEL_VER`
export CROSS_COMPILE=${HOME}/Toolchains/<API key>.9.2-2014.09/bin/<API key>-
export ARCH=arm
export SUBARCH=arm
export KBUILD_BUILD_USER=poondoge
# export KBUILD_BUILD_HOST="semaphore.gr"
DATE_START=$(date +"%s")
make "m7_defconfig"
echo "LOCALVERSION="$LOCALVERSION
echo "CROSS_COMPILE="$CROSS_COMPILE
echo "ARCH="$ARCH
make -j1
DATE_END=$(date +"%s")
echo
DIFF=$(($DATE_END - $DATE_START))
echo " Build completed in $(($DIFF / 60)) minutes and $(($DIFF % 60)) seconds."
echo |
// : shuaihong617@qq.com
// : 2015-01-05
// : shuaihong617@qq.com
// : 2015-01-05
// <summary>
// </summary>
using Nutshell.Components.Models;
namespace Nutshell.SerialPorts.Models
{
<summary>
SerialPort
</summary>
public class <API key>:WorkerModel
{
}
} |
<?php
/**
* Return an array with the options for Theme Options > Typography and Color > Sidebars
*
* @package Yithemes
* @author Andrea Frascaspata <andrea.frascapsata@yithemes.com>
* @since 2.0.0
* @return mixed array
*
*/
return array(
/* Typography and Color > widgets and sidebars */
array(
'type' => 'title',
'name' => __( 'Sidebars', 'yit' ),
'desc' => '',
),
array(
'id' => 'sidebar-title-font',
'type' => 'typography',
'name' => __( 'Sidebar title font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 17,
'unit' => 'px',
'family' => 'default',
'style' => '400',
'color' => '#000000',
'align' => 'left',
'transform' => 'uppercase',
),
'style' => array(
'selectors' => '.widget h3',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
),
'in_skin' => true,
'disabled' => true
),
array(
'type' => 'title',
'name' => __( 'Contact Info', 'yit' ),
'desc' => '',
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget contact info title font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 14,
'unit' => 'px',
'family' => 'default',
'style' => 'regular',
'color' => '#343535',
'align' => 'left',
'transform' => 'none',
),
'style' => array(
'selectors' => '.contact-info > h3',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
) ,
'in_skin' => true,
'disabled' => true
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget contact info subtitle font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 24,
'unit' => 'px',
'family' => 'default',
'style' => 'bold',
'color' => '#343535',
'align' => 'left',
'transform' => 'none',
),
'style' => array(
'selectors' => '.contact-info > h2',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
) ,
'in_skin' => true,
'disabled' => true
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget contact info label font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 14,
'unit' => 'px',
'family' => 'default',
'style' => 'bold',
'color' => '#343535',
'align' => 'left',
'transform' => 'none',
),
'style' => array(
'selectors' => '.contact-info ul li strong',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
) ,
'in_skin' => true,
'disabled' => true
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget contact info value font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 14,
'unit' => 'px',
'family' => 'default',
'style' => 'regular',
'color' => '#5f5d5d',
'align' => 'left',
'transform' => 'none',
),
'style' => array(
'selectors' => '.contact-info ul li',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
) ,
'in_skin' => true,
'disabled' => true
),
array(
'type' => 'title',
'name' => __( 'Teaser', 'yit' ),
'desc' => '',
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget Teaser slogan font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 22,
'unit' => 'px',
'family' => 'default',
'style' => '400',
'color' => '#ffffff',
'align' => 'center',
'transform' => 'uppercase',
),
'style' => array(
'selectors' => '.widget.teaser .image-banner-text .title',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
),
'in_skin' => true,
'disabled' => true
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget Teaser subslogan font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 16,
'unit' => 'px',
'family' => 'default',
'style' => '400',
'color' => '#37aec4',
'align' => 'center',
'transform' => 'uppercase',
),
'style' => array(
'selectors' => '.widget.teaser .image-banner-text .subtitle',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
) ,
'in_skin' => true,
'disabled' => true
),
array(
'type' => 'title',
'name' => __( 'Toggle Menu', 'yit' ),
'desc' => '',
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget Toggle Menu font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 14,
'unit' => 'px',
'family' => 'default',
'style' => '400',
'color' => '#000000',
'align' => 'left',
'transform' => 'uppercase',
),
'style' => array(
'selectors' => '.widget.yit_toggle_menu ul.menu > li > a',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
) ,
'in_skin' => true,
'disabled' => true
),
array(
'id' => '<API key>',
'type' => 'typography',
'name' => __( 'Widget Toggle Submenu font', 'yit' ),
'desc' => __( 'Choose the font type, size and color.', 'yit' ),
'min' => 1,
'max' => 80,
'default_font_id' => '<API key>',
'std' => array(
'size' => 15,
'unit' => 'px',
'family' => 'default',
'style' => '400',
'color' => '#5f5d5d',
'align' => 'left',
'transform' => 'none',
),
'style' => array(
'selectors' => '.widget.yit_toggle_menu ul.sub-menu li a',
'properties' => 'font-size,
font-family,
font-weight,
color,
text-transform,
text-align'
) ,
'in_skin' => true,
'disabled' => true
),
); |
<?php
// This file is part of SDK Lucterios.
// SDK Lucterios is free software; you can redistribute it and/or modify
// (at your option) any later version.
// SDK Lucterios is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// along with Lucterios; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Contributeurs: Fanny ALLEAUME, Pierre-Olivier VERSCHOORE, Laurent GAY
require_once("ConnectionSDK.inc.php");
require_once("AbstractClass.inc.php");
require_once("CodeAbstract.inc.php");
class MethodManage extends CodeAbstractManage
{
public $Suffix=".mth.php";
}
class Method extends CodeAbstract
{
//constructor
public function __construct($name,$extensionName="",$tableName="")
{
$this->Mng=new MethodManage();
parent::__construct($name,$extensionName,$tableName);
}
}
?> |
#ifdef __KERNEL__
#ifndef __ASM_MPC885ADS_H__
#define __ASM_MPC885ADS_H__
#include <asm/ppcboot.h>
#include <sysdev/fsl_soc.h>
/* U-Boot maps BCSR to 0xff080000 */
#define BCSR_ADDR ((uint)0xff080000)
#define BCSR_SIZE ((uint)32)
#define BCSR0 ((uint)(BCSR_ADDR + 0x00))
#define BCSR1 ((uint)(BCSR_ADDR + 0x04))
#define BCSR2 ((uint)(BCSR_ADDR + 0x08))
#define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
#define BCSR4 ((uint)(BCSR_ADDR + 0x10))
#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
#define IMAP_ADDR (get_immrbase())
#define IMAP_SIZE ((uint)(64 * 1024))
#define PCMCIA_MEM_ADDR (uint)0xff020000)
#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
/* Bits of interest in the BCSRs.
*/
#define BCSR1_ETHEN ((uint)0x20000000)
#define BCSR1_IRDAEN ((uint)0x10000000)
#define BCSR1_RS232EN_1 ((uint)0x01000000)
#define BCSR1_PCCEN ((uint)0x00800000)
#define BCSR1_PCCVCC0 ((uint)0x00400000)
#define BCSR1_PCCVPP0 ((uint)0x00200000)
#define BCSR1_PCCVPP1 ((uint)0x00100000)
#define BCSR1_PCCVPP_MASK (BCSR1_PCCVPP0 | BCSR1_PCCVPP1)
#define BCSR1_RS232EN_2 ((uint)0x00040000)
#define BCSR1_PCCVCC1 ((uint)0x00010000)
#define BCSR1_PCCVCC_MASK (BCSR1_PCCVCC0 | BCSR1_PCCVCC1)
#define BCSR4_ETH10_RST ((uint)0x80000000) /* 10Base-T PHY reset*/
#define BCSR4_USB_LO_SPD ((uint)0x04000000)
#define BCSR4_USB_VCC ((uint)0x02000000)
#define BCSR4_USB_FULL_SPD ((uint)0x00040000)
#define BCSR4_USB_EN ((uint)0x00020000)
#define BCSR5_MII2_EN 0x40
#define BCSR5_MII2_RST 0x20
#define BCSR5_T1_RST 0x10
#define BCSR5_ATM155_RST 0x08
#define BCSR5_ATM25_RST 0x04
#define BCSR5_MII1_EN 0x02
#define BCSR5_MII1_RST 0x01
/* Interrupt level assignments */
#define PHY_INTERRUPT SIU_IRQ7 /* PHY link change interrupt */
#define SIU_INT_FEC1 SIU_LEVEL1 /* FEC1 interrupt */
#define SIU_INT_FEC2 SIU_LEVEL3 /* FEC2 interrupt */
#define FEC_INTERRUPT SIU_INT_FEC1 /* FEC interrupt */
/* We don't use the 8259 */
#define NR_8259_INTS 0
/* CPM Ethernet through SCC3 */
#define PA_ENET_RXD ((ushort)0x0040)
#define PA_ENET_TXD ((ushort)0x0080)
#define PE_ENET_TCLK ((uint)0x00004000)
#define PE_ENET_RCLK ((uint)0x00008000)
#define PE_ENET_TENA ((uint)0x00000010)
#define PC_ENET_CLSN ((ushort)0x0400)
#define PC_ENET_RENA ((ushort)0x0800)
/* Control bits in the SICR to route TCLK (CLK5) and RCLK (CLK6) to
* SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero */
#define SICR_ENET_MASK ((uint)0x00ff0000)
#define SICR_ENET_CLKRT ((uint)0x002c0000)
/* IO_BASE definition for pcmcia. */
#define _IO_BASE_PHYS 0x80000000
#define _IO_BASE_SIZE 0x1000
#endif /* __ASM_MPC885ADS_H__ */
#endif /* __KERNEL__ */ |
#ifndef _ASM_ACPI_H
#define _ASM_ACPI_H
#ifdef __KERNEL__
#include <acpi/pdc_intel.h>
#include <asm/system.h> /* defines cmpxchg */
#define <API key> long long
#define <API key> unsigned long long
/*
* Calling conventions:
*
* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
* ACPI_EXTERNAL_XFACE - External ACPI interfaces
* ACPI_INTERNAL_XFACE - Internal ACPI interfaces
* <API key> - Internal variable-parameter list interfaces
*/
#define ACPI_SYSTEM_XFACE
#define ACPI_EXTERNAL_XFACE
#define ACPI_INTERNAL_XFACE
#define <API key>
/* Asm macros */
#define ACPI_ASM_MACROS
#define BREAKPOINT3
#define ACPI_DISABLE_IRQS() <API key>()
#define ACPI_ENABLE_IRQS() <API key>()
#define <API key>() wbinvd()
static inline int
<API key> (unsigned int *lock)
{
unsigned int old, new, val;
do {
old = *lock;
new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
val = cmpxchg(lock, old, new);
} while (unlikely (val != old));
return (new < 3) ? -1 : 0;
}
static inline int
<API key> (unsigned int *lock)
{
unsigned int old, new, val;
do {
old = *lock;
new = old & ~0x3;
val = cmpxchg(lock, old, new);
} while (unlikely (val != old));
return old & 0x1;
}
#define <API key>(GLptr, Acq) \
((Acq) = <API key>((unsigned int *) GLptr))
#define <API key>(GLptr, Acq) \
((Acq) = <API key>((unsigned int *) GLptr))
/*
* Math helper asm macros
*/
#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
asm("divl %2;" \
:"=a"(q32), "=d"(r32) \
:"r"(d32), \
"0"(n_lo), "1"(n_hi))
#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
asm("shrl $1,%2;" \
"rcrl $1,%3;" \
:"=r"(n_hi), "=r"(n_lo) \
:"0"(n_hi), "1"(n_lo))
#ifdef CONFIG_X86_IO_APIC
extern void check_acpi_pci(void);
#else
static inline void check_acpi_pci(void) { }
#endif
#ifdef CONFIG_ACPI
extern int acpi_lapic;
extern int acpi_ioapic;
extern int acpi_noirq;
extern int acpi_strict;
extern int acpi_disabled;
extern int acpi_ht;
extern int acpi_pci_disabled;
static inline void disable_acpi(void)
{
acpi_disabled = 1;
acpi_ht = 0;
acpi_pci_disabled = 1;
acpi_noirq = 1;
}
/* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
#define FIX_ACPI_PAGES 4
extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
#ifdef CONFIG_X86_IO_APIC
extern int skip_ioapic_setup;
extern int <API key>;
static inline void <API key>(void)
{
skip_ioapic_setup = 1;
}
static inline int <API key>(void)
{
return skip_ioapic_setup;
}
#else
static inline void <API key>(void) { }
#endif
static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
static inline void acpi_disable_pci(void)
{
acpi_pci_disabled = 1;
acpi_noirq_set();
}
extern int <API key>(char *str);
#else /* !CONFIG_ACPI */
#define acpi_lapic 0
#define acpi_ioapic 0
static inline void acpi_noirq_set(void) { }
static inline void acpi_disable_pci(void) { }
#endif /* !CONFIG_ACPI */
#ifdef CONFIG_ACPI_SLEEP
/* routines for saving/restoring kernel state */
extern int acpi_save_state_mem(void);
extern void <API key>(void);
extern unsigned long acpi_wakeup_address;
/* early initialization routine */
extern void <API key>(void);
#endif /*CONFIG_ACPI_SLEEP*/
extern u8 <API key>[];
#define ARCH_HAS_POWER_INIT 1
#endif /*__KERNEL__*/
#endif /*_ASM_ACPI_H*/ |
// 2 - The "New" BSD License (http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L13)
// 3 - The Academic Free License (http://trac.dojotoolkit.org/browser/dojo/trunk/LICENSE#L43)
define(["dojo/_base/lang",
"dojo/date/stamp",
"dojo/json",
"../../util/shim/Array"], function(lang, dateStamp, JSON) {
"use strict";
// module:
// cbtree/store/handlers/ifrsHandler
// summary:
// Sample ItemFileReadStore data handler.
// description:
// This handler takes an dojo/data/ItemFileReadStore (IFRS) formatted data
// response and converts it to a cbtree/store format. If the response data
// is organized in a hiererchical structure the structure is flattened and
// all object references are resolved.
// NOTE:
// The following limitations apply:
// - Only properties that match the list of children properties are
// flattened.
// - Nested arrays are not supported.
// example:
// | require(["cbtree/store/Hierarchy",
// | "cbtree/store/handlers/ifrsHandler"
// | ], function (ObjectStore, ifrsHandler) {
// | var store = new ObjectStore(
// | { url: "/some/data/location/myFile.json",
// | handleAs:"ifrs",
// | dataHandler: ifrsHandler
// | var store = new ObjectStore(
// | { url: "/some/data/location/myFile.json",
// | handleAs:"ifrs",
// | dataHandler: {
// | handler: ifrsHandler,
// | options: {
// | childProperty: ["children"]
var moduleName = "cbtree/store/handlers/ifrsHandler";
function isObject( object ) {
// summary:
// Returns true if an object is a key:value pairs object.
return (Object.prototype.toString.call(object) == "[object Object]");
}
function isFunction( object ) {
// summary:
// Returns true if an object is function.
return (Object.prototype.toString.call(object) == "[object Function]");
}
function ifrsHandler(/*Object?*/ options) {
// summary:
// Closure for the actual data handler (e.g this.handler());
// options:
// JavaScript key:value pairs object.
// tag:
// Public
this.childProperty = ["children"]; // Default children property name
this.parentProperty = "parent"; // Default parent property name
this.idProperty = "id"; // Default id property name/
this.referenceToId = true;
this.typeMap = {}; // Custom datatype map
var self = this;
this.handler = function (/*Object*/ response) {
// summary:
// The data handler. The handler is registered with dojo/request/handlers
// The response data is converted into an array of JavaScript key:value
// pairs objects ready for the consumption by any cbtree/store.
// On successful completion of a dojo/request this method is called with
// the request response.
// response:
var parentProp = self.parentProperty;
var childProps = self.childProperty;
var identProp = self.idProperty;
var typeMap = self.typeMap;
var refToId = self.referenceToId;
var autoIndex = 1;
var allItems = [];
var undefRef = [];
var index = {};
var ifrsData;
var maxRef = 0;
function addParent(/*String|Number*/ reference,/*String|Number*/ parentId ) {
// summary:
// Add a parent id to the reference object
// reference:
// parentId:
var child;
if (reference) {
var child = getReference(reference, false);
if (child) {
var childId = child[identProp];
var parents = child[parentProp];
if (parents) {
parents.push(parentId);
} else {
parents = [parentId];
}
child[parentProp] = parents;
maxRef = Math.max(parents.length, maxRef);
}
}
} /* end addParent() */
function flattenHierarchy(/*Object*/ parent) {
// summary:
// Search the parent object for children properties and add any child
// that is not a reference as a seperate object to the store.
// parent:
// The parent object to be flattened.
var parentId = parent[identProp];
var property;
// Make sure we have an id for the object.
if (parentId) {
if (typeof parentId == "number" && parentId > autoIndex) {
autoIndex = Math.floor(parentId+1);
}
} else{
parentId = autoIndex++;
}
parent[identProp] = parentId;
index[parentId] = parent;
allItems.push(parent)
for (property in parent) {
if (childProps.indexOf(property) != -1) {
var children = parent[property];
if (children && children instanceof Array) {
children.forEach( function (child) {
if (isObject(child) && !child._reference) {
// Add the parent property to the child.
child[parentProp] = parentId;
flattenHierarchy(child);
}
});
}
}
}
} /* end flattenHierarchy() */
function getReference (/*Stirng|Number|Object*/ reference, /*Boolean*/ idOnly) {
// summary:
// Locate and return the object associated with the reference.
// reference:
// If reference is an object the first store item that matches all
// of its property values is returned, otherwise reference is used
// as an identifier and the index is search to locate the item.
// idOnly:
// Indicates if only the reference id is to be returned.
var item;
if (isObject(reference)) {
item = allItems.filter( function (item) {
for (var prop in reference) {
if (item[prop] != reference[prop]) {
return false;
}
}
return true;
})[0];
} else {
// Keep track of any undefined references.
if (!(item =index[reference])) {
if (undefRef.indexOf(reference) == -1) {
undefRef.push(reference);
}
}
}
return (item && idOnly) ? item[identProp] : item;
}
function mapType(/*String*/ type,/*any*/ value) {
// summary:
// Instantiate a custom data type.
// type:
// Cutsom type name
// value:
// Value to be assigned to the custom datatype.
if (typeMap) {
var mapObj = typeMap[type];
if (mapObj) {
if (isFunction(mapObj)) {
return new mapObj(value);
}
// Test if it is a general format typeMap object like in:
// {type: Function, deserialize: Function}
if (isObject(mapObj)) {
var dszf = mapObj.deserialize;
var ctor = mapObj.type;
if (isFunction(dszf)) {
return dszf(value);
}
if (isFunction(ctor)) {
return new ctor(value);
}
}
}
throw new TypeError(moduleName+"::handler::mapType(): constructor missing for datatype: ["+type+"]");
}
throw new TypeError(moduleName+"::handler::mapType(): custom type detected but no mapping table available");
} /* end customTypes() */
function resolveRefAndType(/*Object*/ object) {
// summary:
// Resolve references and instantiate custom datatypes, if any.
// object:
var objectId = object[identProp];
var property;
for(property in object) {
var values = object[property];
if (values) {
// Check if the values are considered children...
if (parentProp && childProps.indexOf(property) != -1) {
if (values instanceof Array) {
values.forEach( function (child) {
if (child._reference) {
addParent( child._reference, objectId );
}
});
}
delete object[property];
continue;
}
if (values instanceof Array) {
values = values.map( function (value) {
if (isObject(value)) {
if (value._reference) {
return getReference( value._reference, refToId );
} else if (value._type) {
return mapType(value._type, value._value)
}
}
return value;
});
// remove any undefined references.
object[property] = values.filter( function (item) {return !!item;});
} else {
if (isObject(values)) {
if (values._reference) {
object[property] = getReference( values._reference, refToId );
} else if (values._type) {
object[property] = mapType( values._type, values._value );
}
}
}
}
} /* end for() */
} /* end resolveRefAndType() */
ifrsData = JSON.parse(response.text || response.data);
if (ifrsData && ifrsData.items) {
var identProp = ifrsData.identifier || identProp;
ifrsData.items.forEach( flattenHierarchy );
allItems.forEach( resolveRefAndType );
// If this is a single parent reference hierarchy convert the parent
// property to a single value.
if (maxRef == 1) {
allItems.forEach( function (item) {
item[parentProp] = item[parentProp] ? item[parentProp][0] : undefined;
});
}
if (undefRef.length > 0) {
console.warn("Undefined references: " + undefRef);
}
} else {
// Don't try to be smart and guess the file format...
throw new TypeError(moduleName+"::handler(): invalid IFRS file format");
}
return allItems;
};
this.set = function (/*String|Object*/ property, /*any?*/ value) {
// summary:
// Set a handler property value
// property:
// Property name or a JavaScript key:value pairs object.
// value:
// The property value.
// tag:
// Public
if (property) {
if (isObject(property)) {
for (var key in property) {
this.set(key, property[key]);
}
}
this[property] = value;
}
this.childProperty = this.childProperty instanceof Array ? this.childProperty : [this.childProperty];
// Set default Date type mapping if non was provided.
this.typeMap = this.typeMap || {};
if (!this.typeMap["Date"]) {
this.typeMap["Date"] = {
type: Date,
deserialize: function (value) {
return dateStamp.fromISOString(value);
}
}
}
};
if (options) {
this.set(options);
}
} /* end ifrsHandler() */
return ifrsHandler;
}); |
// <API key>.h
// Obj-C OpenGL
#import "BaseOpenGLView.h"
@interface <API key> : BaseOpenGLView
@end |
<?php
if (function_exists('<API key>')) {
<API key>('<API key>', false, 'newsletter/statistics/languages');
<API key>('newsletter', false, 'newsletter/languages');
}
require_once <API key> . '/controls.php';
$module = <API key>::instance();
$controls = new NewsletterControls();
$emails = Newsletter::instance()->get_emails();
if (!$controls->is_action()) {
$controls->data = $module->options;
}
if ($controls->is_action('save')) {
$module->save_options($controls->data);
$controls->messages = 'Saved.';
}
?>
<div class="wrap">
<?php $help_url = 'http:
<?php include NEWSLETTER_DIR . '/header-new.php'; ?>
<div id="newsletter-title">
<h2>Configuration and Email List</h2>
<p>
This module is a core part of Newsletter that collects statistics about sent emails: how many have
been read, how many have been clicked and so on.
</p>
<p>
To see the statistics of each single email, you should click the "statistics" button
you will find near each message where they are listed (like on Newsletters panel). For your
convenience, below there is a list of each email sent by Newsletter till now.
</p>
<p>
<strong>Advanced reports for each email can be generated installing the
<a href="http:
</p>
</div>
<div class="<API key>"></div>
<form method="post" action="">
<?php $controls->init(); ?>
<table class="form-table">
<tr>
<th><?php _e('Tracking URL', '<API key>') ?></th>
<td>
<?php $controls->select('tracking_url', array(0=>__('Standard', '<API key>'),
1=>__('Blog Home URL with parameters', '<API key>'))) ?>
<p class="description">
<?php _e('How the links inside newsletters are rewritten to track clicks.', '<API key>') ?>
<?php _e('Since spam filters check links inside emails, <a href="http://www.thenewsletterplugin.com/plugins/newsletter/statistics-module#tracking-url" target="_blank">read more about this setting</a>.', '<API key>') ?>
</p>
</td>
</tr>
</table>
<p>
<?php $controls->button('save', __('Save', 'newsletter')) ?>
</p>
</form>
<table class="widefat" style="width: auto">
<thead>
<tr>
<th>Id</th>
<th><?php _e('Subject', 'newsletter')?></th>
<th>Type</th>
<th><?php _e('Status', 'newsletter')?></th>
<th> </th>
<th> </th>
<th><?php _e('Tracking', 'newsletter')?></th>
<th> </th>
</tr>
</thead>
<tbody>
<?php foreach ($emails as &$email) { ?>
<?php if ($email->type != 'message' && $email->type != 'feed') continue; ?>
<tr>
<td><?php echo $email->id; ?></td>
<td><?php echo htmlspecialchars($email->subject); ?></td>
<td><?php echo $email->type; ?></td>
<td>
<?php
if ($email->status == 'sending') {
if ($email->send_on > time()) {
_e('Scheduled', 'newsletter-emails');
}
else {
_e('Sending', 'newsletter-emails');
}
} else {
echo $email->status;
}
?>
</td>
<td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter'). ' ' . $email->total; ?></td>
<td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
<td><?php echo $email->track==1?'Yes':'No'; ?></td>
<td>
<a class="button" href="<?php echo <API key>::instance()->get_statistics_url($email->id); ?>">statistics</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div> |
/* for now, we are just like the sysv4 version with a
few hacks
*/
#ifndef VERSION_INFO2
#define VERSION_INFO2 "$Revision: 1.16 $"
#endif
#ifndef VERSION_STRING
#define VERSION_STRING version_string
#endif
/* Identify the compiler. */
/* TARGET_VERSION used by toplev.c VERSION_STRING used by -midentify-revision */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (%s%s, %s)", \
VERSION_INFO1, VERSION_INFO2, __DATE__)
#undef VERSION_INFO1
#define VERSION_INFO1 "ix86 DG/ux, "
/* Augment TARGET_SWITCHES with the MXDB options. */
#define MASK_STANDARD 0x40000000 /* Retain standard information */
#define MASK_NOLEGEND 0x20000000 /* Discard legend information */
#define <API key> 0x10000000 /* Make external legends */
#define <API key> 0x08000000 /* Emit 'ident' to .s */
#define <API key> 0x04000000 /* Warn when structures are passed */
#define TARGET_STANDARD (target_flags & MASK_STANDARD)
#define TARGET_NOLEGEND (target_flags & MASK_NOLEGEND)
#define <API key> (target_flags & <API key>)
#define <API key> (target_flags & <API key>)
#define <API key> (target_flags & <API key>)
#undef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES \
{ "standard", MASK_STANDARD, \
N_("Retain standard MXDB information") }, \
{ "legend", -MASK_NOLEGEND, \
N_("Retain legend information") }, \
{ "no-legend", MASK_NOLEGEND, "" }, \
{ "external-legend", <API key>, \
N_("Generate external legend information") }, \
{ "identify-revision", <API key>, \
N_("Emit identifying info in .s file") }, \
{ "warn-passed-structs", <API key>, \
N_("Warn when a function arg is a structure") },
#undef <API key>
#define <API key>
/*
allow -gstabs so that those who have gnu-as installed
can debug c++ programs.
*/
#undef DBX_DEBUGGING_INFO
#define DBX_DEBUGGING_INFO
#undef <API key>
#define <API key> DWARF_DEBUG
/* Override svr[34].h. Switch to the data section so that the coffsem
symbol isn't in the text section. */
#undef ASM_FILE_START
#define ASM_FILE_START(FILE) \
do { \
<API key> (FILE, main_input_filename); \
fprintf (FILE, "\t.version\t\"01.01\"\n"); \
data_section (); \
} while (0)
/* ix86 abi specified type for wchar_t */
#undef WCHAR_TYPE
#define WCHAR_TYPE "long int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
/* Some machines may desire to change what optimizations are performed for
various optimization levels. This macro, if defined, is executed once
just after the optimization level is determined and before the remainder
of the command options have been parsed. Values set in this macro are
used as the default values for the other command line options.
LEVEL is the optimization level specified; 2 if -O2 is specified,
1 if -O is specified, and 0 if neither is specified. */
/* This macro used to store 0 in <API key>.
Not only is that misuse of this macro; the whole idea is wrong.
The GNU C dialect makes bitfields signed by default,
regardless of machine type. Making any machine inconsistent in this
regard is bad for portability.
I chose to make bitfields signed by default because this is consistent
with the way ordinary variables are handled: `int' equals `signed int'.
If there is a good reason to prefer making bitfields unsigned by default,
it cannot have anything to do with the choice of machine.
If the reason is good enough, we should change the convention for all machines.
-- rms, 20 July 1991. */
/*
this really should go into dgux-local.h
*/
#undef <API key>
#define <API key>(LEVEL,SIZE) \
do { \
extern int <API key>; \
<API key> = 0; \
<API key> (LEVEL,SIZE); \
} while (0)
/* The normal location of the `ld' and `as' programs */
#undef MD_EXEC_PREFIX
#define MD_EXEC_PREFIX "/usr/bin/"
/* The normal location of the various *crt*.o files is the */
#undef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX "/usr/lib/"
/* Macros to be automatically defined.
__CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header
files with DG/UX revision 5.40 and later. This allows GNU CC to
operate without installing the header files. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ix86 -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
-Asystem=unix -Asystem=svr4"
/*
If not -ansi, -traditional, or restricting include files to one
specific source target, specify full DG/UX features.
*/
#undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu) %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}"
/* Assembler support (legends for mxdb). */
#undef ASM_SPEC
#define ASM_SPEC "\
%{mno-legend:%{mstandard:-Wc,off}}\
%{g:%{!mno-legend:-Wc,-fix-bb,-s\"%i\"\
%{traditional:,-lc}%{!traditional:,-lansi-c}\
%{mstandard:,-keep-std}\
%{mexternal-legend:,-external}}}"
/* Override svr4.h. */
/* hassey 3/12/94 keep svr4 ASM_FINAL_SPEC allows -pipe to work */
/* Linker and library spec's.
-static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options.
-svr4 instructs gcc to place /usr/lib/values-X[cat].o on link the line.
The absence of -msvr4 indicates linking done in a COFF environment and
adds the link script to the link line. In all environments, the first
and last objects are crtbegin.o and crtend.o.
When the -G link option is used (-shared and -symbolic) a final link is
not being done. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{!shared:%{!symbolic:-lc}}"
#undef LINK_SPEC
#define LINK_SPEC "%{z*} %{h*} %{v:-V} \
%{static:-dn -Bstatic} \
%{shared:-G -dy} \
%{symbolic:-Bsymbolic -G -dy} \
%{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
#ifdef CROSS_COMPILE
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s} \
%{!pg:%{p:mcrt1.o%s} \
%{!p:crt1.o%s}}}} \
%{pg:gcrti.o%s}%{!pg:crti.o%s} \
crtbegin.o%s \
%{ansi:values-Xc.o%s} \
%{!ansi:%{traditional:values-Xt.o%s} \
%{!traditional:values-Xa.o%s}}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:crtn.o%s}"
#else
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s} \
%{!pg:%{p:/lib/mcrt1.o%s} \
%{!p:/lib/crt1.o%s}}}} \
%{pg:gcrti.o%s}%{!pg:/lib/crti.o%s} \
crtbegin.o%s \
%{ansi:/lib/values-Xc.o%s} \
%{!ansi:%{traditional:/lib/values-Xt.o%s} \
%{!traditional:/lib/values-Xa.o%s}}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:/lib/crtn.o}"
#endif /* CROSS_COMPILE */
/* The maximum alignment which the object file format can support.
page alignment would seem to be enough */
#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT 0x1000
/* Must use data section for relocatable constants when pic. */
#undef SELECT_RTX_SECTION
#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \
{ \
if (flag_pic && symbolic_operand (RTX, VOIDmode)) \
data_section (); \
else \
const_section (); \
}
/* This supplements FUNCTION_ARG's definition in i386.h to check
<API key> */
#undef FUNCTION_ARG
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
((((MODE) == BLKmode && <API key>) ? \
warning ("argument is a structure"),0 : 0), \
(function_arg (&CUM, MODE, TYPE, NAMED)))
/* Add .align 1 to avoid .backalign bug in assembler */
#undef <API key>
#define <API key> "\t.section\t.rodata\n\t.align 1" |
var CompanyX = {
getCalendar: function() { return CompanyX.<API key>; },
getStore: function() { return CompanyX.CalendarEventStore; },
getWindow: function() { return CompanyX.<API key>; },
viewChange: function(p, vw, dateInfo) {
var win = this.getWindow();
if (win) { win.hide(); }
if (dateInfo !== null) {
this.CalendarDatePicker.setValue(dateInfo.activeDate);
this.updateTitle(dateInfo.viewStart, dateInfo.viewEnd);
}
},
updateTitle: function(startDt, endDt) {
var msg = "";
if (startDt.clearTime().getTime() == endDt.clearTime().getTime()) { msg = startDt.format("Y/m/d"); } else { msg = startDt.format("Y/m/d") + " - " + endDt.format("Y/m/d"); }
this.MainPanel.setTitle(msg);
},
setStartDate: function(picker, date) {
this.getCalendar().setStartDate(date);
},
rangeSelect: function(cal, dates, callback) {
this.record.show(cal, dates);
this.getWindow().on("hide", callback, cal, { single: true });
},
dayClick: function(cal, dt, allDay, el) {
this.record.show.call(this, cal, {
StartDate: dt,
IsAllDay: allDay
}, el);
},
record: {
add: function(win, rec) {
win.hide();
X.CalendarManager.AddRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Saving,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
update: function(win, rec) {
win.hide();
X.CalendarManager.UpdateRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Updating,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
remove: function(win, rec) {
win.hide();
X.CalendarManager.DeleteRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Deleting,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
edit: function(win, rec) {
win.hide();
CompanyX.getCalendar().showEditForm(rec);
},
addDetail: function(cal, rec) {
X.CalendarManager.AddRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Saving,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
updateDetail: function(cal, rec) {
X.CalendarManager.UpdateRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Updating,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
removeDetail: function(cal, rec) {
X.CalendarManager.DeleteRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Deleting,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
resize: function(cal, rec) {
X.CalendarManager.ResizeRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Updating,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
move: function(cal, rec) {
X.CalendarManager.MoveRecord(Ext.encode(rec.data), {
eventMask: {
showMask: true,
msg: LanguageSet.Updating,
target: "customtarget",
customTarget: this.getCalendar()
}
});
},
show: function(cal, rec, el) {
CompanyX.getWindow().show(rec, el);
},
saveAll: function() {
CompanyX.getStore().submitData();
}
},
doRemind: function() {
var store = CompanyX.getStore(),
rem,
interval,
M = Ext.calendar.EventMappings;
store.each(function(r) {
rem = r.data[M.Reminder.name];
if (!Ext.isEmpty(rem)) {
rem = parseInt(rem) * 60 * 1000;
interval = r.data[M.StartDate.name].getTime() - (new Date()).getTime();
if (interval >= 0 && interval <= rem) {
X.CalendarManager.ShowReminder(r.data[M.Title.name], r.data[M.StartDate.name].format("Y/m/d H:i"));
}
}
});
},
localize: {
editWin: function(el) {
el.fbar.items.get(0).text = String.format('<a href="#" id="tblink">{0}</a>', LanguageSet.EditDetail);
el.fbar.items.get(2).text = LanguageSet.Save;
el.fbar.items.get(3).text = LanguageSet.Delete;
el.fbar.items.get(4).text = LanguageSet.Cancel;
var titleItem = el.formPanel.get("title"),
dateRangeItem = el.formPanel.get("date-range"),
calendarItem = el.formPanel.get("calendar");
titleItem.fieldLabel = LanguageSet.Title;
dateRangeItem.fieldLabel = LanguageSet.Date;
dateRangeItem.toText = "~";
dateRangeItem.allDayText = LanguageSet.DateRange;
calendarItem.fieldLabel = LanguageSet.Calendar;
},
editForm: function(el) {
var form = el.get(el.id + "-edit");
form.fbar.items.get(0).text = LanguageSet.Save;
form.fbar.items.get(1).text = LanguageSet.Delete;
form.fbar.items.get(2).text = LanguageSet.Cancel;
var titleItem = form.get("left-col").items.get(0),
dateRangeItem = form.get("left-col").items.get(1),
calendarItem = form.get("left-col").items.get(2),
reminderItem = form.get("left-col").items.get(3),
notesItem = form.get("right-col").items.get(0),
locationItem = form.get("right-col").items.get(1),
weblinkItem = form.get("right-col").items.get(2);
titleItem.fieldLabel = LanguageSet.Title;
dateRangeItem.fieldLabel = LanguageSet.Date;
dateRangeItem.toText = "~";
dateRangeItem.allDayText = LanguageSet.DateRange;
calendarItem.fieldLabel = LanguageSet.Calendar;
reminderItem.fieldLabel = LanguageSet.Reminder;
notesItem.fieldLabel = LanguageSet.Notes;
locationItem.fieldLabel = LanguageSet.Location;
weblinkItem.fieldLabel = LanguageSet.WebLink;
}
}
}; |
<?php
/* @var $this <API key> */
/* @var $model Personspeciality */
/* @var $form CActiveForm */
?>
<div class="form">
<?php
$personid= $model->PersonID;
$form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'spec-form-modal',
'<API key>'=>false,
));
$form= new TbActiveForm();
?>
<?php echo $form->errorSummary($model); ?>
<?php echo CHtml::hiddenField('personid', $personid); ?>
<?php //echo !$model->isNewRecord ? $form->hiddenField($model,'idSpeciality') : "";
//debug($model->attributeLabels("isBudget"));
?>
<div class="row-fluid">
<div class="span2">
<?php echo $form->labelEx($model,'isBudget'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'isBudget'); ?>
</div>
</div>
<div class="span2">
<?php echo $form->labelEx($model,'isContract'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'isContract'); ?>
</div>
</div>
<div class="span3">
<?php echo $form->labelEx($model,'isNeedHostel'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'isNeedHostel'); ?>
</div>
</div>
<?php //if (Yii::app()->user->checkAccess("showFullEntrantForm")): ?>
<div class="span4">
<label for="<?php echo CHtml::activeId($model, 'isHigherEducation'); ?>" >
<?php echo $form-><API key>($model,'isHigherEducation',array(0=>'не отримую', 1=>'отримую' , 2=>"є",3=>'немає')); ?>
<?php
</label>
</div>
<div class="span1">
<?php echo $form->labelEx($model,'edboID'); ?>
<?php echo $form->textField($model,'edboID',array('class'=>"span12")); ?>
<?php //echo $form->error($model,'AdditionalBall'); ?>
</div>
<?php //endif; ?>
</div>
<hr>
<div class="row-fluid">
<div class="span5">
<?php echo $form->labelEx($model,'EntrantDocumentID'); ?>
<?php echo $form->dropDownList($model,'EntrantDocumentID', Documents::<API key>($personid),array('class'=>'span12')); ?>
<?php //echo $form->error($model,'CourseID'); ?>
</div>
<div class="span2">
<?php echo $form->labelEx($model,'isCopyEntrantDoc'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'isCopyEntrantDoc'); ?>
</div>
<?php //echo $form->error($model,'isCopyEntrantDoc'); ?>
</div>
<?php // if (Yii::app()->user->checkAccess("showFullEntrantForm")): ?>
<div class="span3">
<?php echo $form->labelEx($model,'SkipDocumentValue'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'SkipDocumentValue'); ?>
</div>
</div>
<?php // endif; ?>
<div class="span2">
<?php
$model->RequestFromEB=1;
echo $form->labelEx($model,'RequestFromEB'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'RequestFromEB'); ?>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span2">
<?php echo $form->labelEx($model,'CourseID'); ?>
<?php echo $form->dropDownList($model,'CourseID', CHtml::listData(Courses::model()->findAll(), 'idCourse', 'CourseName'),
array( 'empty'=>'','class'=>'span12',
'disabled'=>!$model->isNewRecord || Yii::app()->user->isPkSet("CourseID"))); ?>
<?php //echo $form->error($model,'CourseID'); ?>
</div>
<div class="span2">
<?php echo $form->labelEx($model,'EducationFormID'); ?>
<?php echo $form->dropDownList($model,'EducationFormID',CHtml::listData(<API key>::model()->findAll(), '<API key>', '<API key>'),
array( 'empty'=>'', 'class'=>"span12",
'disabled'=>!$model->isNewRecord,
'onchange'=>"PSN.onFacChange(this, '#".CHtml::activeId($model, "SepcialityID")."','".CController::createUrl('personspeciality/speciality')."');")); ?>
<?php //echo $form->error($model,'EducationFormID'); ?>
</div>
<div class="span4">
<?php if (empty($model->sepciality)) {
$idFacultet = 0;
} else {
$idFacultet= $model->sepciality->FacultetID;
}
echo CHtml::label("Факультет", "idFacultet")?>
<?php echo CHtml::dropDownList('idFacultet', $idFacultet , CHtml::listData(Facultets::model()->findAll(array('order'=>'FacultetFullName')),'idFacultet','FacultetFullName'),
array('empty'=>'',
'disabled'=>!$model->isNewRecord,
'onchange'=>"PSN.onFacChange(this, '#".CHtml::activeId($model, "SepcialityID")."','".CController::createUrl('personspeciality/speciality')."');",
'class'=>"span12")
);
?>
</div>
<div class="span4">
<?php $url = Yii::app()->createUrl("personspeciality/znosubjects",array("personid"=>$personid));
echo $form->labelEx($model,'SepcialityID'); ?>
<?php echo $form->dropDownList($model,'SepcialityID', Specialities::DropDown($idFacultet),
array( 'empty'=>'','class'=>"span12",
'disabled'=>!$model->isNewRecord,
'onchange'=>"PSN.changeSpeciality(this, '$url')") ); ?>
<?php //echo $form->error($model,'SepcialityID'); ?>
</div>
<!-- <div class="span2">
<?php //echo $form->labelEx($model,'PaymentTypeID'); ?>
<?php //echo $form->dropDownList($model,'PaymentTypeID', CHtml::listData(<API key>::model()->findAll(), '<API key>', '<API key>'),
//array( 'empty'=>'','class'=>"span12")); ?>
<?php //echo $form->error($model,'PaymentTypeID'); ?>
</div>
</div>
<div class="row-fluid">
<div class="span2">
<?php echo $form->labelEx($model,'QualificationID'); ?>
<?php echo $form->dropDownList($model,'QualificationID',CHtml::listData(Qualifications::model()->findAll(), 'idQualification', 'QualificationName'),
array('empty'=>'', 'class'=>"span12",
'disabled'=>!$model->isNewRecord,
//Yii::app()->user->isPkSet("QualificationID")
)); ?>
<?php //echo $form->error($model,'QualificationID'); ?>
</div>
<div class="span4">
<?php echo $form->labelEx($model,'EntranceTypeID'); ?>
<?php echo $form->dropDownList($model,'EntranceTypeID',CHtml::listData(<API key>::model()->findAll(), '<API key>', '<API key>'),
array('empty'=>'', 'class'=>"span12",'onchange'=>"PSN.changeEntranceType(this, '$url')", )); ?>
<?php //echo $form->error($model,'EntranceTypeID'); ?>
</div>
<div class="span6">
<?php echo $form->labelEx($model,'CausalityID'); ?>
<?php echo $form->dropDownList($model,'CausalityID', CHtml::listData(Causality::model()->findAll(), 'idCausality', 'CausalityName'),
array('empty'=>'', 'class'=>"span12 causality",
"disabled"=>$model->EntranceTypeID == 1 ? "disabled":"")); ?>
<?php //echo $form->error($model,'CausalityID'); ?>
</div>
</div>
<div class="row-fluid">
<!-- <div class="span2">
<?php //echo $form->labelEx($model,'isTarget'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php //echo $form->checkBox($model,'isTarget'); ?>
</div>
<?php //echo $form->error($model,'isTarget'); ?>
</div>
<!-- <div class="span2">
<?php // echo //$form->labelEx($model,'isContact'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php // echo //$form->checkBox($model,'isContact'); ?>
</div>
<?php //echo $form->error($model,'isContact'); ?>
</div>
<!-- <div class="span2">
<?php echo $form->labelEx($model,'AdditionalBall'); ?>
<?php echo $form->textField($model,'AdditionalBall',array('class'=>"span12")); ?>
<?php //echo $form->error($model,'AdditionalBall'); ?>
</div>
<div class="span10">
<?php echo $form->labelEx($model,'<API key>'); ?>
<?php echo $form->textField($model,'<API key>',array('class'=>"span12")); ?>
<?php //echo $form->error($model,'AdditionalBall'); ?>
</div>
</div>
<!-- ZNO -->
<div class="row-fluid" id="subjects-holder">
<?php $this->renderPartial("_subjects_holder", array("model"=>$model,'specialityid'=>$model->SepcialityID)); ?>
</div>
<hr>
<div class="row-fluid">
<div class="span3">
<?php echo $form->labelEx($model,'CoursedpID'); ?>
<?php echo $form->dropDownList($model,'CoursedpID', CHtml::listData(Coursedp::model()->findAll(), "idCourseDP", "CourseDPName"), array('empty'=>"",'class'=>"span12")); ?>
<?php //echo $form->error($model,'CoursedpID'); ?>
</div>
<div class="span3">
<?php echo $form->labelEx($model,'CoursedpBall'); ?>
<?php echo $form->textField($model,'CoursedpBall',array('class'=>"span12")); ?>
<?php //echo $form->error($model,'AdditionalBall'); ?>
</div>
</div>
<?php if (Yii::app()->user->checkAccess("showFullEntrantForm")): ?>
<div class="row-fluid">
<div class="span4">
<?php echo $form->labelEx($model,'OlympiadID'); ?>
<?php echo $form->dropDownList($model,'OlympiadID', Olympiadsawards::DropDown(), array('empty'=>"",'class'=>"span12")); ?>
<?php //echo $form->error($model,'CoursedpID'); ?>
</div>
<div class="span2">
<?php echo $form->labelEx($model,'Quota1'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'Quota1'); ?>
</div>
<?php //echo $form->error($model,'isContact'); ?>
</div>
<div class="span4">
<?php echo $form->labelEx($model,'Quota2'); ?>
<div class="switch" data-on-label="Так" data-off-label="Ні">
<?php echo $form->checkBox($model,'Quota2'); ?>
</div>
<?php //echo $form->error($model,'isContact'); ?>
</div>
<div class="span2">
<?php echo $form->labelEx($model,'StatusID'); ?>
<?php echo $form->dropDownList($model, 'StatusID', CHtml::listData( <API key>::model()->findAll(), "<API key>", "<API key>"), array('empty'=>"",'class'=>"span12")); ?>
<?php //echo $form->error($model,'CoursedpID'); ?>
</div>
</div>
<? endif; ?>
<!
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Створити' : 'Зберегти'); ?>
</div>
<?php $this->endWidget();?>
<script>
$("#spec-form-modal .switch").bootstrapSwitch();
//PSN.changeEntranceType($('#<?php echo CHtml::activeId($model, 'EntranceTypeID');?>').get(0));
</script>
</div><!-- form --> |
<?php
require_once('xassetBaseObject.php');
require_once('crypt.php');
class <API key> extends XAssetBaseObject {
var $weight;
function <API key>($id = null) {
$this->initVar('id', XOBJ_DTYPE_INT, null, false);
$this->initVar('application_id', XOBJ_DTYPE_INT, null, false);
$this->initVar('group_id', XOBJ_DTYPE_INT, null, false);
$this->weight = 17;
if (isset($id)) {
if (is_array($id)) {
$this->assignVars($id);
}
} else {
$this->setNew();
}
}
function &getApplication() {
$app =& xoops_modulehandler('application','xasset');
return $app->get($this->getVar('applicationid'));
}
}
class <API key> extends <API key> {
//vars
var $_db;
var $classname = '<API key>';
var $_dbtable = '<API key>';
//cons
function <API key>(&$db)
{
$this->_db = $db;
}
function &getInstance(&$db)
{
static $instance;
if(!isset($instance)) {
$instance = new <API key>($db);
}
return $instance;
}
function getGroupIDArray($appID) {
$crit = new Criteria('application_id',$appID);
$objs = $this->getObjects($crit);
$ar = array();
foreach($objs as $key=>$obj) {
$ar[$obj->getVar('group_id')] = true;
}
return $ar;
}
function &getAppObjectsByUID($uid) {
$hMember =& xoops_gethandler('member');
$aGroups = $hMember->getGroupsByUser($uid);
//filter this if user is register and member of full group then remove the registered group
// if (count($aGroups)>1) {
// $tmp = array();
// foreach($aGroups as $key=>$grp) {
// if ($grp <> XOOPS_GROUP_USERS) {
// $tmp[] = $grp;
// $aGroups = $tmp;
$crit = new CriteriaCompo();
if ($uid>0) {
for($i=0;$i<count($aGroups);$i++) {
if ($i == 0) {
$crit->add(new Criteria('group_id',$aGroups[$i]));
} else {
$crit->add(new Criteria('group_id',$aGroups[$i]),'or');
}
}
} else {
$crit->add(new Criteria('group_id',<API key>));
}
return $this->getObjects($crit);
}
function getCBGroupString($appID = 0) {
$hMember =& xoops_gethandler('member');
$groups = $hMember->getGroups();
if ($appID > 0) {
$aAppGroups = $this->getGroupIDArray($appID);
} else {
$aAppGroups = array();
}
$grps = '';
foreach($groups as $group) {
$name = $group->getVar('name');
$grpid = $group->getVar('groupid');
if (isset($aAppGroups[$group->getVar('groupid')])) {
$checked = 'checked=checked';
} else {
$checked = '';
}
$grps .= "<input name='cb[]' type='checkbox' value='$grpid' $checked> $name";
}
return $grps;
}
function updateGroup($appID, $aGrps=null) {
$table = $this->_db->prefix($this->_dbtable);
$sql = "delete from $table where application_id = $appID";
$this->_db->queryF($sql);
if (isset($aGrps)) {
foreach($aGrps as $key=>$groupid) {
$grp =& $this->create();
$grp->setVar('application_id',$appID);
$grp->setVar('group_id',$groupid);
$this->insert($grp);
}
}
}
function insert(&$obj, $force = false)
{
parent::insert($obj, $force);
// Copy all object vars into local variables
foreach ($obj->cleanVars as $k => $v) {
${$k} = $v;
}
// Create query for DB update
if ($obj->isNew()) {
// Determine next auto-gen ID for table
$id = $this->_db->genId($this->_db->prefix($this->_dbtable).'_uid_seq');
$sql = sprintf( 'INSERT INTO %s (id, application_id, group_id)
VALUES (%u, %u, %u)',
$this->_db->prefix($this->_dbtable), $id, $application_id, $group_id);
} else {
$sql = sprintf('UPDATE %s SET application_id = %u, group_id = %uwhere id = %u',
$this->_db->prefix($this->_dbtable), $application_id, $group_id, $id);
}
//echo $sql;
// Update DB
if (false != $force) {
$result = $this->_db->queryF($sql);
} else {
$result = $this->_db->query($sql);
}
if (!$result) {
echo $sql;
return false;
}
//Make sure auto-gen ID is stored correctly in object
if (empty($id)) {
$id = $this->_db->getInsertId();
}
$obj->assignVar('id', $id);
return true;
}
} |
<?php
namespace PHPExiftool\Driver\Tag\CanonCustom;
use PHPExiftool\Driver\AbstractTag;
class <API key> extends AbstractTag
{
protected $Id = 1299;
protected $Name = '<API key>';
protected $FullName = 'CanonCustom::Functions2';
protected $GroupName = 'CanonCustom';
protected $g0 = 'MakerNotes';
protected $g1 = 'CanonCustom';
protected $g2 = 'Camera';
protected $Type = 'int32s';
protected $Writable = true;
protected $Description = 'Manual AF Point Select Pattern';
protected $flag_Permanent = true;
protected $Values = array(
0 => array(
'Id' => 0,
'Label' => 'Stops at AF area edges',
),
1 => array(
'Id' => 1,
'Label' => 'Continuous',
),
);
} |
<?php require_once("../../../../wp-load.php"); ?>
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$post_per_page = isset($_REQUEST['postperpage']) ? $_REQUEST['postperpage'] : -1;
$curr_page = isset($_REQUEST['curr_page']) ? $_REQUEST['curr_page'] : 1;
$offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
$costtype = isset($_REQUEST['costtype']) ? $_REQUEST['costtype'] : '';
$searchtext = isset($_REQUEST['searchtext']) ? $_REQUEST['searchtext'] : '';
$coursetype = isset($_REQUEST['coursetype']) ? $_REQUEST['coursetype'] : '';
$subcoursetype = isset($_REQUEST['subcoursetype']) ? $_REQUEST['subcoursetype'] : '';
$webinar = isset($_REQUEST['webinar']) ? $_REQUEST['webinar'] : '';
if(defined('ICL_LANGUAGE_CODE') && !empty($_REQUEST['lang']))
{
global $sitepress;
$sitepress->switch_lang($_REQUEST['lang'], true);
}
$wp_query = new WP_Query();
if(isset($searchtext))
$searchtext = $searchtext;
else
$searchtext = '';
$tax_query = $meta_query = array();
if( !empty( $coursetype) && $coursetype > 0 ) {
$tax_query[] = array( 'taxonomy' => 'course_category',
'field' => 'id',
'terms' => $coursetype,
'operator' => 'IN',);
}
if( !empty($subcoursetype) && $subcoursetype > 0 ) {
$tax_query[] = array( 'taxonomy' => 'course_category',
'field' => 'id',
'terms' => $subcoursetype,
'operator' => 'IN',);
}
if($costtype == 'paid') {
$meta_query[] = array(
'key' => 'starting-price',
'value' => 0,
'type' => 'numeric',
'compare' => '>'
);
} else if($costtype == 'free') {
$meta_query[] = array(
'key' => 'starting-price',
'compare' => 'NOT EXISTS'
);
}
if( isset($webinar) && $webinar == 'on' ) {
$meta_query[] = array( 'key' => 'course-video', 'compare' => 'EXISTS');
}
echo '<span id="<API key>" data-postperpage="'.$post_per_page.'" data-curr_page="'.$curr_page.'" data-offset="'.$offset.'" data-costtype="'.$costtype.'" data-searchtext="'.$searchtext.'" data-coursetype="'.$coursetype.'" data-subcoursetype="'.$subcoursetype.'" data-webinar="'.$webinar.'" style="display:none;"></span>';
$courses_args = array(
'offset' => $offset,
'post_type' => 'dt_courses',
'posts_per_page' => $post_per_page,
'paged' => $curr_page,
's' => $searchtext,
'tax_query' => $tax_query,
'meta_query' => $meta_query,
'order_by' => 'published',
);
echo '<div class="dt-sc-clear"></div>
<div class="<API key>"></div>';
$wp_query->query( $courses_args );
if( $wp_query->have_posts() ):
echo '<table border="0" cellpadding="0" class="courses-table-list tablesorter">
<thead>
<tr>
<th class="<API key>" scope="col">'.__('Course Name','dt_themes').'</th>
<th class="<API key>" scope="col">'.__('Course Type','dt_themes').'</th>
<th class="<API key>" scope="col">'.__('Lessons #','dt_themes').'</th>
<th class="<API key>" scope="col">'.__('Cost','dt_themes').'</th>
<th class="<API key>" scope="col">'.__('Length','dt_themes').'</th>
</tr>
</thead>
<tbody>';
while( $wp_query->have_posts() ):
$wp_query->the_post();
$the_id = get_the_ID();
$permalink = get_permalink($the_id);
$title = get_the_title($the_id);
$terms = get_the_terms($the_id,'course_category');
$course_terms = array();
foreach ( $terms as $term ) {
$course_terms[] = '<a href="'.get_term_link( $term->slug, 'course_category' ).'">'.$term->name.'</a>';
}
$course_terms = join( ", ", $course_terms );
$lesson_args = array('post_type' => 'dt_lessons', 'posts_per_page' => -1, 'meta_key' => 'dt_lesson_course', 'meta_value' => $the_id );
$lessons_array = get_posts( $lesson_args );
$count = $duration = 0;
foreach($lessons_array as $lesson) {
$lesson_data = get_post_meta($lesson->ID, '_lesson_settings');
if(isset($lesson_data[0]['lesson-duration'])) {
$duration = $duration + $lesson_data[0]['lesson-duration'];
$count++;
}
}
if($duration > 0) {
$hours = floor($duration/60);
$mins = $duration % 60;
if($hours == 0) {
$duration = $mins . __(' mins ', 'dt_themes');
} elseif($hours == 1) {
$duration = $hours . __(' hour ', 'dt_themes') . $mins . __(' mins ', 'dt_themes');
} else {
$duration = $hours . __(' hours ', 'dt_themes') . $mins . __(' mins ', 'dt_themes');
}
} else {
$duration = '';
}
$starting_price = dttheme_wp_kses(get_post_meta(get_the_ID(), 'starting-price', true));
if($starting_price != ''):
if(dttheme_option('dt_course','currency-position') == 'after-price')
$cost = $starting_price.dttheme_wp_kses(dttheme_option('dt_course','currency'));
else
$cost = dttheme_wp_kses(dttheme_option('dt_course','currency')).$starting_price;
else:
$cost = __('Free', 'dt_themes');
endif;
echo '<tr>
<td class="courses-table-title"><a href="'.$permalink.'">'.$title.'</a></td>
<td class="courses-table-type">'.$course_terms.'</td>
<td class="<API key>">'.$count.'</td>
<td class="courses-table-cost">'.$cost.'</td>
<td class="<API key>">'.$duration.'</td>
</tr>';
endwhile;
echo '</tbody>';
echo '</table>';
$total_posts = $wp_query->found_posts;
echo <API key>($post_per_page, $curr_page, $total_posts, '');
echo '<script type="text/javascript">
jQuery(document).ready(function($){
if ($(".courses-table-list").length > 0) {
$(".courses-table-list").tablesorter();
}
});
</script>';
else:
echo '<div class="dt-sc-info-box">'.__('No Courses Found!', 'dt_themes').'</div>';
endif;
?> |
{load_language_text section="box_admin"}
{load_language_text section="buttons" name="button"}
{include file="get_usermod:{$tpl_path}snippets/box/default/top.html" class="admin" headline=$txt.heading_admin linkcrypter="true"}
{if $content_data.<API key> && $content_data.<API key>}
<strong>{$content_data.<API key>}</strong>
<br />
{foreach from=$content_data.<API key> item=orders_content}
{$orders_content}
<br/>
{/foreach}
{/if}
{if $content_data.<API key>}
{$content_data.<API key>}
<br/>
{/if}
{if $content_data.<API key>}
{$content_data.<API key>}
<br/>
{/if}
{if $content_data.<API key>}
{$content_data.<API key>}
<br/>
{/if}
<br />
{if !$content_data.ADMIN_LINK_INFO}
<a href="#" rel="nofollow" <API key>="{crypt_link link=$content_data.BUTTON_ADMIN_URL crypt='2'}" class="btn btn-primary btn-block btn-sm" title="{$button.click_here}">
{$button.click_here}
</a>
{/if}
{if $content_data.<API key>}
<br />
<a href="#" rel="nofollow" <API key>="{crypt_link link=$content_data.<API key> crypt='2'}" class="btn btn-primary btn-block btn-sm" title="{$button.edit_product}">
{$button.edit_product}
</a>
{/if}
{include file="get_usermod:{$tpl_path}snippets/box/default/bottom.html"} |
package net.sf.l2j.gameserver;
import java.util.Map;
import java.util.logging.Logger;
import javolution.util.FastMap;
import net.sf.l2j.gameserver.lib.SqlUtils;
import net.sf.l2j.gameserver.model.L2Territory;
public class Territory
{
private static Logger _log = Logger.getLogger(TradeController.class.getName());
private static final Territory _instance = new Territory();
private static final Map<Integer, L2Territory> _territory = new FastMap<>();
public static Territory getInstance()
{
return _instance;
}
private Territory()
{
// load all data at server start
reload_data();
}
public int[] getRandomPoint(int terr)
{
return _territory.get(terr).getRandomPoint();
}
public int getProcMax(int terr)
{
return _territory.get(terr).getProcMax();
}
public void reload_data()
{
_territory.clear();
Integer[][] point = SqlUtils.get2DIntArray(new String[]
{
"loc_id",
"loc_x",
"loc_y",
"loc_zmin",
"loc_zmax",
"proc"
}, "locations", "loc_id > 0");
for (Integer[] row : point)
{
// _log.info("row = "+row[0]);
Integer terr = row[0];
if (terr == null)
{
_log.warning("Null territory!");
continue;
}
if (_territory.get(terr) == null)
{
L2Territory t = new L2Territory(terr);
_territory.put(terr, t);
}
_territory.get(terr).add(row[1], row[2], row[3], row[4], row[5]);
}
}
} |
/* ScriptData
SDName: Bloodmyst_Isle
SD%Complete: 80
SDComment: Quest support: 9670
SDCategory: Bloodmyst Isle
EndScriptData */
/* ContentData
npc_webbed_creature
EndContentData */
#include "Player.h"
#include "Group.h"
#include "GridNotifiersImpl.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "PassiveAI.h"
#include "CellImpl.h"
//possible creatures to be spawned
uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327};
enum WebbedCreature
{
<API key> = 17681
};
class npc_webbed_creature : public CreatureScript
{
public:
npc_webbed_creature() : CreatureScript("npc_webbed_creature") { }
struct <API key> : public NullCreatureAI
{
<API key>(Creature* creature) : NullCreatureAI(creature) { }
void Reset() override { }
void EnterCombat(Unit* /*who*/) override { }
void AttackStart(Unit* /*who*/) override { }
void MoveInLineOfSight(Unit* /*who*/) override { }
void JustDied(Unit* killer) override
{
uint32 spawnCreatureID = 0;
switch (urand(0, 2))
{
case 0:
if (Player* player = killer->ToPlayer())
player->KilledMonsterCredit(<API key>);
break;
case 1:
case 2:
spawnCreatureID = possibleSpawns[urand(0, 30)];
break;
}
if (spawnCreatureID)
me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), <API key>, 60000);
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new <API key>(creature);
}
};
enum <API key>
{
SAY_SIRONAS_1 = 0,
SAY_LEGOSO_1 = 0,
SAY_LEGOSO_2 = 1,
SAY_LEGOSO_3 = 2,
SAY_LEGOSO_4 = 3,
SAY_LEGOSO_5 = 4,
SAY_LEGOSO_6 = 5,
SAY_LEGOSO_7 = 6,
SAY_LEGOSO_8 = 7,
SAY_LEGOSO_9 = 8,
SAY_LEGOSO_10 = 9,
SAY_LEGOSO_11 = 10,
SAY_LEGOSO_12 = 11,
SAY_LEGOSO_13 = 12,
SAY_LEGOSO_14 = 13,
SAY_LEGOSO_15 = 14,
SAY_LEGOSO_16 = 15,
SAY_LEGOSO_17 = 16,
SAY_LEGOSO_18 = 17,
SAY_LEGOSO_19 = 18,
SAY_LEGOSO_20 = 19,
SAY_LEGOSO_21 = 20,
<API key> = 31611,
<API key> = 31612,
SPELL_UPPERCUT = 10966,
SPELL_IMMOLATE = 12742,
<API key> = 8282,
SPELL_FROST_SHOCK = 8056,
SPELL_HEALING_SURGE = 8004,
SPELL_SEARING_TOTEM = 38116,
<API key> = 31633,
NPC_SIRONAS = 17678,
<API key> = 17979,
NPC_LEGOSO = 17982,
<API key> = 182088,
<API key> = 182091,
GO_FIRE_EXPLOSION = 182071,
<API key> = 1,
<API key> = 2,
<API key> = 1,
EVENT_UPPERCUT = 1,
EVENT_IMMOLATE = 2,
<API key> = 3,
EVENT_FROST_SHOCK = 1,
EVENT_HEALING_SURGE = 2,
EVENT_SEARING_TOTEM = 3,
<API key> = 4,
WP_START = 1,
<API key> = 21,
<API key> = 22,
<API key> = 23,
<API key> = 24,
WP_DEBUG_1 = 25,
WP_DEBUG_2 = 26,
WP_SIRONAS_HILL = 33,
<API key> = 35,
<API key> = 39,
<API key> = 40,
PHASE_NONE = 0,
PHASE_CONTINUE = -1,
PHASE_WP_26 = 1,
PHASE_WP_22 = 2,
<API key> = 3,
<API key> = 4,
<API key> = 5,
<API key> = 6,
<API key> = 7,
<API key> = 8,
<API key> = 9,
<API key> = 10,
<API key> = 11,
<API key> = 12,
<API key> = 13,
<API key> = 14,
<API key> = 15,
<API key> = 16,
<API key> = 17,
<API key> = 18,
<API key> = 19,
<API key> = 20,
<API key> = 21,
<API key> = 22,
<API key> = 23,
<API key> = 24,
<API key> = 25,
<API key> = 26,
<API key> = 27,
<API key> = 28,
<API key> = 29,
<API key> = 30,
<API key> = 31,
<API key> = 32,
<API key> = 33,
<API key> = 34,
<API key> = 35,
<API key> = 0,
MAX_EXPLOSIVES = 5,
<API key> = 9759
};
Position const ExplosivesPos[2][MAX_EXPLOSIVES] =
{
{
{ -1954.946f, -10654.714f, 110.448f },
{ -1956.331f, -10654.494f, 110.869f },
{ -1955.906f, -10656.221f, 110.791f },
{ -1957.294f, -10656.000f, 111.219f },
{ -1954.462f, -10656.451f, 110.404f }
},
{
{ -1915.137f, -10583.651f, 178.365f },
{ -1914.006f, -10582.964f, 178.471f },
{ -1912.717f, -10582.398f, 178.658f },
{ -1915.056f, -10582.251f, 178.162f },
{ -1913.883f, -10581.778f, 178.346f }
}
};
class npc_sironas : public CreatureScript
{
public:
npc_sironas() : CreatureScript("npc_sironas") { }
CreatureAI* GetAI(Creature* creature) const
{
return new npc_sironasAI(creature);
}
struct npc_sironasAI : public ScriptedAI
{
npc_sironasAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() override
{
_events.Reset();
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
}
void EnterCombat(Unit* /*who*/) override
{
_events.ScheduleEvent(EVENT_UPPERCUT, 15 * IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_IMMOLATE, 10 * IN_MILLISECONDS);
_events.ScheduleEvent(<API key>, 5 * IN_MILLISECONDS);
}
void JustDied(Unit* killer) override
{
me->SetObjectScale(1.0f);
_events.Reset();
if (Creature* legoso = me->FindNearestCreature(NPC_LEGOSO, SIZE_OF_GRIDS))
{
Group* group = me-><API key>();
if (killer->GetGUID() == legoso->GetGUID() ||
(group && group->IsMember(killer->GetGUID())) ||
killer->GetGUID().GetCounter() == legoso->AI()->GetData(<API key>))
legoso->AI()->DoAction(<API key>);
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_UPPERCUT:
DoCastVictim(SPELL_UPPERCUT);
_events.ScheduleEvent(EVENT_UPPERCUT, urand(10, 12) * IN_MILLISECONDS);
break;
case EVENT_IMMOLATE:
DoCastVictim(SPELL_IMMOLATE);
_events.ScheduleEvent(EVENT_IMMOLATE, urand(15, 20) * IN_MILLISECONDS);
break;
case <API key>:
DoCastVictim(<API key>);
_events.ScheduleEvent(<API key>, urand(20, 25) * IN_MILLISECONDS);
break;
default:
break;
}
}
<API key>();
}
void DoAction(int32 param) override
{
switch (param)
{
case <API key>:
{
DoCast(me, <API key>);
std::list<Creature*> BeamList;
_beamGuidList.clear();
me-><API key>(BeamList, <API key>, SIZE_OF_GRIDS);
for (std::list<Creature*>::iterator itr = BeamList.begin(); itr != BeamList.end(); ++itr)
{
_beamGuidList.push_back((*itr)->GetGUID());
(*itr)->CastSpell(*itr, <API key>);
}
break;
}
case <API key>:
{
me-><API key>(true, <API key>);
std::list<Creature*> creatureList;
<API key>(creatureList, me, <API key>, 500.0f);
if (!creatureList.empty())
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
(*itr)-><API key>(true, <API key>);
}
default:
break;
}
}
private:
GuidList _beamGuidList;
EventMap _events;
};
};
class <API key> : public CreatureScript
{
public:
<API key>() : CreatureScript("<API key>") { }
CreatureAI* GetAI(Creature* creature) const
{
return new <API key>(creature);
}
struct <API key> : public npc_escortAI
{
<API key>(Creature* creature) : npc_escortAI(creature)
{
Initialize();
}
void sQuestAccept(Player* player, Quest const* quest) override
{
if (quest->GetQuestId() == <API key>)
{
SetData(<API key>, player->GetGUID().GetCounter());
Start(true, true, player->GetGUID(), quest);
}
}
uint32 GetData(uint32 id) const override
{
switch (id)
{
case <API key>:
return <API key>;
default:
return 0;
}
}
void SetData(uint32 data, uint32 value) override
{
switch (data)
{
case <API key>:
<API key> = value;
break;
default:
break;
}
}
void Initialize()
{
_phase = PHASE_NONE;
_moveTimer = 0;
<API key> = 0;
}
void Reset() override
{
Initialize();
me->SetCanDualWield(true);
_events.Reset();
_events.ScheduleEvent(EVENT_FROST_SHOCK, 1 * IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_HEALING_SURGE, 5 * IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_SEARING_TOTEM, 15 * IN_MILLISECONDS);
_events.ScheduleEvent(<API key>, 20 * IN_MILLISECONDS);
}
void UpdateAI(uint32 diff) override
{
_events.Update(diff);
if (UpdateVictim())
{
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_FROST_SHOCK:
DoCastVictim(SPELL_FROST_SHOCK);
_events.DelayEvents(1 * IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_FROST_SHOCK, urand(10, 15) * IN_MILLISECONDS);
break;
case EVENT_SEARING_TOTEM:
DoCast(me, SPELL_SEARING_TOTEM);
_events.DelayEvents(1 * IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_SEARING_TOTEM, urand(110, 130) * IN_MILLISECONDS);
break;
case <API key>:
DoCast(me, <API key>);
_events.DelayEvents(1 * IN_MILLISECONDS);
_events.ScheduleEvent(<API key>, urand(110, 130) * IN_MILLISECONDS);
break;
case EVENT_HEALING_SURGE:
{
Unit* target = NULL;
if (me->GetHealthPct() < 85)
target = me;
else if (Player* player = GetPlayerForEscort())
if (player->GetHealthPct() < 85)
target = player;
if (target)
{
DoCast(target, SPELL_HEALING_SURGE);
_events.ScheduleEvent(EVENT_HEALING_SURGE, 10 * IN_MILLISECONDS);
}
else
_events.ScheduleEvent(EVENT_HEALING_SURGE, 2 * IN_MILLISECONDS);
break;
}
default:
break;
}
}
<API key>();
}
if (HasEscortState(STATE_ESCORT_NONE))
return;
npc_escortAI::UpdateAI(diff);
if (_phase)
{
if (_moveTimer <= diff)
{
switch (_phase)
{
case PHASE_WP_26: //debug skip path to point 26, buggy path calculation
me->GetMotionMaster()->MovePoint(WP_DEBUG_2, -2021.77f, -10648.8f, 129.903f, false);
_moveTimer = 2 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case PHASE_CONTINUE: // continue escort
SetEscortPaused(false);
_moveTimer = 0 * IN_MILLISECONDS;
_phase = PHASE_NONE;
break;
case PHASE_WP_22: //debug skip path to point 22, buggy path calculation
me->GetMotionMaster()->MovePoint(<API key>, -1958.026f, -10660.465f, 111.547f, false);
Talk(SAY_LEGOSO_3);
_moveTimer = 2 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant first explosives stage 1 kneel
me->SetStandState(<API key>);
_moveTimer = 10 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant first explosives stage 1 stand
me->SetStandState(<API key>);
_moveTimer = 0.5* IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant first explosives stage 2 work
Talk(SAY_LEGOSO_4);
_moveTimer = 17.5 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant first explosives finish
_explosivesGuids.clear();
for (uint8 i = 0; i != MAX_EXPLOSIVES; ++i)
{
if (GameObject* explosive = me->SummonGameObject(<API key>, ExplosivesPos[0][i].m_positionX, ExplosivesPos[0][i].m_positionY, ExplosivesPos[0][i].m_positionZ, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
_explosivesGuids.push_back(explosive->GetGUID());
}
me->HandleEmoteCommand(EMOTE_ONESHOT_NONE); // reset anim state
// force runoff movement so he will not screw up next waypoint
me->GetMotionMaster()->MovePoint(<API key>, -1955.6f, -10669.8f, 110.65f, false);
Talk(SAY_LEGOSO_5);
_moveTimer = 1.5 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case <API key>: // first explosives detonate timer 1
Talk(SAY_LEGOSO_6);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // first explosives detonate timer 2
Talk(SAY_LEGOSO_7);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // first explosives detonate timer 3
Talk(SAY_LEGOSO_8);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // first explosives detonate finish
for (GuidList::iterator itr = _explosivesGuids.begin(); itr != _explosivesGuids.end(); ++itr)
{
if (GameObject* explosive = ObjectAccessor::GetGameObject(*me, *itr))
me->RemoveGameObject(explosive, true);
}
_explosivesGuids.clear();
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
_moveTimer = 2 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // after detonation 1 speech
Talk(SAY_LEGOSO_9);
_moveTimer = 4 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // after detonation 1 rotate to next point
me->SetFacingTo(2.272f);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // after detonation 1 send point anim and go on to next point
me->HandleEmoteCommand(EMOTE_ONESHOT_POINT);
_moveTimer = 2 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case <API key>: // legoso exclamation before sironas 1.1
Talk(SAY_LEGOSO_10);
_moveTimer = 4 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation before sironas 1.2
Talk(SAY_LEGOSO_11);
_moveTimer = 4 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case <API key>: // legoso exclamation before sironas 2.1
Talk(SAY_LEGOSO_12);
_moveTimer = 4 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation before sironas 2.2
if (Player* player = GetPlayerForEscort())
me->SetFacingToObject(player);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation before sironas 2.3
Talk(SAY_LEGOSO_13);
_moveTimer = 7 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case <API key>: // plant second explosives stage 1 kneel
me->SetStandState(<API key>);
_moveTimer = 11 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant second explosives stage 2 kneel
Talk(SAY_LEGOSO_14);
_moveTimer = 13 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant second explosives finish
me->SetStandState(<API key>);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant second explosives finish - create explosives
_explosivesGuids.clear();
for (uint8 i = 0; i != MAX_EXPLOSIVES; ++i)
{
if (GameObject* explosive = me->SummonGameObject(<API key>, ExplosivesPos[1][i].m_positionX, ExplosivesPos[1][i].m_positionY, ExplosivesPos[1][i].m_positionZ, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
_explosivesGuids.push_back(explosive->GetGUID());
}
Talk(SAY_LEGOSO_15);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // plant second explosives finish - proceed to next point
_moveTimer = 1 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case <API key>: // second explosives detonate timer 1
Talk(SAY_LEGOSO_16);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // second explosives detonate timer 2
Talk(SAY_LEGOSO_17);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // second explosives detonate timer 3
Talk(SAY_LEGOSO_18);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // second explosives detonate finish
for (GuidList::iterator itr = _explosivesGuids.begin(); itr != _explosivesGuids.end(); ++itr)
{
if (GameObject* explosive = ObjectAccessor::GetGameObject(*me, *itr))
me->RemoveGameObject(explosive, true);
}
_explosivesGuids.clear();
if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS))
{
sironas->RemoveFlag(UNIT_FIELD_FLAGS, <API key> | <API key>);
me->SetFacingToObject(sironas);
}
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // sironas channel stop
if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS))
sironas->AI()->DoAction(<API key>);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // sironas exclamation before aggro
if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS))
sironas->AI()->Talk(SAY_SIRONAS_1);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation before aggro
if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS))
sironas->SetObjectScale(3.0f);
Talk(SAY_LEGOSO_19);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation at aggro
if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS))
{
Unit* target = GetPlayerForEscort();
if (!target)
target = me;
target->AddThreat(sironas, 0.001f);
sironas->Attack(target, true);
sironas->GetMotionMaster()->MoveChase(target);
}
_moveTimer = 10 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case <API key>: // legoso exclamation after battle - stage 1.1
Talk(SAY_LEGOSO_20);
_moveTimer = 2 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation after battle - stage 1.2
me->HandleEmoteCommand(<API key>);
_moveTimer = 2 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation after battle - stage 1.3
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(<API key>, me);
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
_moveTimer = 5 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>: // legoso exclamation after battle - stage 2
Talk(SAY_LEGOSO_21);
_moveTimer = 30 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
default:
break;
}
}
else if (!me->IsInCombat())
_moveTimer -= diff;
}
}
void WaypointReached(uint32 waypointId) override
{
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (waypointId)
{
case WP_START:
SetEscortPaused(true);
me->SetFacingToObject(player);
Talk(SAY_LEGOSO_1);
_moveTimer = 2.5 * IN_MILLISECONDS;
_phase = PHASE_CONTINUE;
break;
case <API key>:
SetEscortPaused(true);
Talk(SAY_LEGOSO_2);
_moveTimer = 8 * IN_MILLISECONDS;
_phase = PHASE_WP_22;
break;
case <API key>:
me->SetFacingTo(1.46f);
break;
case <API key>:
SetEscortPaused(true);
me->SetFacingTo(1.05f);
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
case WP_DEBUG_1:
SetEscortPaused(true);
_moveTimer = 0.5 * IN_MILLISECONDS;
_phase = PHASE_WP_26;
break;
case WP_SIRONAS_HILL:
{
SetEscortPaused(true);
//Find Sironas and make it respawn if needed
Creature* sironas = NULL;
Trinity::<API key> check(me, NPC_SIRONAS, SIZE_OF_GRIDS);
Trinity::CreatureSearcher<Trinity::<API key>> searcher(me, sironas, check);
me->VisitNearbyObject(SIZE_OF_GRIDS, searcher);
if (sironas)
{
if (!sironas->IsAlive())
sironas->Respawn(true);
sironas->AI()->DoAction(<API key>);
me->SetFacingToObject(sironas);
}
_moveTimer = 1 * IN_MILLISECONDS;
_phase = <API key>;
break;
}
case <API key>:
SetEscortPaused(true);
_moveTimer = 0.2 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>:
SetEscortPaused(true);
_moveTimer = 0.5 * IN_MILLISECONDS;
_phase = <API key>;
break;
case <API key>:
SetEscortPaused(true);
me->SetFacingTo(5.7f);
_moveTimer = 2 * IN_MILLISECONDS;
_phase = <API key>;
break;
default:
break;
}
}
void DoAction(int32 param) override
{
switch (param)
{
case <API key>:
_phase = <API key>;
_moveTimer = 5 * IN_MILLISECONDS;
break;
default:
break;
}
}
private:
int8 _phase;
uint32 _moveTimer;
uint32 <API key>;
GuidList _explosivesGuids;
EventMap _events;
};
};
void <API key>()
{
new npc_webbed_creature();
new npc_sironas();
new <API key>();
} |
package org.openjdk.jmh.ct.states.dag.cycles;
import org.junit.Test;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.ct.CompileTest;
public class <API key> {
@State(Scope.Thread)
public static class B1 {
@Setup
public void setup(B2 b1) {
}
}
@State(Scope.Thread)
public static class B2 {
@Setup
public void setup(B1 b1) {
}
}
@Benchmark
public void test(B1 b1) {
}
@Test
public void compileTest() {
CompileTest.assertFail(this.getClass(), "@State dependency cycle is detected");
}
} |
<div id="afl-form-options">
<div id="<API key>">
<div class="afl-options-page te-form">
<div class="<API key>">
<?php
<API key>( 0, $type, $data );
if (empty($data['thumb'])) {
$data['thumb'] = <API key>().'/lib/css/images/noimage.png';
}
?>
<div class="afl-single-set">
<div class="afl-section afl-2columns te-upload">
<div class="<API key>">
<h4><?php print __('Image', 'afl'); ?></h4>
<div>
<span class="afl-style-wrap">
<?php
if(!isset($data['parallax_image_url']))$data['parallax_image_url']='';
print <API key>("parallax_image_url", array('type' => 'text', 'default_value' => $data['parallax_image_url'], 'uploadable' => true, 'button_class' => 'with_thumbs', 'attributes' => array('class' => 'regular-text', 'name' => "parallax_image_url"))); ?>
</span>
</div>
<div class="afl-clear"></div>
</div>
</div>
<div class="afl-section afl-2columns">
<h4>Preview</h4>
<div class="<API key>">
<div class="afl-description"></div>
<div class="afl-control">
<span class="afl-style-wrap">
<input type="hidden" name="thumb" value="" />
<a href="<?php print $data['parallax_image_url']; ?>" data-rel="prettyPhoto"><img src="<?php print $data['thumb']; ?>" height="70" alt="parallax"/></a>
</span>
</div>
<div class="afl-clear"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){
jQuery("a[rel^='prettyPhoto']").prettyPhoto();
});
</script> |
#!/usr/bin/env python
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import <API key> as <API key>
from Cheetah.Version import <API key> as <API key>
from Cheetah.Template import Template
from Cheetah.DummyTransaction import *
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, <API key>
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from urllib import quote
from Plugins.Extensions.OpenWebif.local import tstrings
## MODULE CONSTANTS
VFFSL=<API key>
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.4.4'
<API key> = (2, 4, 4, 'development', 0)
__CHEETAH_genTime__ = 1406885499.299002
<API key> = 'Fri Aug 1 18:31:39 2014'
__CHEETAH_src__ = '/home/wslee2/models/5-wo/force1plus/openpli3.0/build-force1plus/tmp/work/mips32el-oe-linux/<API key>+git5+<SHA1-like>-r0/git/plugin/controllers/views/ajax/satellites.tmpl'
<API key> = 'Fri Aug 1 18:30:05 2014'
<API key> = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if <API key> < <API key>:
raise AssertionError(
'This template was compiled with Cheetah version'
' %s. Templates compiled before version %s must be recompiled.'%(
__CHEETAH_version__, <API key>))
## CLASSES
class satellites(Template):
## CHEETAH GENERATED METHODS
def __init__(self, *args, **KWs):
super(satellites, self).__init__(*args, **KWs)
if not self.<API key>:
cheetahKWArgs = {}
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
for k,v in KWs.items():
if k in allowedKWs: cheetahKWArgs[k] = v
self.<API key>(**cheetahKWArgs)
def respond(self, trans=None):
## CHEETAH: main method generated for this template
if (not trans and not self.<API key> and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self.<API key>
_filter = self.<API key>
## START - generated method body
write(u'''<script>
$(function() { InitAccordeon("#accordionS");});
</script>
<div id="accordionS">
''')
for satellite in VFFSL(SL,"satellites",True): # generated from line 7, col 1
write(u'''\t<h1><a href="#" id="ajax/channels?id=''')
_v = VFFSL(SL,"quote",False)(VFFSL(SL,"satellite.service",True)) # u'$quote($satellite.service)' on line 8, col 39
if _v is not None: write(_filter(_v, rawExpr=u'$quote($satellite.service)')) # from line 8, col 39.
write(u'''&stype=''')
_v = VFFSL(SL,"stype",True) # u'$stype' on line 8, col 72
if _v is not None: write(_filter(_v, rawExpr=u'$stype')) # from line 8, col 72.
write(u)
_v = VFFSL(SL,"satellite.name",True) # u'$satellite.name' on line 8, col 80
if _v is not None: write(_filter(_v, rawExpr=u'$satellite.name')) # from line 8, col 80.
write(u'''</a></h1>
<div>
''')
_v = VFFSL(SL,"tstrings",True)['loading'] # u"$tstrings['loading']" on line 10, col 1
if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['loading']")) # from line 10, col 1.
write(u''' ...
\t</div>
''')
write(u'''</div>''')
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
## CHEETAH GENERATED ATTRIBUTES
<API key> = False
_CHEETAH_version = __CHEETAH_version__
<API key> = <API key>
_CHEETAH_genTime = __CHEETAH_genTime__
<API key> = <API key>
_CHEETAH_src = __CHEETAH_src__
<API key> = <API key>
<API key>= 'respond'
## END CLASS DEFINITION
if not hasattr(satellites, '<API key>'):
templateAPIClass = getattr(satellites, '<API key>', Template)
templateAPIClass.<API key>(satellites)
# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
## if run from command line:
if __name__ == '__main__':
from Cheetah.<API key> import CmdLineIface
CmdLineIface(templateObj=satellites()).run() |
#include "cards_install.h"
Cards_install::Cards_install(const CardsArgumentParser& argParser,
const std::string& configFileName)
: Pkginst("cards install",configFileName),m_argParser(argParser)
{
parseArguments();
for( auto i : m_argParser.otherArguments() ) {
if ( <API key>(i).empty() &&
(! checkBinaryExist(i) ) ) {
m_actualError = PACKAGE_NOT_FOUND;
treatErrors(i);
}
}
Pkgrepo::parseConfig(configFileName, m_config);
<API key>();
for( auto i : m_argParser.otherArguments() ) {
std::set<std::string> ListOfPackage = <API key>(i);
if ( (!ListOfPackage.empty()) && (!checkBinaryExist(i)) ) {
for (auto i : ListOfPackage ) {
if (<API key>(i))
continue;
m_packageName = i;
<API key>();
}
} else {
m_packageName = i;
<API key>();
}
}
<API key>();
for ( auto i : m_dependenciesList ) {
<API key> = getPackageFileName(i);
ArchiveUtils packageArchive(<API key>.c_str());
std::string name = packageArchive.name();
if ( <API key>(name )) {
m_upgrade=1;
} else {
m_upgrade=0;
}
run();
}
}
Cards_install::Cards_install(const CardsArgumentParser& argParser,
const std::string& configFileName,
const std::vector<std::string>& listOfPackages)
: Pkginst("cards install",configFileName),m_argParser(argParser)
{
parseArguments();
<API key>(false);
for (auto i : listOfPackages) {
std::string packageName = basename(const_cast<char*>(i.c_str()));
if ( packageName == m_argParser.otherArguments()[0])
break;
std::set<std::string> listofBinaries;
if (findFile(listofBinaries, i) != 0) {
m_actualError = <API key>;
treatErrors(i);
}
for (auto j : listofBinaries ) {
if (j.find("cards.tar")== std::string::npos )
continue;
<API key> = i + "/" + j;
ArchiveUtils packageArchive(<API key>.c_str());
std::string name = packageArchive.name();
if ( ! <API key>(name )) {
m_upgrade=0;
m_force=0;
run();
}
}
}
}
void Cards_install::parseArguments()
{
if (m_argParser.isSet(CardsArgumentParser::OPT_ROOT))
m_root=m_argParser.getOptionValue(CardsArgumentParser::OPT_ROOT);
if (m_root.empty())
m_root="/";
else
m_root=m_root+"/";
if (getuid()) {
m_actualError = <API key>;
treatErrors("");
}
if (m_argParser.isSet(CardsArgumentParser::OPT_FORCE))
m_force=true;
if (m_argParser.isSet(CardsArgumentParser::OPT_UPDATE))
m_upgrade=true;
}
void Cards_install::<API key>()
{
if (m_config.locale.empty())
return;
std::vector<std::string> tmpList;
for ( auto i : m_config.locale ) {
for ( auto j :m_dependenciesList ) {
std::string packageName = j + "." + i;
#ifndef NDEBUG
std::cerr << packageName << endl;
#endif
if (checkBinaryExist(packageName)) {
m_packageFileName = getPackageFileName(packageName);
if ( ! checkFileExist(m_packageFileName) )
<API key>(packageName);
tmpList.push_back(packageName);
}
}
if (tmpList.size() > 0 )
for (auto i : tmpList) m_dependenciesList.push_back(i);
}
#ifndef NDEBUG
for (auto i : m_dependenciesList ) std::cerr << i << endl;
#endif
} |
package ch2.p87.MRUnit;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mrunit.mapreduce.ReduceDriver;
import junit.framework.TestCase;
/**
* WordcountReducer
* @author PLAYMORE
*
*/
public class <API key> extends TestCase{
private Reducer<Text, LongWritable, Text, LongWritable> reducer;
private ReduceDriver<Text, LongWritable, Text, LongWritable> driver;
@Override
protected void setUp() throws Exception {
super.setUp();
reducer=new WordCountReducer();
driver=new ReduceDriver<Text, LongWritable, Text, LongWritable>(reducer);
}
public void testReducer(){
List<LongWritable> values=new ArrayList<LongWritable>();
values.add(new LongWritable(2));
values.add(new LongWritable(2));
driver.withInput(new Text("this"), values);
//driver.withInput(new Text("this"), (List<IntWritable>) new IntWritable(1));
List<LongWritable> values2=new ArrayList<LongWritable>();
values2.add(new LongWritable(4));
// values2.add(new LongWritable(2));
driver.withInput(new Text("you"), values2);
driver.withOutput(new Text("you"), new LongWritable(4));
driver.runTest();
}
} |
# encoding: utf-8
# module apt_pkg
# from /usr/lib/python3/dist-packages/apt_pkg.<API key>.so
# by generator 1.135
"""
Classes and functions wrapping the apt-pkg library.
The apt_pkg module provides several classes and functions for accessing
the functionality provided by the apt-pkg library. Typical uses might
include reading APT index files and configuration files and installing
or removing packages.
"""
# no imports
from .object import object
class Description(object):
"""
Represent a package description and some attributes. Needed for
things like translated descriptions.
"""
def __init__(self, *args, **kwargs): # real signature unknown
pass
def __repr__(self, *args, **kwargs): # real signature unknown
""" Return repr(self). """
pass
file_list = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""A list of all apt_pkg.PackageFile objects related to this description."""
language_code = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""The language code of the description. Empty string for untranslated
descriptions."""
md5 = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""The MD5 hash of the description.""" |
/*
* Customizations to Endpoint Overview Page
*/
Ext.onReady(function() {
var DEVICE_OVERVIEW_ID = '<API key>';
Ext.ComponentMgr.onAvailable(DEVICE_OVERVIEW_ID, function(){
var box = Ext.getCmp(DEVICE_OVERVIEW_ID);
box.removeField('uptime');
box.removeField('memory');
});
var <API key> = '<API key>';
Ext.ComponentMgr.onAvailable(<API key>, function(){
var box = Ext.getCmp(<API key>);
box.removeField('rackSlot');
box.removeField('collector');
box.removeField('hwManufacturer');
box.removeField('hwModel');
box.removeField('osManufacturer');
box.removeField('osModel');
box.addField({
xtype: 'displayfield',
name: 'cfName',
fieldLabel: _t('CloudFoundry Name')
});
box.addField({
xtype: 'displayfield',
name: 'cfDescription',
fieldLabel: _t('CloudFoundry Description')
});
box.addField({
xtype: 'displayfield',
name: 'utilAppURIs',
fieldLabel: _t('App URIs')
});
box.addField({
xtype: 'displayfield',
name: 'utilApps',
fieldLabel: _t('Apps')
});
box.addField({
xtype: 'displayfield',
name: 'utilMemory',
fieldLabel: _t('Memory')
});
box.addField({
xtype: 'displayfield',
name: 'utilServices',
fieldLabel: _t('Services')
});
});
var <API key> = '<API key>';
Ext.ComponentMgr.onAvailable(<API key>, function(){
var box = Ext.getCmp(<API key>);
box.removeField('snmpSysName');
box.removeField('snmpLocation');
box.removeField('snmpContact');
box.removeField('snmpDescr');
box.removeField('snmpCommunity');
box.removeField('snmpVersion');
box.addField({
name: 'cfVersion',
fieldLabel: _t('CloudFoundry Version')
});
box.addField({
name: 'cfBuild',
fieldLabel: _t('CloudFoundry Build')
});
box.addField({
name: 'cfUser',
fieldLabel: _t('CloudFoundry User')
});
box.addField({
name: 'cfSupport',
fieldLabel: _t('CloudFoundry Support')
});
});
});
(function(){
var ZC = Ext.ns('Zenoss.component');
/*
* Friendly names for the components.
*/
ZC.registerName('CloudFoundryApp', _t('App'), _t('Apps'));
ZC.registerName('<API key>', _t('App Instance'), _t('App Instances'));
ZC.registerName('<API key>', _t('Framework'), _t('Frameworks'));
ZC.registerName('CloudFoundryRuntime', _t('Runtime'), _t('Runtimes'));
ZC.registerName('<API key>', _t('App Server'), _t('App Servers'));
ZC.registerName('<API key>', _t('System Service'), _t('System Services'));
ZC.registerName('<API key>', _t('Provisioned Service'), _t('Provisioned Services'));
/*
* Endpoint-local custom renderers.
*/
Ext.apply(Zenoss.render, {
<API key>: function(obj, col, record) {
if (!obj)
return;
if (typeof(obj) == 'string')
obj = record.data;
if (!obj.title && obj.name)
obj.title = obj.name;
var isLink = false;
if (this.refName == 'componentgrid') {
// Zenoss >= 4.2 / ExtJS4
if (this.<API key> || this.componentType != obj.meta_type)
isLink = true;
} else {
// Zenoss < 4.2 / ExtJS3
if (!this.panel || this.panel.<API key>)
isLink = true;
}
if (isLink) {
return '<a href="javascript:Ext.getCmp(\'component_card\').componentgrid.jumpToEntity(\''+obj.uid+'\', \''+obj.meta_type+'\');">'+obj.title+'</a>';
} else {
return obj.title;
}
},
deviceLinkFromGrid: function(obj) {
if (obj && obj.uid && obj.name) {
return Zenoss.render.Device(obj.uid, obj.name);
}
}
});
/*
* Generic ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.ComponentGridPanel, {
<API key>: false,
jumpToEntity: function(uid, meta_type) {
var tree = Ext.getCmp('deviceDetailNav').treepanel;
var <API key> = tree.getSelectionModel();
var components_node = tree.getRootNode().findChildBy(
function(n) {
if (n.data) {
// Zenoss >= 4.2 / ExtJS4
return n.data.text == 'Components';
}
// Zenoss < 4.2 / ExtJS3
return n.text == 'Components';
});
// Reset context of component card.
var component_card = Ext.getCmp('component_card');
if (components_node.data) {
// Zenoss >= 4.2 / ExtJS4
component_card.setContext(components_node.data.id, meta_type);
} else {
// Zenoss < 4.2 / ExtJS3
component_card.setContext(components_node.id, meta_type);
}
// Select chosen row in component grid.
component_card.selectByToken(uid);
// Select chosen component type from tree.
var component_type_node = components_node.findChildBy(
function(n) {
if (n.data) {
// Zenoss >= 4.2 / ExtJS4
return n.data.id == meta_type;
}
// Zenoss < 4.2 / ExtJS3
return n.id == meta_type;
});
if (component_type_node.select) {
<API key>.suspendEvents();
component_type_node.select();
<API key>.resumeEvents();
} else {
<API key>.select([component_type_node], false, true);
}
}
});
/*
* App ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.<API key>, {
constructor: function(config) {
config = Ext.applyIf(config||{}, {
autoExpandColumn: 'name',
componentType: 'CloudFoundryApp',
fields: [
{name: 'uid'},
{name: 'name'},
{name: 'meta_type'},
{name: 'severity'},
{name: 'cfFramework'},
{name: 'cfRuntime'},
{name: 'cfAppServer'},
{name: 'cfState'},
{name: 'instances'},
{name: 'resourcesMemory'},
{name: 'resourcesDisk'},
{name: 'monitor'},
{name: 'monitored'},
{name: 'locking'}
],
columns: [{
id: 'severity',
dataIndex: 'severity',
header: _t('Events'),
renderer: Zenoss.render.severity,
sortable: true,
width: 50
},{
id: 'name',
dataIndex: 'name',
header: _t('Name'),
renderer: Zenoss.render.<API key>,
panel: this
},{
id: 'cfFramework',
dataIndex: 'cfFramework',
header: _t('Framework'),
renderer: Zenoss.render.<API key>,
width: 70
},{
id: 'cfRuntime',
dataIndex: 'cfRuntime',
header: _t('Runtime'),
renderer: Zenoss.render.<API key>,
width: 70
},{
id: 'cfState',
dataIndex: 'cfState',
header: _t('State'),
sortable: true,
width: 70
},{
id: 'resourcesMemory',
dataIndex: 'resourcesMemory',
header: _t('Memory'),
sortable: true,
width: 60
},{
id: 'resourcesDisk',
dataIndex: 'resourcesDisk',
header: _t('Disk'),
sortable: true,
width: 60
},{
id: 'instances',
dataIndex: 'instances',
header: _t('Instances'),
width: 60
},{
id: 'monitored',
dataIndex: 'monitored',
header: _t('Monitored'),
renderer: Zenoss.render.checkbox,
sortable: true,
width: 65
},{
id: 'locking',
dataIndex: 'locking',
header: _t('Locking'),
renderer: Zenoss.render.locking_icons,
width: 65
}]
});
ZC.<API key>.superclass.constructor.call(this, config);
}
});
Ext.reg('<API key>', ZC.<API key>);
/*
* AppInstance ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.<API key>, {
constructor: function(config) {
config = Ext.applyIf(config||{}, {
autoExpandColumn: 'cfApp',
componentType: '<API key>',
fields: [
{name: 'uid'},
{name: 'name'},
{name: 'meta_type'},
{name: 'severity'},
{name: 'cfApp'},
{name: 'cfState'},
{name: 'utilCPU'},
{name: 'utilMemory'},
{name: 'utilDisk'},
{name: 'cfHost'},
{name: 'cfPort'},
{name: 'monitor'},
{name: 'monitored'},
{name: 'locking'}
],
columns: [{
id: 'severity',
dataIndex: 'severity',
header: _t('Events'),
renderer: Zenoss.render.severity,
sortable: true,
width: 50
},{
id: 'cfApp',
dataIndex: 'cfApp',
header: _t('App'),
renderer: Zenoss.render.<API key>
},{
id: 'name',
dataIndex: 'name',
header: _t('Index'),
renderer: Zenoss.render.<API key>,
panel: this,
width: 45
},{
id: 'cfState',
dataIndex: 'cfState',
header: _t('State'),
sortable: true,
width: 80
},{
id: 'utilCPU',
dataIndex: 'utilCPU',
header: _t('CPU'),
width: 70
},{
id: 'utilMemory',
dataIndex: 'utilMemory',
header: _t('Memory'),
width: 145
},{
id: 'utilDisk',
dataIndex: 'utilDisk',
header: _t('Disk'),
width: 145
},{
id: 'cfHost',
dataIndex: 'cfHost',
header: _t('Host'),
sortable: true,
width: 75
},{
id: 'cfPort',
dataIndex: 'cfPort',
header: _t('Port'),
sortable: true,
width: 50
},{
id: 'monitored',
dataIndex: 'monitored',
header: _t('Monitored'),
renderer: Zenoss.render.checkbox,
sortable: true,
width: 65
},{
id: 'locking',
dataIndex: 'locking',
header: _t('Locking'),
renderer: Zenoss.render.locking_icons,
width: 65
}]
});
ZC.<API key>.superclass.constructor.call(this, config);
}
});
Ext.reg('<API key>', ZC.<API key>);
/*
* Framework ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.<API key>, {
constructor: function(config) {
config = Ext.applyIf(config||{}, {
autoExpandColumn: 'cfDetection',
componentType: '<API key>',
fields: [
{name: 'uid'},
{name: 'name'},
{name: 'meta_type'},
{name: 'cfDetection'},
{name: 'cfRuntimeCount'},
{name: 'cfAppServerCount'},
{name: 'cfAppCount'},
{name: 'locking'}
],
columns: [{
id: 'name',
dataIndex: 'name',
header: _t('Name'),
renderer: Zenoss.render.<API key>,
panel: this,
width: 100
},{
id: 'cfDetection',
dataIndex: 'cfDetection',
header: _t('Detection'),
sortable: true
},{
id: 'cfRuntimeCount',
dataIndex: 'cfRuntimeCount',
header: _t('# Runtimes'),
sortable: true,
width: 70
},{
id: 'cfAppServerCount',
dataIndex: 'cfAppServerCount',
header: _t('# App Servers'),
sortable: true,
width: 80
},{
id: 'cfAppCount',
dataIndex: 'cfAppCount',
header: _t('# Apps'),
sortable: true,
width: 50
},{
id: 'locking',
dataIndex: 'locking',
header: _t('Locking'),
renderer: Zenoss.render.locking_icons,
width: 65
}]
});
ZC.<API key>.superclass.constructor.call(this, config);
}
});
Ext.reg('<API key>', ZC.<API key>);
/*
* Runtime ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.<API key>, {
constructor: function(config) {
config = Ext.applyIf(config||{}, {
autoExpandColumn: 'name',
componentType: 'CloudFoundryRuntime',
fields: [
{name: 'uid'},
{name: 'name'},
{name: 'meta_type'},
{name: 'cfFramework'},
{name: 'cfDescription'},
{name: 'cfVersion'},
{name: 'cfAppCount'},
{name: 'locking'}
],
columns: [{
id: 'cfFramework',
dataIndex: 'cfFramework',
header: _t('Framework'),
renderer: Zenoss.render.<API key>
},{
id: 'name',
dataIndex: 'name',
header: _t('Name'),
renderer: Zenoss.render.<API key>,
panel: this
},{
id: 'cfDescription',
dataIndex: 'cfDescription',
header: _t('Description'),
sortable: true
},{
id: 'cfVersion',
dataIndex: 'cfVersion',
header: _t('Version'),
sortable: true
},{
id: 'cfAppCount',
dataIndex: 'cfAppCount',
header: _t('# Apps'),
sortable: true,
width: 50
},{
id: 'locking',
dataIndex: 'locking',
header: _t('Locking'),
renderer: Zenoss.render.locking_icons,
width: 65
}]
});
ZC.<API key>.superclass.constructor.call(this, config);
}
});
Ext.reg('<API key>', ZC.<API key>);
/*
* AppServer ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.<API key>, {
constructor: function(config) {
config = Ext.applyIf(config||{}, {
autoExpandColumn: 'name',
componentType: '<API key>',
fields: [
{name: 'uid'},
{name: 'name'},
{name: 'meta_type'},
{name: 'cfFramework'},
{name: 'cfDescription'},
{name: 'locking'}
],
columns: [{
id: 'cfFramework',
dataIndex: 'cfFramework',
header: _t('Framework'),
renderer: Zenoss.render.<API key>
},{
id: 'name',
dataIndex: 'name',
header: _t('Name'),
renderer: Zenoss.render.<API key>,
panel: this
},{
id: 'cfDescription',
dataIndex: 'cfDescription',
header: _t('Description'),
sortable: true
},{
id: 'locking',
dataIndex: 'locking',
header: _t('Locking'),
renderer: Zenoss.render.locking_icons,
width: 65
}]
});
ZC.<API key>.superclass.constructor.call(this, config);
}
});
Ext.reg('<API key>', ZC.<API key>);
/*
* SystemService ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.<API key>, {
constructor: function(config) {
config = Ext.applyIf(config||{}, {
autoExpandColumn: 'cfDescription',
componentType: '<API key>',
fields: [
{name: 'uid'},
{name: 'name'},
{name: 'meta_type'},
{name: 'cfId'},
{name: 'cfDescription'},
{name: 'cfVersion'},
{name: 'cfVendor'},
{name: 'cfType'},
{name: 'cfTiers'},
{name: 'cfProvisionedCount'},
{name: 'locking'}
],
columns: [{
id: 'cfId',
dataIndex: 'cfId',
header: _t('ID'),
sortable: true,
width: 30
},{
id: 'name',
dataIndex: 'name',
header: _t('Name'),
renderer: Zenoss.render.<API key>,
panel: this,
width: 100
},{
id: 'cfDescription',
dataIndex: 'cfDescription',
header: _t('Description'),
sortable: true
},{
id: 'cfVersion',
dataIndex: 'cfVersion',
header: _t('Version'),
sortable: true,
width: 50
},{
id: 'cfVendor',
dataIndex: 'cfVendor',
header: _t('Vendor'),
sortable: true,
width: 70
},{
id: 'cfType',
dataIndex: 'cfType',
header: _t('Type'),
sortable: true,
width: 70
},{
id: 'cfTiers',
dataIndex: 'cfTiers',
header: _t('Tiers'),
sortable: true,
width: 70
},{
id: 'cfProvisionedCount',
dataIndex: 'cfProvisionedCount',
header: _t('# Provisioned'),
sortable: true,
width: 80
},{
id: 'locking',
dataIndex: 'locking',
header: _t('Locking'),
renderer: Zenoss.render.locking_icons,
width: 65
}]
});
ZC.<API key>.superclass.constructor.call(this, config);
}
});
Ext.reg('<API key>', ZC.<API key>);
/*
* ProvisionedService ComponentGridPanel
*/
ZC.<API key> = Ext.extend(ZC.<API key>, {
constructor: function(config) {
config = Ext.applyIf(config||{}, {
autoExpandColumn: 'name',
componentType: '<API key>',
fields: [
{name: 'uid'},
{name: 'name'},
{name: 'meta_type'},
{name: 'cfSystemService'},
{name: 'cfVersion'},
{name: 'cfVendor'},
{name: 'cfType'},
{name: 'cfTier'},
{name: 'locking'}
],
columns: [{
id: 'cfSystemService',
dataIndex: 'cfSystemService',
header: _t('System Service'),
renderer: Zenoss.render.<API key>,
width: 95
},{
id: 'name',
dataIndex: 'name',
header: _t('Name'),
renderer: Zenoss.render.<API key>,
panel: this
},{
id: 'cfVersion',
dataIndex: 'cfVersion',
header: _t('Version'),
sortable: true,
width: 50
},{
id: 'cfVendor',
dataIndex: 'cfVendor',
header: _t('Vendor'),
sortable: true,
width: 70
},{
id: 'cfType',
dataIndex: 'cfType',
header: _t('Type'),
sortable: true,
width: 70
},{
id: 'cfTier',
dataIndex: 'cfTier',
header: _t('Tier'),
sortable: true,
width: 70
},{
id: 'locking',
dataIndex: 'locking',
header: _t('Locking'),
renderer: Zenoss.render.locking_icons,
width: 65
}]
});
ZC.<API key>.superclass.constructor.call(this, config);
}
});
Ext.reg('<API key>', ZC.<API key>);
/*
* Custom Component Views
*/
Zenoss.nav.appendTo('Component', [{
id: '<API key>',
text: _t('Runtimes'),
xtype: '<API key>',
<API key>: true,
filterNav: function(navpanel) {
if (navpanel.refOwner.componentType == '<API key>') {
return true;
} else {
return false;
}
},
setContext: function(uid) {
ZC.<API key>.superclass.setContext.apply(this, [uid]);
}
}]);
Zenoss.nav.appendTo('Component', [{
id: '<API key>',
text: _t('App Servers'),
xtype: '<API key>',
<API key>: true,
filterNav: function(navpanel) {
if (navpanel.refOwner.componentType == '<API key>') {
return true;
} else {
return false;
}
},
setContext: function(uid) {
ZC.<API key>.superclass.setContext.apply(this, [uid]);
}
}]);
Zenoss.nav.appendTo('Component', [{
id: '<API key>',
text: _t('Instances'),
xtype: '<API key>',
<API key>: true,
filterNav: function(navpanel) {
if (navpanel.refOwner.componentType == 'CloudFoundryApp') {
return true;
} else {
return false;
}
},
setContext: function(uid) {
ZC.<API key>.superclass.setContext.apply(this, [uid]);
}
}]);
})(); |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Invenio is free software; you can redistribute it and/or
## published by the Free Software Foundation; either version 2 of the
## Invenio is distributed in the hope that it will be useful, but
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
"""Group bundles."""
from invenio.ext.assets import Bundle, RequireJSFilter
from invenio.base.bundles import jquery as _j, invenio as _i
js = Bundle(
'js/groups/init.js',
filters=RequireJSFilter(exclude=[_j, _i]),
output="groups.js",
weight=50
) |
#include <linux/io.h>
#include <linux/atomic.h>
#include <media/v4l2-subdev.h>
#include <media/msmb_isp.h>
#include "msm_isp_util.h"
#include "msm_isp_axi_util.h"
#include "msm_isp_stats_util.h"
static inline void <API key>(struct vfe_device *vfe_dev,
struct <API key> *stream_info,
uint32_t pingpong_status)
{
vfe_dev->hw_info->vfe_ops.stats_ops.<API key>(
vfe_dev->vfe_base, stream_info,
pingpong_status, vfe_dev->buf_mgr->scratch_buf_addr);
}
static inline void <API key>(struct vfe_device *vfe_dev,
struct <API key> *stream_info,
uint32_t pingpong_status)
{
uint32_t stats_idx = STATS_IDX(stream_info->stream_handle);
uint32_t pingpong_bit;
uint32_t <API key> =
vfe_dev->hw_info->stats_hw_info-><API key>[
stats_idx];
pingpong_bit = (~(pingpong_status >> <API key>) & 0x1);
<API key>(vfe_dev, stream_info,
pingpong_status);
stream_info->buf[pingpong_bit] = NULL;
}
static int <API key>(struct vfe_device *vfe_dev,
struct <API key> *stream_info, uint32_t pingpong_status)
{
int rc = -1, vfe_id = 0;
struct msm_isp_buffer *buf;
uint32_t pingpong_bit = 0;
uint32_t <API key>;
uint32_t bufq_handle = stream_info->bufq_handle;
uint32_t stats_idx = STATS_IDX(stream_info->stream_handle);
struct dual_vfe_resource *dual_vfe_res = NULL;
struct <API key> *<API key> = NULL;
if (stats_idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type ||
stats_idx >= MSM_ISP_STATS_MAX) {
pr_err("%s Invalid stats index %d", __func__, stats_idx);
return -EINVAL;
}
<API key> =
vfe_dev->hw_info->stats_hw_info-><API key>[
stats_idx];
pingpong_bit = (~(pingpong_status >> <API key>) & 0x1);
rc = vfe_dev->buf_mgr->ops->get_buf(vfe_dev->buf_mgr,
vfe_dev->pdev->id, bufq_handle, &buf);
if (rc == -EFAULT) {
<API key>(vfe_dev, <API key>);
return rc;
}
if (rc < 0 || NULL == buf)
vfe_dev->error_info.<API key>[stats_idx]++;
if (buf && buf->num_planes != 1) {
pr_err("%s: Invalid buffer\n", __func__);
<API key>(vfe_dev, <API key>);
rc = -EINVAL;
goto buf_error;
}
if (vfe_dev->is_split) {
dual_vfe_res = vfe_dev->common_data->dual_vfe_res;
if (!dual_vfe_res->vfe_base[ISP_VFE0] ||
!dual_vfe_res->stats_data[ISP_VFE0] ||
!dual_vfe_res->vfe_base[ISP_VFE1] ||
!dual_vfe_res->stats_data[ISP_VFE1]) {
pr_err("%s:%d error vfe0 %pK %pK vfe1 %pK %pK\n",
__func__, __LINE__,
dual_vfe_res->vfe_base[ISP_VFE0],
dual_vfe_res->stats_data[ISP_VFE0],
dual_vfe_res->vfe_base[ISP_VFE1],
dual_vfe_res->stats_data[ISP_VFE1]);
} else {
for (vfe_id = 0; vfe_id < MAX_VFE; vfe_id++) {
<API key> = &dual_vfe_res->
stats_data[vfe_id]->
stream_info[stats_idx];
if (buf)
vfe_dev->hw_info->vfe_ops.stats_ops.
<API key>(
dual_vfe_res->vfe_base[vfe_id],
<API key>,
pingpong_status,
buf->mapped_info[0].paddr +
<API key>->
buffer_offset);
else
<API key>(
vfe_dev,
<API key>,
pingpong_status);
<API key>->buf[pingpong_bit]
= buf;
}
}
} else if (!vfe_dev->is_split) {
if (buf)
vfe_dev->hw_info->vfe_ops.stats_ops.
<API key>(
vfe_dev->vfe_base, stream_info,
pingpong_status, buf->mapped_info[0].paddr +
stream_info->buffer_offset);
else
<API key>(vfe_dev,
stream_info, pingpong_status);
stream_info->buf[pingpong_bit] = buf;
}
if (buf)
buf->pingpong_bit = pingpong_bit;
return 0;
buf_error:
vfe_dev->buf_mgr->ops->put_buf(vfe_dev->buf_mgr,
buf->bufq_handle, buf->buf_idx);
return rc;
}
static int32_t <API key>(struct vfe_device *vfe_dev,
struct msm_isp_timestamp *ts,
struct msm_isp_event_data *buf_event,
struct <API key> *stream_info,
uint32_t *<API key>, uint32_t pingpong_status)
{
int32_t rc = 0, frame_id = 0, drop_buffer = 0;
struct msm_isp_stats_event *stats_event = NULL;
struct msm_isp_sw_framskip *sw_skip = NULL;
int32_t buf_index = -1;
uint32_t pingpong_bit;
struct msm_isp_buffer *done_buf;
uint32_t <API key>;
uint32_t stats_idx;
if (!vfe_dev || !ts || !buf_event || !stream_info) {
pr_err("%s:%d failed: invalid params %pK %pK %pK %pK\n",
__func__, __LINE__, vfe_dev, ts, buf_event,
stream_info);
return -EINVAL;
}
frame_id = vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id;
sw_skip = &stream_info->sw_skip;
stats_event = &buf_event->u.stats;
if (sw_skip->stats_type_mask &
(1 << stream_info->stats_type)) {
/* Hw stream output of this src is requested
for drop */
if (sw_skip->skip_mode == SKIP_ALL) {
/* drop all buffers */
drop_buffer = 1;
} else if (sw_skip->skip_mode == SKIP_RANGE &&
(sw_skip->min_frame_id <= frame_id &&
sw_skip->max_frame_id >= frame_id)) {
drop_buffer = 1;
} else if (frame_id > sw_skip->max_frame_id) {
memset(sw_skip, 0, sizeof
(struct msm_isp_sw_framskip));
}
}
stats_idx = STATS_IDX(stream_info->stream_handle);
<API key> =
vfe_dev->hw_info->stats_hw_info-><API key>[
stats_idx];
pingpong_bit = (~(pingpong_status >> <API key>) & 0x1);
done_buf = stream_info->buf[pingpong_bit];
if (done_buf)
buf_index = done_buf->buf_idx;
rc = vfe_dev->buf_mgr->ops->update_put_buf_cnt(
vfe_dev->buf_mgr, vfe_dev->pdev->id, stream_info->bufq_handle,
buf_index, &ts->buf_time,
frame_id, pingpong_bit);
if (rc < 0) {
if (rc == -EFAULT)
<API key>(vfe_dev,
<API key>);
pr_err("stats_buf_divert: update put buf cnt fail\n");
return rc;
}
if (rc > 0) {
ISP_DBG("%s: vfe_id %d buf_id %d bufq %x put_cnt 1\n", __func__,
vfe_dev->pdev->id, buf_index,
stream_info->bufq_handle);
return rc;
}
/* Program next buffer */
rc = <API key>(vfe_dev, stream_info,
pingpong_status);
if (rc)
return rc;
if (drop_buffer && done_buf) {
rc = vfe_dev->buf_mgr->ops->buf_done(
vfe_dev->buf_mgr,
done_buf->bufq_handle,
done_buf->buf_idx, &ts->buf_time, frame_id, 0);
if (rc == -EFAULT)
<API key>(vfe_dev,
<API key>);
return rc;
}
if (done_buf) {
stats_event->stats_buf_idxs
[stream_info->stats_type] =
done_buf->buf_idx;
if (NULL == <API key>) {
stats_event->stats_mask =
1 << stream_info->stats_type;
ISP_DBG("%s: stats frameid: 0x%x %d bufq %x\n",
__func__, buf_event->frame_id,
stream_info->stats_type, done_buf->bufq_handle);
msm_isp_send_event(vfe_dev,
<API key> +
stream_info->stats_type,
buf_event);
} else {
*<API key> |=
1 << stream_info->stats_type;
}
}
return rc;
}
static int32_t <API key>(struct vfe_device *vfe_dev,
uint32_t stats_irq_mask, struct msm_isp_timestamp *ts,
bool is_composite)
{
int i, rc = 0;
struct msm_isp_event_data buf_event;
struct msm_isp_stats_event *stats_event = &buf_event.u.stats;
struct <API key> *stream_info = NULL;
uint32_t pingpong_status;
uint32_t <API key> = 0;
int result = 0;
memset(&buf_event, 0, sizeof(struct msm_isp_event_data));
buf_event.timestamp = ts->buf_time;
buf_event.frame_id = vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id;
pingpong_status = vfe_dev->hw_info->
vfe_ops.stats_ops.get_pingpong_status(vfe_dev);
for (i = 0; i < vfe_dev->hw_info->stats_hw_info->num_stats_type; i++) {
if (!(stats_irq_mask & (1 << i)))
continue;
stream_info = &vfe_dev->stats_data.stream_info[i];
if (stream_info->state == STATS_INACTIVE) {
pr_debug("%s: Warning! Stream already inactive. Drop irq handling\n",
__func__);
continue;
}
rc = <API key>(vfe_dev, ts,
&buf_event, stream_info,
is_composite ? &<API key> : NULL,
pingpong_status);
if (rc < 0) {
pr_err("%s:%d failed: stats buf divert rc %d\n",
__func__, __LINE__, rc);
if (0 == result)
result = rc;
}
}
if (is_composite && <API key>) {
ISP_DBG("%s:vfe_id %d comp_stats frameid %x,comp_mask %x\n",
__func__, vfe_dev->pdev->id, buf_event.frame_id,
<API key>);
stats_event->stats_mask = <API key>;
msm_isp_send_event(vfe_dev,
<API key>, &buf_event);
<API key> = 0;
}
return result;
}
void <API key>(struct vfe_device *vfe_dev,
uint32_t irq_status0, uint32_t irq_status1,
struct msm_isp_timestamp *ts)
{
int j, rc;
uint32_t atomic_stats_mask = 0;
uint32_t stats_comp_mask = 0, stats_irq_mask = 0;
bool comp_flag = false;
uint32_t num_stats_comp_mask =
vfe_dev->hw_info->stats_hw_info->num_stats_comp_mask;
stats_comp_mask = vfe_dev->hw_info->vfe_ops.stats_ops.
get_comp_mask(irq_status0, irq_status1);
stats_irq_mask = vfe_dev->hw_info->vfe_ops.stats_ops.
get_wm_mask(irq_status0, irq_status1);
if (!(stats_comp_mask || stats_irq_mask))
return;
ISP_DBG("%s: vfe %d status: 0x%x\n", __func__, vfe_dev->pdev->id,
irq_status0);
/* Clear composite mask irq bits, they will be restored by comp mask */
for (j = 0; j < num_stats_comp_mask; j++) {
stats_irq_mask &= ~atomic_read(
&vfe_dev->stats_data.stats_comp_mask[j]);
}
/* Process non-composite irq */
if (stats_irq_mask) {
rc = <API key>(vfe_dev, stats_irq_mask, ts,
comp_flag);
}
/* Process composite irq */
if (stats_comp_mask) {
for (j = 0; j < num_stats_comp_mask; j++) {
if (!(stats_comp_mask & (1 << j)))
continue;
atomic_stats_mask = atomic_read(
&vfe_dev->stats_data.stats_comp_mask[j]);
rc = <API key>(vfe_dev, atomic_stats_mask,
ts, !comp_flag);
}
}
}
int <API key>(struct vfe_device *vfe_dev,
struct <API key> *stream_req_cmd)
{
int rc = -1;
struct <API key> *stream_info = NULL;
struct <API key> *stats_data = &vfe_dev->stats_data;
uint32_t stats_idx;
if (!(vfe_dev->hw_info->stats_hw_info-><API key> &
(1 << stream_req_cmd->stats_type))) {
pr_err("%s: Stats type not supported\n", __func__);
return rc;
}
stats_idx = vfe_dev->hw_info->vfe_ops.stats_ops.
get_stats_idx(stream_req_cmd->stats_type);
if (stats_idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s Invalid stats index %d", __func__, stats_idx);
return -EINVAL;
}
stream_info = &stats_data->stream_info[stats_idx];
if (stream_info->state != STATS_AVALIABLE) {
pr_err("%s: Stats already requested\n", __func__);
return rc;
}
if (stream_req_cmd->framedrop_pattern >= MAX_SKIP) {
pr_err("%s: Invalid framedrop pattern\n", __func__);
return rc;
}
if (stream_req_cmd-><API key> >= MAX_SKIP) {
pr_err("%s: Invalid irq subsample pattern\n", __func__);
return rc;
}
stream_info->session_id = stream_req_cmd->session_id;
stream_info->stream_id = stream_req_cmd->stream_id;
stream_info->composite_flag = stream_req_cmd->composite_flag;
stream_info->stats_type = stream_req_cmd->stats_type;
stream_info->buffer_offset = stream_req_cmd->buffer_offset;
stream_info->framedrop_pattern = stream_req_cmd->framedrop_pattern;
stream_info-><API key> = stream_req_cmd->init_frame_drop;
stream_info-><API key> =
stream_req_cmd-><API key>;
stream_info->state = STATS_INACTIVE;
if ((vfe_dev->stats_data.stream_handle_cnt << 8) == 0)
vfe_dev->stats_data.stream_handle_cnt++;
stream_req_cmd->stream_handle =
(++vfe_dev->stats_data.stream_handle_cnt) << 8 | stats_idx;
stream_info->stream_handle = stream_req_cmd->stream_handle;
return 0;
}
int <API key>(struct vfe_device *vfe_dev, void *arg)
{
int rc = -1;
struct <API key> *stream_req_cmd = arg;
struct <API key> *stream_info = NULL;
struct <API key> *stats_data = &vfe_dev->stats_data;
uint32_t framedrop_period;
uint32_t stats_idx;
rc = <API key>(vfe_dev, stream_req_cmd);
if (rc < 0) {
pr_err("%s: create stream failed\n", __func__);
return rc;
}
stats_idx = STATS_IDX(stream_req_cmd->stream_handle);
if (stats_idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s Invalid stats index %d", __func__, stats_idx);
return -EINVAL;
}
stream_info = &stats_data->stream_info[stats_idx];
framedrop_period = <API key>(
stream_req_cmd->framedrop_pattern);
if (stream_req_cmd->framedrop_pattern == SKIP_ALL)
stream_info->framedrop_pattern = 0x0;
else
stream_info->framedrop_pattern = 0x1;
stream_info->framedrop_period = framedrop_period - 1;
if (!stream_info->composite_flag)
vfe_dev->hw_info->vfe_ops.stats_ops.
cfg_wm_irq_mask(vfe_dev, stream_info);
if (stream_info-><API key> == 0)
vfe_dev->hw_info->vfe_ops.stats_ops.cfg_wm_reg(vfe_dev,
stream_info);
<API key>(vfe_dev, stream_info,
VFE_PING_FLAG);
<API key>(vfe_dev, stream_info,
VFE_PONG_FLAG);
return rc;
}
int <API key>(struct vfe_device *vfe_dev, void *arg)
{
int rc = -1;
struct <API key> stream_cfg_cmd;
struct <API key> *stream_release_cmd = arg;
struct <API key> *stats_data = &vfe_dev->stats_data;
int stats_idx = STATS_IDX(stream_release_cmd->stream_handle);
struct <API key> *stream_info = NULL;
if (stats_idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s Invalid stats index %d", __func__, stats_idx);
return -EINVAL;
}
stream_info = &stats_data->stream_info[stats_idx];
if (stream_info->state == STATS_AVALIABLE) {
pr_err("%s: stream already release\n", __func__);
return rc;
} else if (stream_info->state != STATS_INACTIVE) {
stream_cfg_cmd.enable = 0;
stream_cfg_cmd.num_streams = 1;
stream_cfg_cmd.stream_handle[0] =
stream_release_cmd->stream_handle;
rc = <API key>(vfe_dev, &stream_cfg_cmd);
}
if (!stream_info->composite_flag)
vfe_dev->hw_info->vfe_ops.stats_ops.
clear_wm_irq_mask(vfe_dev, stream_info);
vfe_dev->hw_info->vfe_ops.stats_ops.clear_wm_reg(vfe_dev, stream_info);
memset(stream_info, 0, sizeof(struct <API key>));
return 0;
}
static int <API key>(
struct vfe_device *vfe_dev,
struct <API key> *stream_info)
{
int rc = 0;
stream_info->bufq_handle =
vfe_dev->buf_mgr->ops->get_bufq_handle(
vfe_dev->buf_mgr, stream_info->session_id,
stream_info->stream_id);
if (stream_info->bufq_handle == 0) {
pr_err("%s: no buf configured for stream: 0x%x\n",
__func__, stream_info->stream_handle);
return -EINVAL;
}
if ((vfe_dev->is_split && vfe_dev->pdev->id == 1) ||
!vfe_dev->is_split) {
rc = <API key>(vfe_dev,
stream_info, VFE_PING_FLAG);
if (rc < 0) {
pr_err("%s: No free buffer for ping\n", __func__);
return rc;
}
rc = <API key>(vfe_dev,
stream_info, VFE_PONG_FLAG);
if (rc < 0) {
pr_err("%s: No free buffer for pong\n", __func__);
return rc;
}
}
return rc;
}
void <API key>(struct vfe_device *vfe_dev)
{
int i;
struct <API key> *stats_data = &vfe_dev->stats_data;
struct <API key> *stream_info = NULL;
for (i = 0; i < vfe_dev->hw_info->stats_hw_info->num_stats_type; i++) {
stream_info = &stats_data->stream_info[i];
if (stream_info->state != STATS_ACTIVE)
continue;
if (stream_info-><API key>) {
stream_info-><API key>
if (stream_info-><API key> == 0) {
vfe_dev->hw_info->vfe_ops.stats_ops.cfg_wm_reg(
vfe_dev, stream_info);
}
}
}
}
void <API key>(struct vfe_device *vfe_dev)
{
int i;
uint32_t enable = 0;
uint8_t comp_flag = 0;
struct <API key> *stats_data = &vfe_dev->stats_data;
struct msm_vfe_stats_ops *stats_ops =
&vfe_dev->hw_info->vfe_ops.stats_ops;
for (i = 0; i < vfe_dev->hw_info->stats_hw_info->num_stats_type; i++) {
if (stats_data->stream_info[i].state == STATS_START_PENDING ||
stats_data->stream_info[i].state ==
STATS_STOP_PENDING) {
enable = stats_data->stream_info[i].state ==
STATS_START_PENDING ? 1 : 0;
stats_data->stream_info[i].state =
stats_data->stream_info[i].state ==
STATS_START_PENDING ?
STATS_STARTING : STATS_STOPPING;
vfe_dev->hw_info->vfe_ops.stats_ops.enable_module(
vfe_dev, BIT(i), enable);
comp_flag = stats_data->stream_info[i].composite_flag;
if (comp_flag)
stats_ops->cfg_comp_mask(vfe_dev, BIT(i),
(comp_flag - 1), enable);
} else if (stats_data->stream_info[i].state == STATS_STARTING ||
stats_data->stream_info[i].state == STATS_STOPPING) {
stats_data->stream_info[i].state =
stats_data->stream_info[i].state ==
STATS_STARTING ? STATS_ACTIVE : STATS_INACTIVE;
}
}
atomic_sub(1, &stats_data->stats_update);
if (!atomic_read(&stats_data->stats_update))
complete(&vfe_dev-><API key>);
}
static int <API key>(struct vfe_device *vfe_dev)
{
int rc;
init_completion(&vfe_dev-><API key>);
atomic_set(&vfe_dev->stats_data.stats_update, 2);
rc = <API key>(
&vfe_dev-><API key>,
msecs_to_jiffies(VFE_MAX_CFG_TIMEOUT));
if (rc == 0) {
pr_err("%s: wait timeout\n", __func__);
rc = -1;
} else {
rc = 0;
}
return rc;
}
static int <API key>(struct vfe_device *vfe_dev,
struct <API key> *stream_cfg_cmd)
{
int i;
uint32_t stats_mask = 0, idx;
for (i = 0; i < stream_cfg_cmd->num_streams; i++) {
idx = STATS_IDX(stream_cfg_cmd->stream_handle[i]);
if (idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s Invalid stats index %d", __func__, idx);
return -EINVAL;
}
stats_mask |= 1 << idx;
}
if (vfe_dev->hw_info->vfe_ops.stats_ops.update_cgc_override) {
vfe_dev->hw_info->vfe_ops.stats_ops.update_cgc_override(
vfe_dev, stats_mask, stream_cfg_cmd->enable);
}
return 0;
}
int msm_isp_stats_reset(struct vfe_device *vfe_dev)
{
int i = 0, rc = 0;
struct <API key> *stream_info = NULL;
struct <API key> *stats_data = &vfe_dev->stats_data;
struct msm_isp_timestamp timestamp;
<API key>(×tamp);
for (i = 0; i < MSM_ISP_STATS_MAX; i++) {
stream_info = &stats_data->stream_info[i];
if (stream_info->state != STATS_ACTIVE)
continue;
rc = vfe_dev->buf_mgr->ops->flush_buf(vfe_dev->buf_mgr,
vfe_dev->pdev->id, stream_info->bufq_handle,
<API key>, ×tamp.buf_time,
vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id);
if (rc == -EFAULT) {
<API key>(vfe_dev,
<API key>);
return rc;
}
}
return rc;
}
int <API key>(struct vfe_device *vfe_dev)
{
int i = 0;
struct <API key> *stream_info = NULL;
struct <API key> *stats_data = &vfe_dev->stats_data;
for (i = 0; i < MSM_ISP_STATS_MAX; i++) {
stream_info = &stats_data->stream_info[i];
if (stream_info->state < STATS_ACTIVE)
continue;
<API key>(vfe_dev, stream_info);
}
return 0;
}
static int <API key>(struct vfe_device *vfe_dev,
struct <API key> *stream_cfg_cmd)
{
int i, rc = 0;
uint32_t stats_mask = 0, idx;
uint32_t comp_stats_mask[<API key>] = {0};
uint32_t num_stats_comp_mask = 0;
struct <API key> *stream_info;
struct <API key> *stats_data = &vfe_dev->stats_data;
num_stats_comp_mask =
vfe_dev->hw_info->stats_hw_info->num_stats_comp_mask;
rc = vfe_dev->hw_info->vfe_ops.stats_ops.check_streams(
stats_data->stream_info);
if (rc < 0)
return rc;
for (i = 0; i < stream_cfg_cmd->num_streams; i++) {
idx = STATS_IDX(stream_cfg_cmd->stream_handle[i]);
if (idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s Invalid stats index %d", __func__, idx);
return -EINVAL;
}
stream_info = &stats_data->stream_info[idx];
if (stream_info->stream_handle !=
stream_cfg_cmd->stream_handle[i]) {
pr_err("%s: Invalid stream handle: 0x%x received\n",
__func__, stream_cfg_cmd->stream_handle[i]);
continue;
}
if (stream_info->composite_flag > num_stats_comp_mask) {
pr_err("%s: comp grp %d exceed max %d\n",
__func__, stream_info->composite_flag,
num_stats_comp_mask);
return -EINVAL;
}
rc = <API key>(vfe_dev, stream_info);
if (rc < 0) {
pr_err("%s: No buffer for stream%d\n", __func__, idx);
return rc;
}
if (vfe_dev->axi_data.src_info[VFE_PIX_0].active)
stream_info->state = STATS_START_PENDING;
else
stream_info->state = STATS_ACTIVE;
stats_data->num_active_stream++;
stats_mask |= 1 << idx;
if (stream_info->composite_flag > 0)
comp_stats_mask[stream_info->composite_flag-1] |=
1 << idx;
ISP_DBG("%s: stats_mask %x %x active streams %d\n",
__func__, comp_stats_mask[0],
comp_stats_mask[1],
stats_data->num_active_stream);
}
if (vfe_dev->axi_data.src_info[VFE_PIX_0].active) {
rc = <API key>(vfe_dev);
} else {
vfe_dev->hw_info->vfe_ops.stats_ops.enable_module(
vfe_dev, stats_mask, stream_cfg_cmd->enable);
for (i = 0; i < num_stats_comp_mask; i++) {
vfe_dev->hw_info->vfe_ops.stats_ops.cfg_comp_mask(
vfe_dev, comp_stats_mask[i], i, 1);
}
}
return rc;
}
static int <API key>(struct vfe_device *vfe_dev,
struct <API key> *stream_cfg_cmd)
{
int i, rc = 0;
uint32_t stats_mask = 0, idx;
uint32_t comp_stats_mask[<API key>] = {0};
uint32_t num_stats_comp_mask = 0;
struct <API key> *stream_info;
struct <API key> *stats_data = &vfe_dev->stats_data;
struct msm_isp_timestamp timestamp;
<API key>(×tamp);
num_stats_comp_mask =
vfe_dev->hw_info->stats_hw_info->num_stats_comp_mask;
for (i = 0; i < stream_cfg_cmd->num_streams; i++) {
idx = STATS_IDX(stream_cfg_cmd->stream_handle[i]);
if (idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s Invalid stats index %d", __func__, idx);
return -EINVAL;
}
stream_info = &stats_data->stream_info[idx];
if (stream_info->stream_handle !=
stream_cfg_cmd->stream_handle[i]) {
pr_err("%s: Invalid stream handle: 0x%x received\n",
__func__, stream_cfg_cmd->stream_handle[i]);
continue;
}
if (stream_info->composite_flag > num_stats_comp_mask) {
pr_err("%s: comp grp %d exceed max %d\n",
__func__, stream_info->composite_flag,
num_stats_comp_mask);
return -EINVAL;
}
if (vfe_dev->axi_data.src_info[VFE_PIX_0].active)
stream_info->state = STATS_STOP_PENDING;
else
stream_info->state = STATS_INACTIVE;
stats_data->num_active_stream
stats_mask |= 1 << idx;
if (stream_info->composite_flag > 0)
comp_stats_mask[stream_info->composite_flag-1] |=
1 << idx;
<API key>(vfe_dev, stream_info,
VFE_PING_FLAG);
<API key>(vfe_dev, stream_info,
VFE_PONG_FLAG);
ISP_DBG("%s: stats_mask %x %x active streams %d\n",
__func__, comp_stats_mask[0],
comp_stats_mask[1],
stats_data->num_active_stream);
}
if (vfe_dev->axi_data.src_info[VFE_PIX_0].active) {
rc = <API key>(vfe_dev);
} else {
vfe_dev->hw_info->vfe_ops.stats_ops.enable_module(
vfe_dev, stats_mask, stream_cfg_cmd->enable);
for (i = 0; i < num_stats_comp_mask; i++) {
vfe_dev->hw_info->vfe_ops.stats_ops.cfg_comp_mask(
vfe_dev, comp_stats_mask[i], i, 0);
}
}
for (i = 0; i < stream_cfg_cmd->num_streams; i++) {
idx = STATS_IDX(stream_cfg_cmd->stream_handle[i]);
if (idx >= vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s Invalid stats index %d", __func__, idx);
return -EINVAL;
}
stream_info = &stats_data->stream_info[idx];
rc = vfe_dev->buf_mgr->ops->flush_buf(vfe_dev->buf_mgr,
vfe_dev->pdev->id, stream_info->bufq_handle,
<API key>, ×tamp.buf_time,
vfe_dev->axi_data.src_info[VFE_PIX_0].frame_id);
if (rc == -EFAULT) {
<API key>(vfe_dev,
<API key>);
return rc;
}
}
return rc;
}
int <API key>(struct vfe_device *vfe_dev, void *arg)
{
int rc = 0;
struct <API key> *stream_cfg_cmd = arg;
if (vfe_dev->stats_data.num_active_stream == 0)
vfe_dev->hw_info->vfe_ops.stats_ops.cfg_ub(vfe_dev);
if (stream_cfg_cmd->enable) {
<API key>(vfe_dev, stream_cfg_cmd);
rc = <API key>(vfe_dev, stream_cfg_cmd);
} else {
rc = <API key>(vfe_dev, stream_cfg_cmd);
<API key>(vfe_dev, stream_cfg_cmd);
}
return rc;
}
int <API key>(struct vfe_device *vfe_dev, void *arg)
{
int rc = 0, i;
struct <API key> *stream_info;
struct <API key> *stats_data = &vfe_dev->stats_data;
struct <API key> *update_cmd = arg;
struct <API key> *update_info = NULL;
struct msm_isp_sw_framskip *sw_skip_info = NULL;
/*validate request*/
for (i = 0; i < update_cmd->num_streams; i++) {
update_info = &update_cmd->update_info[i];
/*check array reference bounds*/
if (STATS_IDX(update_info->stream_handle)
> vfe_dev->hw_info->stats_hw_info->num_stats_type) {
pr_err("%s: stats idx %d out of bound!", __func__,
STATS_IDX(update_info->stream_handle));
return -EINVAL;
}
}
for (i = 0; i < update_cmd->num_streams; i++) {
update_info = &update_cmd->update_info[i];
stream_info = &stats_data->stream_info[
STATS_IDX(update_info->stream_handle)];
if (stream_info->stream_handle !=
update_info->stream_handle) {
pr_err("%s: stats stream handle %x %x mismatch!\n",
__func__, stream_info->stream_handle,
update_info->stream_handle);
continue;
}
switch (update_cmd->update_type) {
case <API key>: {
uint32_t framedrop_period =
<API key>(
update_info->skip_pattern);
if (update_info->skip_pattern == SKIP_ALL)
stream_info->framedrop_pattern = 0x0;
else
stream_info->framedrop_pattern = 0x1;
stream_info->framedrop_period = framedrop_period - 1;
if (stream_info-><API key> == 0)
vfe_dev->hw_info->vfe_ops.stats_ops.cfg_wm_reg(
vfe_dev, stream_info);
break;
}
case <API key>: {
sw_skip_info = &update_info->sw_skip_info;
if (!stream_info->sw_skip.stream_src_mask)
stream_info->sw_skip = *sw_skip_info;
if (sw_skip_info->stats_type_mask != 0) {
/* No image buffer skip, only stats skip */
pr_debug("%s:%x skip type %x mode %d min %d max %d\n",
__func__, stream_info->stream_id,
sw_skip_info->stats_type_mask,
sw_skip_info->skip_mode,
sw_skip_info->min_frame_id,
sw_skip_info->max_frame_id);
stream_info->sw_skip.stats_type_mask =
sw_skip_info->stats_type_mask;
}
break;
}
default:
pr_err("%s: Invalid update type\n", __func__);
return -EINVAL;
}
}
return rc;
}
void <API key>(struct vfe_device *vfe_dev)
{
int i;
unsigned int mask = 0;
if (!vfe_dev) {
pr_err("%s: error NULL ptr\n", __func__);
return;
}
for (i = 0; i < vfe_dev->hw_info->stats_hw_info->num_stats_type; i++)
mask |= 1 << i;
vfe_dev->hw_info->vfe_ops.stats_ops.enable_module(vfe_dev, mask, 0);
} |
<?php
/**
* @file
* Contains \Drupal\uc_fulfillment\Tests\PackageTest.
*/
namespace Drupal\uc_fulfillment\Tests;
use Drupal\uc_order\Entity\Order;
use Drupal\uc_order\Entity\OrderProduct;
use Drupal\uc_store\Tests\UbercartTestBase;
/**
* Tests creating new packages from purchased products.
*
* @group Ubercart
*/
class PackageTest extends UbercartTestBase {
public static $modules = array('uc_payment', 'uc_payment_pack', 'uc_fulfillment');
public static $adminPermissions = array('fulfill orders');
public function testPackagesUI() {
$this->drupalLogin($this->adminUser);
$method = $this->createPaymentMethod('other');
// Process an anonymous, shippable order.
$order = Order::create([
'uid' => 0,
'primary_email' => $this->randomMachineName() . '@example.org',
'payment_method' => $method['id'],
]);
// Add three more products to use for our tests.
$products = array();
for ($i = 1; $i <= 4; $i++) {
$product = $this->createProduct(array('uid' => $this->adminUser->id(), 'promote' => 0));
$order->products[$i] = OrderProduct::create(array(
'nid' => $product->nid->target_id,
'title' => $product->title->value,
'model' => $product->model,
'qty' => 1,
'cost' => $product->cost->value,
'price' => $product->price->value,
'weight' => $product->weight,
'data' => [],
));
$order->products[$i]->data->shippable = 1;
}
$order->save();
$order = Order::load($order->id());
uc_payment_enter($order->id(), $method['id'], $order->getTotal());
// Order with 4 products shippable products. (where do we test not-shippable?)
// Check all, make one package, verify we're on packages page with only one packge.
// Try create package link, should see there are no products message.
// Delete package.
// Check all, make shipment, verify we're on packages page with N packages.
// Delete packages.
// How does Sep work? how does making 2 packages out of 4 products work?
// Check all, cancel, verify we're on order page.
// After packages made and check for # (check make one and make shipment, use sep. as well)
// Can use edit/delete actions to package then start over with the same order.
// and check for full table at /packages and check for action on /packages page,
// goto shipments tab and look for No shipments have been made for this order. as well as a list of all the packages.
// Test presence and operation of package operation on order admin View.
$this->drupalGet('admin/store/orders/view');
$this->assertLinkByHref('admin/store/orders/' . $order->id() . '/packages');
// Test action.
$this->clickLink(t('Package'));
$this->assertResponse(200);
$this->assertText(
'This order\'s products have not been organized into packages.',
'Package action found.'
);
// Now package the products in this order.
$this->drupalGet('admin/store/orders/' . $order->id() . '/packages');
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/new');
// First time through we'll be verbose - skip this on subsequent tests.
foreach ($order->products as $sequence => $item) {
$this->assertText(
$item->title->value,
'Product title found.'
);
$this->assertText(
$item->model->value,
'Product SKU found.'
);
$this->assertFieldByName(
'shipping_types[small_package][table][' . $sequence . '][checked]',
0,
'Product is available for packaging.'
);
}
// Select all products and test the "Cancel" button.
$this->drupalPostForm(
NULL,
array(
'shipping_types[small_package][table][1][checked]' => 1,
'shipping_types[small_package][table][2][checked]' => 1,
'shipping_types[small_package][table][3][checked]' => 1,
'shipping_types[small_package][table][4][checked]' => 1,
),
t('Cancel')
);
// Go back to Packages tab and try something else.
$this->assertUrl('admin/store/orders/' . $order->id());
$this->clickLink(t('Packages'));
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/new');
$this->assertText(
'This order\'s products have not been organized into packages.',
'Package action found.'
);
// Now test the "Create one package" button without selecting anything.
$this->drupalPostForm(NULL, array(), t('Create one package'));
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/new');
$this->assertText(
'Packages must contain at least one product.',
'Validation that there must be products in a package.'
);
// Now test the "Create one package" button with all products selected.
$this->drupalPostForm(
NULL,
array(
'shipping_types[small_package][table][1][checked]' => 1,
'shipping_types[small_package][table][2][checked]' => 1,
'shipping_types[small_package][table][3][checked]' => 1,
'shipping_types[small_package][table][4][checked]' => 1,
),
t('Create one package')
);
// Check that we're now on the package list page.
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages');
foreach ($order->products as $sequence => $item) {
$this->assertText(
$item->qty->value . ' x ' . $item->model->value,
'Product quantity x SKU found.'
);
}
// The "Create packages" local action should now be available too.
$this->assertLink(t('Create packages'));
$this->clickLink(t('Create packages'));
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/new');
// But we've already packaged everything...
$this->assertText(
'There are no products available for this type of package.',
'Create packages local action found.'
);
// Test "Ship", "Edit", and "Delete" operations for this package.
// First "Ship".
$this->drupalGet('admin/store/orders/' . $order->id() . '/packages');
$this->assertLink(t('Ship'));
$this->clickLink(t('Ship'));
$this->assertUrl('admin/store/orders/' . $order->id() . '/shipments/new?pkgs=1');
foreach ($order->products as $sequence => $item) {
$this->assertText(
$item->qty->value . ' x ' . $item->model->value,
'Product quantity x SKU found.'
);
}
// Second, "Edit".
$this->drupalGet('admin/store/orders/' . $order->id() . '/packages');
// (Use Href to distinguish Edit operation from Edit tab.)
$this->assertLinkByHref('admin/store/orders/' . $order->id() . '/packages/1/edit');
$this->drupalGet('admin/store/orders/' . $order->id() . '/packages/1/edit');
// We're editing the package we already made, so all the
// products should be checked.
foreach ($order->products as $sequence => $item) {
$this->assertFieldByName(
'products[' . $sequence . '][checked]',
1,
'Product is available for packaging.'
);
}
// Save the package to make sure the submit handler is working.
$this->drupalPostForm(NULL, array(), t('Save'));
$this->assertLinkByHref('admin/store/orders/' . $order->id() . '/packages');
// Third, "Delete".
$this->drupalGet('admin/store/orders/' . $order->id() . '/packages');
$this->assertLink(t('Delete'));
$this->clickLink(t('Delete'));
// Delete takes us to confirm page.
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/1/delete');
$this->assertText(
'The products it contains will be available for repackaging.',
'Deletion confirm question found.'
);
// "Cancel" returns to the package list page.
$this->clickLink(t('Cancel'));
$this->assertLinkByHref('admin/store/orders/' . $order->id() . '/packages');
// Again with the "Delete".
$this->clickLink(t('Delete'));
$this->drupalPostForm(NULL, array(), t('Delete'));
// Delete returns to new packages page with all packages unchecked.
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/new');
$this->assertText(
'Package 1 has been deleted.',
'Package deleted message found.'
);
foreach ($order->products as $sequence => $item) {
$this->assertFieldByName(
'shipping_types[small_package][table][' . $sequence . '][checked]',
0,
'Product is available for packaging.'
);
}
// Back to no packages. Now test making more than one package.
// Now test the "Create one package" button with all products selected.
$this->drupalPostForm(
NULL,
array(
'shipping_types[small_package][table][1][checked]' => 1,
'shipping_types[small_package][table][2][checked]' => 1,
),
t('Create one package')
);
// Check that we're now on the package list page.
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages');
$this->assertText(
$order->products[1]->qty->value . ' x ' . $order->products[1]->model->value,
'Product quantity x SKU found.'
);
$this->assertText(
$order->products[2]->qty->value . ' x ' . $order->products[2]->model->value,
'Product quantity x SKU found.'
);
$this->assertNoText(
$order->products[3]->qty->value . ' x ' . $order->products[3]->model->value,
'Product quantity x SKU not found.'
);
$this->assertNoText(
$order->products[4]->qty->value . ' x ' . $order->products[4]->model->value,
'Product quantity x SKU not found.'
);
// Use "Create packages" to create a second package.
$this->assertLink(t('Create packages'));
$this->clickLink(t('Create packages'));
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/new');
$this->assertNoText(
$order->products[1]->model->value,
'Product SKU not found.'
);
$this->assertNoText(
$order->products[2]->model->value,
'Product SKU not found.'
);
$this->assertText(
$order->products[3]->model->value,
'Product SKU found.'
);
$this->assertText(
$order->products[4]->model->value,
'Product SKU found.'
);
$this->drupalPostForm(
NULL,
array(
'shipping_types[small_package][table][3][checked]' => 1,
'shipping_types[small_package][table][4][checked]' => 1,
),
t('Create one package')
);
$this->assertLinkByHref('admin/store/orders/' . $order->id() . '/packages');
foreach ($order->products as $sequence => $item) {
$this->assertText(
$item->qty->value . ' x ' . $item->model->value,
'Product quantity x SKU found.'
);
}
// How do we test for two packages? Look for two "Ship" links
$this->assertLinkByHref('admin/store/orders/' . $order->id() . '/shipments/new?pkgs=2');
$this->assertLinkByHref('admin/store/orders/' . $order->id() . '/shipments/new?pkgs=3');
// Now delete both packages.
$this->clickLink(t('Delete'));
$this->drupalPostForm(NULL, array(), t('Delete'));
$this->assertText(
'Package 2 has been deleted.',
'Package deleted message found.'
);
// There's still one left to delete...
$this->clickLink(t('Delete'));
$this->drupalPostForm(NULL, array(), t('Delete'));
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages/new');
$this->assertText(
'Package 3 has been deleted.',
'Package deleted message found.'
);
// Back to no packages. Now test "Make packages" button.
$this->drupalPostForm(
NULL,
array(
'shipping_types[small_package][table][1][checked]' => 1,
'shipping_types[small_package][table][2][checked]' => 1,
'shipping_types[small_package][table][3][checked]' => 1,
'shipping_types[small_package][table][4][checked]' => 1,
),
t('Make packages')
);
// Check that we're now on the package list page.
$this->assertUrl('admin/store/orders/' . $order->id() . '/packages');
foreach ($order->products as $sequence => $item) {
$this->assertText(
$item->qty->value . ' x ' . $item->model->value,
'Product quantity x SKU found.'
);
}
}
} |
/*
control demo v1
by Ryan E. Anderson
*/
body {
width : 100%;
padding: 0;
margin: 0;
font: 12pt/100% 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #FFF;
background-color: #3B4D50;
}
h1 {
padding: 5px 15px;
}
p {
padding: 5px 15px;
}
a {
border: 1px dotted transparent;
}
a:link {
color: #FFF;
}
a:visited {
color: #FFF;
text-decoration: none;
}
a:hover {
color: #FFF;
border: 1px dotted #FFF;
}
a:active {
color: #FFF;
border: 1px dotted #FFF;
}
a.current {
text-decoration: none;
border: 1px dotted #FFF;
}
#fine-print {
margin: 0;
} |
<?php
$ca = array (
'pages' => 'Pàgines',
'pages:group' => 'Pàgines',
'pages:all' => 'Totes les pàgines',
'pages:new' => 'Nova pàgina',
'pages:edit' => 'Modificar la pàgina',
'pages:delete' => 'Esborrar la pàgina',
'pages:history' => 'Històric del a pàgina',
'pages:view' => 'Veure pàgina',
'pages:navigation' => 'Pàgina de navegació',
'item:object:page_top' => 'Pàgines d\'inici',
'item:object:page' => 'Pàgines',
'pages:nogroup' => 'El grup no té contingut encara o bé no tens permisos per veure la informació generada',
'pages:more' => 'Més pàgines',
'pages:title' => 'Títol de la pàgina',
'pages:description' => 'Descripció de l\'entrada',
'pages:tags' => 'Etiquetes',
'pages:access_id' => 'Accés de lectura',
'pages:write_access_id' => 'Accés de modificació',
'pages:noaccess' => 'Sense accés a la pàgina',
'pages:cantedit' => 'No pots modificar aquesta pàgina',
'pages:saved' => 'Pàgina desada',
'pages:notsaved' => 'La pàgina no es pot desar',
'pages:delete:success' => 'S\'ha esborrat la pàgina',
'pages:delete:failure' => 'No es pot esborrar la pàgina',
'pages:strapline' => 'Darrera actualització %s per %s',
'pages:revision' => 'Revisió',
'pages:num' => 'Nombre de pàgines a mostrar',
'pages:widget:description' => 'Aquest és un llistat de les teves pàgines',
'pages:label:view' => 'Veure pàgina',
'pages:label:edit' => 'Modificar pàgina',
'pages:label:history' => 'Històric de la pàgina',
'pages:sidebar:this' => 'Aquesta pàgina',
'pages:sidebar:children' => 'Sub-pàgines',
'pages:sidebar:parent' => 'Pare',
'pages:newchild' => 'Crear una sub-pàgina',
'pages:backtoparent' => 'Tornar a \'%s\'',
'pages:owner' => 'Pàgines de %s',
'pages:friends' => 'Pàgines de contactes',
'pages:add' => 'Afegir pàgina',
'groups:enablepages' => 'Habilitar pàgines del grup',
'pages:none' => 'Encara no hi ha cap pàgina creada',
'river:create:object:page' => '%s ha creat la pàgina %s',
'river:create:object:page_top' => '%s ha creat una pàgina %s',
'river:update:object:page' => '%s ha actualizat la pàgina %s',
'river:update:object:page_top' => '%s ha actualizat una pàgina %s',
'river:comment:object:page' => '%s ha comentat en la pàgina %s',
'river:comment:object:page_top' => '%s ha comentat en la pàgina %s',
'pages:error:no_title' => 'Ha d´especificar un títol per aquesta pàgina.',
'pages:revision:subtitle' => 'Revisió creada %s per %s',
'pages:notification' => '%s ha afegit una nova pàgina:
%s
%s
Veure i comentar a la nova pàgina:
%s',
);
add_translation("ca", $ca); |
from tempfile import mkdtemp
from zipfile import ZipFile, is_zipfile
from shutil import rmtree, copyfileobj
from xml.dom.minidom import parse
import os
class cleanopenoffi():
def __init__(self, sDocName, newDocName):
self.sDocName = sDocName
self.newDocName = newDocName
self._ms_do()
def _ms_do(self):
#uncompressing
if self.__uncompress():
#cleaning xml files
self._xml_cleaner()
self._xml_extra_cleaner()
#compressing , adding and deleting
self.__compress()
self._meta_adder()
else:
print "An error has ocurred uncompressing"
sys.exit(0)
def __uncompress(self):
#uncompressing metadata containers
if not is_zipfile(self.sDocName):
return False
buff = ZipFile(self.sDocName, 'r')
for i in buff.namelist():
if i in ('meta.xml', 'content.xml', 'settings.xml'):
filename = os.path.basename(i)
source = buff.open(i)
target = file(os.path.join(filename), 'wb')
copyfileobj(source, target)
source.close()
target.close()
return True
def _xml_cleaner(self):
dom = parse(os.path.join('meta.xml'))
metalist = ['meta:creation-date',
'dc:date',
'meta:editing-cycles',
'meta:editing-duration',
'meta:generator',
'dc:title',
'dc:description',
'meta:keyword',
'dc:language',
'meta:initial-creator',
'dc:creator']
#cleaning tags values
for i in metalist:
try:
for a in dom.<API key>(i):
a.childNodes[0].nodeValue = ""
except:
print "Error, tagname not found"
sys.exit(0)
#Saving in meta.xml
f = open(os.path.join('meta.xml'), 'w')
dom.writexml(f)
f.close()
def _xml_extra_cleaner(self):
#cleaning tags values in content.xml
content = parse(os.path.join('content.xml'))
content_tag = content.<API key>("text:a")
for node in content_tag:
try:
node.setAttribute('xlink:href', str(''))
except:
print "Error, tagname not found"
sys.exit(0)
f = open(os.path.join('content.xml'), 'w')
content.writexml(f)
f.close()
#cleaning tags values in settings.xml(WILL MUST CORRECT IT)
#PENDING A FIX FOR IT(when we have more time)
"""
settings = parse(os.path.join('settings.xml'))
settings_tag = settings.<API key>("config:config-item")
for another_node in settings_tag:
try:
another_node.setAttribute('config:name', str(''))
except:
print "An error has ocurred, but not is very important, you can continue"
j = open(os.path.join('settings.xml'), 'w')
settings.writexml(j)
j.close()
"""
def __compress(self):
zf = ZipFile(self.sDocName, 'r')
zp = ZipFile(self.newDocName, 'w')
for item in zf.infolist():
try:
#triying to write a new document without meta,content & settings .xml
buffer = zf.read(item.filename)
if (item.filename[-8:] != 'meta.xml') and (item.filename[-11:] != 'content.xml') and (item.filename[-12:] != 'settings.xml'):
zp.writestr(item, buffer)
except:
print "Can't write"
sys.exit(0)
zf.close()
zp.close()
def _meta_adder(self):
zf = ZipFile(self.newDocName, 'a')
zf.write('meta.xml')
zf.write('content.xml')
zf.write('settings.xml')
zf.close()
#deleting container files
os.remove('meta.xml')
os.remove('content.xml')
os.remove('settings.xml')
cleanopenoffi("test.odt","test2.odt") |
# -*- coding: utf-8 -*-
# This file is part of translate.
# translate is free software; you can redistribute it and/or modify
# (at your option) any later version.
# translate is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
import logging
from translate.storage import csvl10n, po
logger = logging.getLogger(__name__)
def replacestrings(source, *pairs):
r"""Use ``pairs`` of ``(original, replacement)`` to replace text found in
``source``.
:param source: String to on which ``pairs`` of strings are to be replaced
:type source: String
:param \*pairs: Strings to be matched and replaced
:type \*pairs: One or more tuples of (original, replacement)
:return: String with ``*pairs`` of strings replaced
"""
for orig, new in pairs:
source = source.replace(orig, new)
return source
def quotecsvstr(source):
return '"' + \
replacestrings(source,
('\\"', '"'), ('"', '\\"'),
("\\\\'", "\\'"), ('\\\\n', '\\n')) + \
'"'
def simplify(string):
return ''.join(filter(type(string).isalnum, string))
class csv2po:
"""a class that takes translations from a .csv file and puts them in a .po
file
"""
def __init__(self, templatepo=None, charset=None, duplicatestyle="keep"):
"""construct the converter..."""
self.pofile = templatepo
self.charset = charset
self.duplicatestyle = duplicatestyle
self.commentindex = {}
self.sourceindex = {}
self.simpleindex = {}
self.csvfile = None
self.duplicatecomments = []
if self.pofile is not None:
self.unmatched = 0
self.makeindex()
def makeindex(self):
"""makes indexes required for searching..."""
for pounit in self.pofile.units:
joinedcomment = " ".join(pounit.getlocations())
source = pounit.source
# the definitive way to match is by source comment (joinedcomment)
if joinedcomment in self.commentindex:
# unless more than one thing matches...
self.duplicatecomments.append(joinedcomment)
else:
self.commentindex[joinedcomment] = pounit
# do simpler matching in case things have been mangled...
simpleid = simplify(source)
# but check for duplicates
if (simpleid in self.simpleindex and
not (source in self.sourceindex)):
# keep a list of them...
self.simpleindex[simpleid].append(pounit)
else:
self.simpleindex[simpleid] = [pounit]
# also match by standard msgid
self.sourceindex[source] = pounit
for comment in self.duplicatecomments:
if comment in self.commentindex:
del self.commentindex[comment]
def convertunit(self, csvunit):
"""converts csv unit to po unit"""
pounit = po.pounit(encoding="UTF-8")
if csvunit.location:
pounit.addlocation(csvunit.location)
pounit.source = csvunit.source
pounit.target = csvunit.target
return pounit
def handlecsvunit(self, csvunit):
"""handles reintegrating a csv unit into the .po file"""
if (len(csvunit.location.strip()) > 0 and
csvunit.location in self.commentindex):
pounit = self.commentindex[csvunit.location]
elif csvunit.source in self.sourceindex:
pounit = self.sourceindex[csvunit.source]
elif simplify(csvunit.source) in self.simpleindex:
thepolist = self.simpleindex[simplify(csvunit.source)]
if len(thepolist) > 1:
csvfilename = getattr(self.csvfile, "filename", "(unknown)")
matches = "\n ".join(["possible match: " +
pounit.source for pounit in thepolist])
logger.warning("%s - csv entry not unique in pofile, "
"multiple matches found:\n"
" location\t%s\n"
" original\t%s\n"
" translation\t%s\n"
" %s",
csvfilename, csvunit.location,
csvunit.source, csvunit.target, matches)
self.unmatched += 1
return
pounit = thepolist[0]
else:
csvfilename = getattr(self.csvfile, "filename", "(unknown)")
logger.warning("%s - csv entry not found in pofile:\n"
" location\t%s\n"
" original\t%s\n"
" translation\t%s",
csvfilename, csvunit.location,
csvunit.source, csvunit.target)
self.unmatched += 1
return
if pounit.hasplural():
# we need to work out whether we matched the singular or the plural
singularid = pounit.source.strings[0]
pluralid = pounit.source.strings[1]
if csvunit.source == singularid:
pounit.msgstr[0] = csvunit.target
elif csvunit.source == pluralid:
pounit.msgstr[1] = csvunit.target
elif simplify(csvunit.source) == simplify(singularid):
pounit.msgstr[0] = csvunit.target
elif simplify(csvunit.source) == simplify(pluralid):
pounit.msgstr[1] = csvunit.target
else:
logger.warning("couldn't work out singular/plural: %r, %r, %r",
csvunit.source, singularid, pluralid)
self.unmatched += 1
return
else:
pounit.target = csvunit.target
def convertstore(self, thecsvfile):
"""converts a csvfile to a pofile, and returns it. uses templatepo if
given at construction
"""
self.csvfile = thecsvfile
if self.pofile is None:
self.pofile = po.pofile()
mergemode = False
else:
mergemode = True
if self.pofile.units and self.pofile.units[0].isheader():
targetheader = self.pofile.units[0]
self.pofile.updateheader(content_type="text/plain; charset=UTF-8",
<API key>="8bit")
else:
targetheader = self.pofile.makeheader(charset="UTF-8",
encoding="8bit")
targetheader.addnote("extracted from %s" % self.csvfile.filename,
"developer")
mightbeheader = True
for csvunit in self.csvfile.units:
#if self.charset is not None:
# csvunit.source = csvunit.source.decode(self.charset)
# csvunit.target = csvunit.target.decode(self.charset)
if mightbeheader:
# ignore typical header strings...
mightbeheader = False
if csvunit.match_header():
continue
if (len(csvunit.location.strip()) == 0 and
csvunit.source.find("Content-Type:") != -1):
continue
if mergemode:
self.handlecsvunit(csvunit)
else:
pounit = self.convertunit(csvunit)
self.pofile.addunit(pounit)
self.pofile.removeduplicates(self.duplicatestyle)
return self.pofile
def convertcsv(inputfile, outputfile, templatefile, charset=None,
columnorder=None, duplicatestyle="msgctxt"):
"""reads in inputfile using csvl10n, converts using csv2po, writes to
outputfile
"""
inputstore = csvl10n.csvfile(inputfile, fieldnames=columnorder)
if templatefile is None:
convertor = csv2po(charset=charset, duplicatestyle=duplicatestyle)
else:
templatestore = po.pofile(templatefile)
convertor = csv2po(templatestore, charset=charset,
duplicatestyle=duplicatestyle)
outputstore = convertor.convertstore(inputstore)
if outputstore.isempty():
return 0
outputstore.serialize(outputfile)
return 1
def main(argv=None):
from translate.convert import convert
formats = {
("csv", "po"): ("po", convertcsv),
("csv", "pot"): ("po", convertcsv),
("csv", None): ("po", convertcsv),
}
parser = convert.ConvertOptionParser(formats, usetemplates=True,
usepots=True,
description=__doc__)
parser.add_option(
"", "--charset", dest="charset", default=None,
help="set charset to decode from csv files", metavar="CHARSET")
parser.add_option(
"", "--columnorder", dest="columnorder", default=None,
help="specify the order and position of columns (location,source,target)")
parser.<API key>()
parser.passthrough.append("charset")
parser.passthrough.append("columnorder")
parser.run(argv)
if __name__ == '__main__':
main() |
<?php require("../../includes/header.php"); ?><h1>Permutation Cycles</h1><div class="content">
<p> We consider <em>permutations</em> of the numbers 1,..., <em>N</em><br />
for some <em>N</em>. By permutation we mean a rearrangment of the<br />
number 1,...,<em>N</em>. For example</p>
<pre>
2 4 5 1 7 6 3 8
</pre><p> is a permutation of 1,2,...,8. Of course,</p>
<pre>
1 2 3 4 5 6 7 8
</pre><p> is also a permutation of 1,2,...,8.</p>
<p> We can "walk around" a permutation in a interesting way and here<br />
is how it is done for the permutation above:</p>
<p> Start at position 1. At position 1 we have 2 and so we go to<br />
position 2. Here we find 4 and so we go to position 4. Here we find<br />
1, which is a position that we have already visited. This completes<br />
the first part of our walk and we denote this walk by (1 2 4 1). Such<br />
a walk is called a <em>cycle</em>. An interesting property of such<br />
walks, that you may take for granted, is that the position we revisit<br />
will always be the one we started from! </p>
<p> We continue our walk by jumping to first unvisited position, in<br />
this case position 3 and continue in the same manner. This time we<br />
find 5 at position 3 and so we go to position 5 and find 7 and we go<br />
to position 7 and find 3 and thus we get the cycle (3 5 7 3). Next we<br />
start at position 6 and get (6 6) and finally we start at position 8<br />
and get the cycle (8 8). We have exhausted all the positions. Our<br />
walk through this permutation consists of 4 cycles.</p>
<p> One can carry out this walk through any permutation and obtain a<br />
set of cycles as the result. Your task is to print out the cycles<br />
that result from walking through a given permutation.</p>
<p>Input format</p>
<p> The first line of the input is a positive integer <em>N</em><br />
indicating the length of the permutation. The next line contains<br />
<em>N</em> integers and is a permutation of 1,2,...,<em>N</em>.</p>
<p> You may assume that <em>N</em> ≤ 1000.</p>
<p>Output format</p>
<p> The first line of the output must contain a single integer<br />
<em>k</em> denoting the number of cycles in the permutation. Line 2<br />
should describe the first cycle, line 3 the second cycle and so on and<br />
line <em>k</em>+1 should describe the kth cycle.</p>
<p>Examples</p>
<p>Sample input 1:</p>
<pre>
8
2 4 5 1 7 6 3 8
</pre><p>Sample output 1:</p>
<pre>
4
1 2 4 1
3 5 7 3
6 6
8 8
</pre><p>Sample input 2:</p>
<pre>
8
1 2 3 4 5 6 7 8
</pre><p>Sample output 2:</p>
<pre>
8
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
</pre> </div><table cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="14%">Author:</td>
<td><a href="/users/admin">admin</a></td>
</tr>
<tr>
<td width="14%">Date Added:</td>
<td>28-07-2009</td>
</tr>
<tr>
<td width="14%">Time Limit:</td>
<td>1 sec</td>
</tr>
<tr>
<td width="14%">Source Limit:</td>
<td>50000 Bytes</td>
</tr>
<tr>
<td width="14%">Languages:</td>
<td>ADA, ASM, BASH, BF, C, C99 strict, CAML, CLPS, CPP 4.3.2, CPP 4.8.1, CPP11, CS2, D, FORT, GO, HASK, ICK, ICON, JAR, JAVA, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, WSPC</td>
</tr>
</table> <?php require("../../includes/footer.php"); ?> |
# Makefile for the linux kernel.
CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET)
AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
ifdef <API key>
<API key>.o = -pg
endif
<API key>.o = -pg
<API key>.o = -Werror
# Object file lists.
obj-y := compat.o elf.o entry-armv.o entry-common.o irq.o \
process.o ptrace.o return_address.o setup.o signal.o \
sys_arm.o stacktrace.o time.o traps.o
obj-$(CONFIG_LEDS) += leds.o
obj-$(CONFIG_OC_ETM) += etm.o
obj-$(CONFIG_ISA_DMA_API) += dma.o
obj-$(CONFIG_ARCH_ACORN) += ecard.o
obj-$(CONFIG_FIQ) += fiq.o
obj-$(CONFIG_MODULES) += armksyms.o module.o
obj-$(CONFIG_ARTHUR) += arthur.o
obj-$(CONFIG_ISA_DMA) += dma-isa.o
obj-$(CONFIG_PCI) += bios32.o isa.o
obj-$(<API key>) += sched_clock.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o
obj-$(<API key>) += ftrace.o
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o
obj-$(CONFIG_ATAGS_PROC) += atags.o
obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_ARM_UNWIND) += unwind.o
obj-$(CONFIG_HAVE_TCM) += tcm.o
obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
obj-$(CONFIG_IWMMXT) += iwmmxt.o
obj-$(CONFIG_CPU_HAS_PMU) += pmu.o
obj-$(<API key>) += perf_event.o
AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
ifneq ($(CONFIG_ARCH_EBSA110),y)
obj-y += io.o
endif
head-y := head$(MMUEXT).o
obj-$(CONFIG_DEBUG_LL) += debug.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
extra-y := $(head-y) init_task.o vmlinux.lds |
<!
<!--@subject {{trans "Credit memo for your %store_name order" store_name=$store.getFrontendName()}} @-->
<!--@vars {
"var <API key>|raw":"Billing Address",
"var comment":"Credit Memo Comment",
"var creditmemo.increment_id":"Credit Memo Id",
"layout handle=\"<API key>\" creditmemo=$creditmemo order=$order":"Credit Memo Items Grid",
"var this.getUrl($store, 'customer/account/')":"Customer Account URL",
"var order.getCustomerName()":"Customer Name",
"var order.increment_id":"Order Id",
"var payment_html|raw":"Payment Details",
"var <API key>|raw":"Shipping Address",
"var order.<API key>()":"Shipping Description",
"var order.<API key>":"Shipping Description"
} @
{{template config_path="design/email/header_template"}}
<table>
<tr class="email-intro">
<td>
<p class="greeting">{{trans "%name," name=$order.getCustomerName()}}</p>
<p>
{{trans "Thank you for your order from %store_name." store_name=$store.getFrontendName()}}
{{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
{{trans 'If you have questions about your order, you can email us at <a href="mailto:%store_email">%store_email</a>' store_email=$store_email |raw}}{{depend store_phone}} {{trans 'or call us at <a href="tel:%store_phone">%store_phone</a>' store_phone=$store_phone |raw}}{{/depend}}.
{{depend store_hours}}
{{trans 'Our hours are <span class="no-link">%store_hours</span>.' store_hours=$store_hours |raw}}
{{/depend}}
</p>
</td>
</tr>
<tr class="email-summary">
<td>
<h1>{{trans "Your Credit Memo #%creditmemo_id for Order #%order_id" creditmemo_id=$creditmemo.increment_id order_id=$order.increment_id}}</h1>
</td>
</tr>
<tr class="email-information">
<td>
{{depend comment}}
<table class="message-info">
<tr>
<td>
{{var comment|escape|nl2br}}
</td>
</tr>
</table>
{{/depend}}
<table class="order-details">
<tr>
<td class="address-details">
<h3>{{trans "Billing Info"}}</h3>
<p>{{var <API key>|raw}}</p>
</td>
{{depend order.getIsNotVirtual()}}
<td class="address-details">
<h3>{{trans "Shipping Info"}}</h3>
<p>{{var <API key>|raw}}</p>
</td>
{{/depend}}
</tr>
<tr>
<td class="method-info">
<h3>{{trans "Payment Method"}}</h3>
{{var payment_html|raw}}
</td>
{{depend order.getIsNotVirtual()}}
<td class="method-info">
<h3>{{trans "Shipping Method"}}</h3>
<p>{{var order.<API key>()}}</p>
</td>
{{/depend}}
</tr>
</table>
{{layout handle="<API key>" creditmemo=$creditmemo order=$order}}
</td>
</tr>
</table>
{{template config_path="design/email/footer_template"}} |
class UserCourse < ActiveRecord::Base
attr_accessible :user_id, :course_id, :roleincourse_id
<API key> :roleincourse_id
<API key> :id, :course_id, :allow_nil => true, :greater_than => 0, :only_integer => true
<API key> :user_id, :roleincourse_id, :greater_than => 0, :only_integer => true
belongs_to :user
belongs_to :course
belongs_to :coursegroup
belongs_to :roleincourse
#default_scope :joins => :course, :order => 'courses.endyear DESC, courses.endmonth DESC, courses.startyear DESC, courses.startmonth DESC, courses.name ASC'
scope :instructors, joins(:roleincourse).where('roleincourses.id != 2')
scope :among, lambda { |sy,sm,ey,em|
joins(:course).where("user_courses.course_id IN (#{Course.unscoped.select('DISTINCT(id)').between(sy,sm,ey,em).to_sql})")
}
scope :find_by_year, lambda { |year| joins(:course).where("courses.year = ?", year) }
scope :adscription_id, lambda { |id| joins(:user => :user_adscription).where(:user => { :user_adscription => { :adscription_id => id} }) }
search_methods :among, :splat_param => true, :type => [:integer, :integer, :integer, :integer]
search_methods :adscription_id
def author_with_role
[user.author_name, "(#{roleincourse.name})"].join(' ')
end
end |
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/skbuff.h>
#include <linux/list.h>
#include <linux/compiler.h>
#include <linux/rbtree.h>
#include <net/netlink.h>
#include <net/pkt_sched.h>
static int htb_hysteresis __read_mostly = 1; /* whether to use mode hysteresis for speedup */
#define HTB_VER 0x30011 /* major must be matched with number suplied by TC as version */
#if HTB_VER >> 16 != TC_HTB_PROTOVER
#error "Mismatched sch_htb.c and pkt_sch.h"
#endif
/* Module parameter and sysfs export */
module_param (htb_hysteresis, int, 0640);
MODULE_PARM_DESC(htb_hysteresis, "Hysteresis mode, less CPU load, less accurate");
/* used internaly to keep status of single class */
enum htb_cmode {
HTB_CANT_SEND, /* class can't send and can't borrow */
HTB_MAY_BORROW, /* class can't send but may borrow */
HTB_CAN_SEND /* class can send */
};
/* interior & leaf nodes; props specific to leaves are marked L: */
struct htb_class {
struct Qdisc_class_common common;
/* general class parameters */
struct gnet_stats_basic bstats;
struct gnet_stats_queue qstats;
struct gnet_stats_rate_est rate_est;
struct tc_htb_xstats xstats; /* our special stats */
int refcnt; /* usage count of this class */
/* topology */
int level; /* our level (see above) */
unsigned int children;
struct htb_class *parent; /* parent class */
union {
struct htb_class_leaf {
struct Qdisc *q;
int prio;
int aprio;
int quantum;
int deficit[TC_HTB_MAXDEPTH];
struct list_head drop_list;
} leaf;
struct htb_class_inner {
struct rb_root feed[TC_HTB_NUMPRIO]; /* feed trees */
struct rb_node *ptr[TC_HTB_NUMPRIO]; /* current class ptr */
/* When class changes from state 1->2 and disconnects from
parent's feed then we lost ptr value and start from the
first child again. Here we store classid of the
last valid ptr (used when ptr is NULL). */
u32 last_ptr_id[TC_HTB_NUMPRIO];
} inner;
} un;
struct rb_node node[TC_HTB_NUMPRIO]; /* node for self or feed tree */
struct rb_node pq_node; /* node for event queue */
psched_time_t pq_key;
int prio_activity; /* for which prios are we active */
enum htb_cmode cmode; /* current mode of the class */
/* class attached filters */
struct tcf_proto *filter_list;
int filter_cnt;
int warned; /* only one warning about non work conserving .. */
/* token bucket parameters */
struct qdisc_rate_table *rate; /* rate table of the class itself */
struct qdisc_rate_table *ceil; /* ceiling rate (limits borrows too) */
long buffer, cbuffer; /* token bucket depth/rate */
psched_tdiff_t mbuffer; /* max wait time */
long tokens, ctokens; /* current number of tokens */
psched_time_t t_c; /* checkpoint time */
int prio; /* For parent to leaf return possible here */
int quantum; /* we do backup. Finally full replacement */
/* of un.leaf originals should be done. */
};
static inline long L2T(struct htb_class *cl, struct qdisc_rate_table *rate,
int size)
{
long result = qdisc_l2t(rate, size);
return result;
}
struct htb_sched {
struct Qdisc_class_hash clhash;
struct list_head drops[TC_HTB_NUMPRIO];/* active leaves (for drops) */
/* self list - roots of self generating tree */
struct rb_root row[TC_HTB_MAXDEPTH][TC_HTB_NUMPRIO];
int row_mask[TC_HTB_MAXDEPTH];
struct rb_node *ptr[TC_HTB_MAXDEPTH][TC_HTB_NUMPRIO];
u32 last_ptr_id[TC_HTB_MAXDEPTH][TC_HTB_NUMPRIO];
/* self wait list - roots of wait PQs per row */
struct rb_root wait_pq[TC_HTB_MAXDEPTH];
/* time of nearest event per level (row) */
psched_time_t near_ev_cache[TC_HTB_MAXDEPTH];
/* whether we hit non-work conserving class during this dequeue; we use */
int nwc_hit; /* this to disable mindelay complaint in dequeue */
int defcls; /* class where unclassified flows go to */
/* filters for qdisc itself */
struct tcf_proto *filter_list;
int rate2quantum; /* quant = rate / rate2quantum */
psched_time_t now; /* cached dequeue time */
struct qdisc_watchdog watchdog;
/* non shaped skbs; let them go directly thru */
struct sk_buff_head direct_queue;
int direct_qlen; /* max qlen of above */
long direct_pkts;
};
/* find class in global hash table using given handle */
static inline struct htb_class *htb_find(u32 handle, struct Qdisc *sch)
{
struct htb_sched *q = qdisc_priv(sch);
struct Qdisc_class_common *clc;
clc = qdisc_class_find(&q->clhash, handle);
if (clc == NULL)
return NULL;
return container_of(clc, struct htb_class, common);
}
/**
* htb_classify - classify a packet into class
*
* It returns NULL if the packet should be dropped or -1 if the packet
* should be passed directly thru. In all other cases leaf class is returned.
* We allow direct class selection by classid in priority. The we examine
* filters in qdisc and in inner nodes (if higher filter points to the inner
* node). If we end up with classid MAJOR:0 we enqueue the skb into special
* internal fifo (direct). These packets then go directly thru. If we still
* have no valid leaf we try to use MAJOR:default leaf. It still unsuccessfull
* then finish and return direct queue.
*/
#define HTB_DIRECT (struct htb_class*)-1
static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch,
int *qerr)
{
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl;
struct tcf_result res;
struct tcf_proto *tcf;
int result;
/* allow to select class by setting skb->priority to valid classid;
note that nfmark can be used too by attaching filter fw with no
rules in it */
if (skb->priority == sch->handle)
return HTB_DIRECT; /* X:0 (direct flow) selected */
if ((cl = htb_find(skb->priority, sch)) != NULL && cl->level == 0)
return cl;
*qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
tcf = q->filter_list;
while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) {
#ifdef CONFIG_NET_CLS_ACT
switch (result) {
case TC_ACT_QUEUED:
case TC_ACT_STOLEN:
*qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;
case TC_ACT_SHOT:
return NULL;
}
#endif
if ((cl = (void *)res.class) == NULL) {
if (res.classid == sch->handle)
return HTB_DIRECT; /* X:0 (direct flow) */
if ((cl = htb_find(res.classid, sch)) == NULL)
break; /* filter selected invalid classid */
}
if (!cl->level)
return cl; /* we hit leaf; return it */
/* we have got inner class; apply inner filter chain */
tcf = cl->filter_list;
}
/* classification failed; try to use default class */
cl = htb_find(TC_H_MAKE(TC_H_MAJ(sch->handle), q->defcls), sch);
if (!cl || cl->level)
return HTB_DIRECT; /* bad default .. this is safe bet */
return cl;
}
/**
* htb_add_to_id_tree - adds class to the round robin list
*
* Routine adds class to the list (actually tree) sorted by classid.
* Make sure that class is not already on such list for given prio.
*/
static void htb_add_to_id_tree(struct rb_root *root,
struct htb_class *cl, int prio)
{
struct rb_node **p = &root->rb_node, *parent = NULL;
while (*p) {
struct htb_class *c;
parent = *p;
c = rb_entry(parent, struct htb_class, node[prio]);
if (cl->common.classid > c->common.classid)
p = &parent->rb_right;
else
p = &parent->rb_left;
}
rb_link_node(&cl->node[prio], parent, p);
rb_insert_color(&cl->node[prio], root);
}
/**
* <API key> - adds class to the event queue with delay
*
* The class is added to priority event queue to indicate that class will
* change its mode in cl->pq_key microseconds. Make sure that class is not
* already in the queue.
*/
static void <API key>(struct htb_sched *q,
struct htb_class *cl, long delay)
{
struct rb_node **p = &q->wait_pq[cl->level].rb_node, *parent = NULL;
cl->pq_key = q->now + delay;
if (cl->pq_key == q->now)
cl->pq_key++;
/* update the nearest event cache */
if (q->near_ev_cache[cl->level] > cl->pq_key)
q->near_ev_cache[cl->level] = cl->pq_key;
while (*p) {
struct htb_class *c;
parent = *p;
c = rb_entry(parent, struct htb_class, pq_node);
if (cl->pq_key >= c->pq_key)
p = &parent->rb_right;
else
p = &parent->rb_left;
}
rb_link_node(&cl->pq_node, parent, p);
rb_insert_color(&cl->pq_node, &q->wait_pq[cl->level]);
}
/**
* htb_next_rb_node - finds next node in binary tree
*
* When we are past last key we return NULL.
* Average complexity is 2 steps per call.
*/
static inline void htb_next_rb_node(struct rb_node **n)
{
*n = rb_next(*n);
}
/**
* <API key> - add class to its row
*
* The class is added to row at priorities marked in mask.
* It does nothing if mask == 0.
*/
static inline void <API key>(struct htb_sched *q,
struct htb_class *cl, int mask)
{
q->row_mask[cl->level] |= mask;
while (mask) {
int prio = ffz(~mask);
mask &= ~(1 << prio);
htb_add_to_id_tree(q->row[cl->level] + prio, cl, prio);
}
}
/* If this triggers, it is a bug in this code, but it need not be fatal */
static void htb_safe_rb_erase(struct rb_node *rb, struct rb_root *root)
{
if (RB_EMPTY_NODE(rb)) {
WARN_ON(1);
} else {
rb_erase(rb, root);
RB_CLEAR_NODE(rb);
}
}
/**
* <API key> - removes class from its row
*
* The class is removed from row at priorities marked in mask.
* It does nothing if mask == 0.
*/
static inline void <API key>(struct htb_sched *q,
struct htb_class *cl, int mask)
{
int m = 0;
while (mask) {
int prio = ffz(~mask);
mask &= ~(1 << prio);
if (q->ptr[cl->level][prio] == cl->node + prio)
htb_next_rb_node(q->ptr[cl->level] + prio);
htb_safe_rb_erase(cl->node + prio, q->row[cl->level] + prio);
if (!q->row[cl->level][prio].rb_node)
m |= 1 << prio;
}
q->row_mask[cl->level] &= ~m;
}
/**
* htb_activate_prios - creates active classe's feed chain
*
* The class is connected to ancestors and/or appropriate rows
* for priorities it is participating on. cl->cmode must be new
* (activated) mode. It does nothing if cl->prio_activity == 0.
*/
static void htb_activate_prios(struct htb_sched *q, struct htb_class *cl)
{
struct htb_class *p = cl->parent;
long m, mask = cl->prio_activity;
while (cl->cmode == HTB_MAY_BORROW && p && mask) {
m = mask;
while (m) {
int prio = ffz(~m);
m &= ~(1 << prio);
if (p->un.inner.feed[prio].rb_node)
/* parent already has its feed in use so that
reset bit in mask as parent is already ok */
mask &= ~(1 << prio);
htb_add_to_id_tree(p->un.inner.feed + prio, cl, prio);
}
p->prio_activity |= mask;
cl = p;
p = cl->parent;
}
if (cl->cmode == HTB_CAN_SEND && mask)
<API key>(q, cl, mask);
}
/**
* <API key> - remove class from feed chain
*
* cl->cmode must represent old mode (before deactivation). It does
* nothing if cl->prio_activity == 0. Class is removed from all feed
* chains and rows.
*/
static void <API key>(struct htb_sched *q, struct htb_class *cl)
{
struct htb_class *p = cl->parent;
long m, mask = cl->prio_activity;
while (cl->cmode == HTB_MAY_BORROW && p && mask) {
m = mask;
mask = 0;
while (m) {
int prio = ffz(~m);
m &= ~(1 << prio);
if (p->un.inner.ptr[prio] == cl->node + prio) {
/* we are removing child which is pointed to from
parent feed - forget the pointer but remember
classid */
p->un.inner.last_ptr_id[prio] = cl->common.classid;
p->un.inner.ptr[prio] = NULL;
}
htb_safe_rb_erase(cl->node + prio, p->un.inner.feed + prio);
if (!p->un.inner.feed[prio].rb_node)
mask |= 1 << prio;
}
p->prio_activity &= ~mask;
cl = p;
p = cl->parent;
}
if (cl->cmode == HTB_CAN_SEND && mask)
<API key>(q, cl, mask);
}
static inline long htb_lowater(const struct htb_class *cl)
{
if (htb_hysteresis)
return cl->cmode != HTB_CANT_SEND ? -cl->cbuffer : 0;
else
return 0;
}
static inline long htb_hiwater(const struct htb_class *cl)
{
if (htb_hysteresis)
return cl->cmode == HTB_CAN_SEND ? -cl->buffer : 0;
else
return 0;
}
/**
* htb_class_mode - computes and returns current class mode
*
* It computes cl's mode at time cl->t_c+diff and returns it. If mode
* is not HTB_CAN_SEND then cl->pq_key is updated to time difference
* from now to time when cl will change its state.
* Also it is worth to note that class mode doesn't change simply
* at cl->{c,}tokens == 0 but there can rather be hysteresis of
* 0 .. -cl->{c,}buffer range. It is meant to limit number of
* mode transitions per time unit. The speed gain is about 1/6.
*/
static inline enum htb_cmode
htb_class_mode(struct htb_class *cl, long *diff)
{
long toks;
if ((toks = (cl->ctokens + *diff)) < htb_lowater(cl)) {
*diff = -toks;
return HTB_CANT_SEND;
}
if ((toks = (cl->tokens + *diff)) >= htb_hiwater(cl))
return HTB_CAN_SEND;
*diff = -toks;
return HTB_MAY_BORROW;
}
/**
* <API key> - changes classe's mode
*
* This should be the only way how to change classe's mode under normal
* cirsumstances. Routine will update feed lists linkage, change mode
* and add class to the wait event queue if appropriate. New mode should
* be different from old one and cl->pq_key has to be valid if changing
* to mode other than HTB_CAN_SEND (see <API key>).
*/
static void
<API key>(struct htb_sched *q, struct htb_class *cl, long *diff)
{
enum htb_cmode new_mode = htb_class_mode(cl, diff);
if (new_mode == cl->cmode)
return;
if (cl->prio_activity) { /* not necessary: speed optimization */
if (cl->cmode != HTB_CANT_SEND)
<API key>(q, cl);
cl->cmode = new_mode;
if (new_mode != HTB_CANT_SEND)
htb_activate_prios(q, cl);
} else
cl->cmode = new_mode;
}
/**
* htb_activate - inserts leaf cl into appropriate active feeds
*
* Routine learns (new) priority of leaf and activates feed chain
* for the prio. It can be called on already active leaf safely.
* It also adds leaf into droplist.
*/
static inline void htb_activate(struct htb_sched *q, struct htb_class *cl)
{
WARN_ON(cl->level || !cl->un.leaf.q || !cl->un.leaf.q->q.qlen);
if (!cl->prio_activity) {
cl->prio_activity = 1 << (cl->un.leaf.aprio = cl->un.leaf.prio);
htb_activate_prios(q, cl);
list_add_tail(&cl->un.leaf.drop_list,
q->drops + cl->un.leaf.aprio);
}
}
/**
* htb_deactivate - remove leaf cl from active feeds
*
* Make sure that leaf is active. In the other words it can't be called
* with non-active leaf. It also removes class from the drop list.
*/
static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl)
{
WARN_ON(!cl->prio_activity);
<API key>(q, cl);
cl->prio_activity = 0;
list_del_init(&cl->un.leaf.drop_list);
}
static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
int ret;
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = htb_classify(skb, sch, &ret);
if (cl == HTB_DIRECT) {
/* enqueue to helper queue */
if (q->direct_queue.qlen < q->direct_qlen) {
__skb_queue_tail(&q->direct_queue, skb);
q->direct_pkts++;
} else {
kfree_skb(skb);
sch->qstats.drops++;
return NET_XMIT_DROP;
}
#ifdef CONFIG_NET_CLS_ACT
} else if (!cl) {
if (ret & __NET_XMIT_BYPASS)
sch->qstats.drops++;
kfree_skb(skb);
return ret;
#endif
} else if ((ret = qdisc_enqueue(skb, cl->un.leaf.q)) != NET_XMIT_SUCCESS) {
if (net_xmit_drop_count(ret)) {
sch->qstats.drops++;
cl->qstats.drops++;
}
return ret;
} else {
cl->bstats.packets +=
skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
cl->bstats.bytes += qdisc_pkt_len(skb);
htb_activate(q, cl);
}
sch->q.qlen++;
sch->bstats.packets += skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
sch->bstats.bytes += qdisc_pkt_len(skb);
return NET_XMIT_SUCCESS;
}
/* TODO: requeuing packet charges it to policers again !! */
static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
{
int ret;
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = htb_classify(skb, sch, &ret);
struct sk_buff *tskb;
if (cl == HTB_DIRECT) {
/* enqueue to helper queue */
if (q->direct_queue.qlen < q->direct_qlen) {
__skb_queue_head(&q->direct_queue, skb);
} else {
__skb_queue_head(&q->direct_queue, skb);
tskb = __skb_dequeue_tail(&q->direct_queue);
kfree_skb(tskb);
sch->qstats.drops++;
return NET_XMIT_CN;
}
#ifdef CONFIG_NET_CLS_ACT
} else if (!cl) {
if (ret & __NET_XMIT_BYPASS)
sch->qstats.drops++;
kfree_skb(skb);
return ret;
#endif
} else if ((ret = cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q)) !=
NET_XMIT_SUCCESS) {
if (net_xmit_drop_count(ret)) {
sch->qstats.drops++;
cl->qstats.drops++;
}
return ret;
} else
htb_activate(q, cl);
sch->q.qlen++;
sch->qstats.requeues++;
return NET_XMIT_SUCCESS;
}
/**
* htb_charge_class - charges amount "bytes" to leaf and ancestors
*
* Routine assumes that packet "bytes" long was dequeued from leaf cl
* borrowing from "level". It accounts bytes to ceil leaky bucket for
* leaf and all ancestors and to rate bucket for ancestors at levels
* "level" and higher. It also handles possible change of mode resulting
* from the update. Note that mode can also increase here (MAY_BORROW to
* CAN_SEND) because we can use more precise clock that event queue here.
* In such case we remove class from event queue first.
*/
static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
int level, struct sk_buff *skb)
{
int bytes = qdisc_pkt_len(skb);
long toks, diff;
enum htb_cmode old_mode;
#define HTB_ACCNT(T,B,R) toks = diff + cl->T; \
if (toks > cl->B) toks = cl->B; \
toks -= L2T(cl, cl->R, bytes); \
if (toks <= -cl->mbuffer) toks = 1-cl->mbuffer; \
cl->T = toks
while (cl) {
diff = <API key>(q->now, cl->t_c, cl->mbuffer);
if (cl->level >= level) {
if (cl->level == level)
cl->xstats.lends++;
HTB_ACCNT(tokens, buffer, rate);
} else {
cl->xstats.borrows++;
cl->tokens += diff; /* we moved t_c; update tokens */
}
HTB_ACCNT(ctokens, cbuffer, ceil);
cl->t_c = q->now;
old_mode = cl->cmode;
diff = 0;
<API key>(q, cl, &diff);
if (old_mode != cl->cmode) {
if (old_mode != HTB_CAN_SEND)
htb_safe_rb_erase(&cl->pq_node, q->wait_pq + cl->level);
if (cl->cmode != HTB_CAN_SEND)
<API key>(q, cl, diff);
}
/* update byte stats except for leaves which are already updated */
if (cl->level) {
cl->bstats.bytes += bytes;
cl->bstats.packets += skb_is_gso(skb)?
skb_shinfo(skb)->gso_segs:1;
}
cl = cl->parent;
}
}
/**
* htb_do_events - make mode changes to classes at the level
*
* Scans event queue for pending events and applies them. Returns time of
* next pending event (0 for no event in pq).
* Note: Applied are events whose have cl->pq_key <= q->now.
*/
static psched_time_t htb_do_events(struct htb_sched *q, int level)
{
/* don't run for longer than 2 jiffies; 2 is used instead of
1 to simplify things when jiffy is going to be incremented
too soon */
unsigned long stop_at = jiffies + 2;
while (time_before(jiffies, stop_at)) {
struct htb_class *cl;
long diff;
struct rb_node *p = rb_first(&q->wait_pq[level]);
if (!p)
return 0;
cl = rb_entry(p, struct htb_class, pq_node);
if (cl->pq_key > q->now)
return cl->pq_key;
htb_safe_rb_erase(p, q->wait_pq + level);
diff = <API key>(q->now, cl->t_c, cl->mbuffer);
<API key>(q, cl, &diff);
if (cl->cmode != HTB_CAN_SEND)
<API key>(q, cl, diff);
}
/* too much load - let's continue on next jiffie */
return q->now + <API key> / HZ;
}
/* Returns class->node+prio from id-tree where classe's id is >= id. NULL
is no such one exists. */
static struct rb_node *<API key>(int prio, struct rb_node *n,
u32 id)
{
struct rb_node *r = NULL;
while (n) {
struct htb_class *cl =
rb_entry(n, struct htb_class, node[prio]);
if (id == cl->common.classid)
return n;
if (id > cl->common.classid) {
n = n->rb_right;
} else {
r = n;
n = n->rb_left;
}
}
return r;
}
/**
* htb_lookup_leaf - returns next leaf class in DRR order
*
* Find leaf where current feed pointers points to.
*/
static struct htb_class *htb_lookup_leaf(struct rb_root *tree, int prio,
struct rb_node **pptr, u32 * pid)
{
int i;
struct {
struct rb_node *root;
struct rb_node **pptr;
u32 *pid;
} stk[TC_HTB_MAXDEPTH], *sp = stk;
WARN_ON(!tree->rb_node);
sp->root = tree->rb_node;
sp->pptr = pptr;
sp->pid = pid;
for (i = 0; i < 65535; i++) {
if (!*sp->pptr && *sp->pid) {
/* ptr was invalidated but id is valid - try to recover
the original or next ptr */
*sp->pptr =
<API key>(prio, sp->root, *sp->pid);
}
*sp->pid = 0; /* ptr is valid now so that remove this hint as it
can become out of date quickly */
if (!*sp->pptr) { /* we are at right end; rewind & go up */
*sp->pptr = sp->root;
while ((*sp->pptr)->rb_left)
*sp->pptr = (*sp->pptr)->rb_left;
if (sp > stk) {
sp
WARN_ON(!*sp->pptr);
if (!*sp->pptr)
return NULL;
htb_next_rb_node(sp->pptr);
}
} else {
struct htb_class *cl;
cl = rb_entry(*sp->pptr, struct htb_class, node[prio]);
if (!cl->level)
return cl;
(++sp)->root = cl->un.inner.feed[prio].rb_node;
sp->pptr = cl->un.inner.ptr + prio;
sp->pid = cl->un.inner.last_ptr_id + prio;
}
}
WARN_ON(1);
return NULL;
}
/* dequeues packet at given priority and level; call only if
you are sure that there is active class at prio/level */
static struct sk_buff *htb_dequeue_tree(struct htb_sched *q, int prio,
int level)
{
struct sk_buff *skb = NULL;
struct htb_class *cl, *start;
/* look initial class up in the row */
start = cl = htb_lookup_leaf(q->row[level] + prio, prio,
q->ptr[level] + prio,
q->last_ptr_id[level] + prio);
do {
next:
WARN_ON(!cl);
if (!cl)
return NULL;
/* class can be empty - it is unlikely but can be true if leaf
qdisc drops packets in enqueue routine or if someone used
graft operation on the leaf since last dequeue;
simply deactivate and skip such class */
if (unlikely(cl->un.leaf.q->q.qlen == 0)) {
struct htb_class *next;
htb_deactivate(q, cl);
/* row/level might become empty */
if ((q->row_mask[level] & (1 << prio)) == 0)
return NULL;
next = htb_lookup_leaf(q->row[level] + prio,
prio, q->ptr[level] + prio,
q->last_ptr_id[level] + prio);
if (cl == start) /* fix start if we just deleted it */
start = next;
cl = next;
goto next;
}
skb = cl->un.leaf.q->dequeue(cl->un.leaf.q);
if (likely(skb != NULL))
break;
if (!cl->warned) {
printk(KERN_WARNING
"htb: class %X isn't work conserving ?!\n",
cl->common.classid);
cl->warned = 1;
}
q->nwc_hit++;
htb_next_rb_node((level ? cl->parent->un.inner.ptr : q->
ptr[0]) + prio);
cl = htb_lookup_leaf(q->row[level] + prio, prio,
q->ptr[level] + prio,
q->last_ptr_id[level] + prio);
} while (cl != start);
if (likely(skb != NULL)) {
cl->un.leaf.deficit[level] -= qdisc_pkt_len(skb);
if (cl->un.leaf.deficit[level] < 0) {
cl->un.leaf.deficit[level] += cl->un.leaf.quantum;
htb_next_rb_node((level ? cl->parent->un.inner.ptr : q->
ptr[0]) + prio);
}
/* this used to be after charge_class but this constelation
gives us slightly better performance */
if (!cl->un.leaf.q->q.qlen)
htb_deactivate(q, cl);
htb_charge_class(q, cl, level, skb);
}
return skb;
}
static struct sk_buff *htb_dequeue(struct Qdisc *sch)
{
struct sk_buff *skb = NULL;
struct htb_sched *q = qdisc_priv(sch);
int level;
psched_time_t next_event;
/* try to dequeue direct packets as high prio (!) to minimize cpu work */
skb = __skb_dequeue(&q->direct_queue);
if (skb != NULL) {
sch->flags &= ~TCQ_F_THROTTLED;
sch->q.qlen
return skb;
}
if (!sch->q.qlen)
goto fin;
q->now = psched_get_time();
next_event = q->now + 5 * <API key>;
q->nwc_hit = 0;
for (level = 0; level < TC_HTB_MAXDEPTH; level++) {
/* common case optimization - skip event handler quickly */
int m;
psched_time_t event;
if (q->now >= q->near_ev_cache[level]) {
event = htb_do_events(q, level);
if (!event)
event = q->now + <API key>;
q->near_ev_cache[level] = event;
} else
event = q->near_ev_cache[level];
if (event && next_event > event)
next_event = event;
m = ~q->row_mask[level];
while (m != (int)(-1)) {
int prio = ffz(m);
m |= 1 << prio;
skb = htb_dequeue_tree(q, prio, level);
if (likely(skb != NULL)) {
sch->q.qlen
sch->flags &= ~TCQ_F_THROTTLED;
goto fin;
}
}
}
sch->qstats.overlimits++;
<API key>(&q->watchdog);
<API key>(&q->watchdog, next_event);
fin:
return skb;
}
/* try to drop from each class (by prio) until one succeed */
static unsigned int htb_drop(struct Qdisc *sch)
{
struct htb_sched *q = qdisc_priv(sch);
int prio;
for (prio = TC_HTB_NUMPRIO - 1; prio >= 0; prio
struct list_head *p;
list_for_each(p, q->drops + prio) {
struct htb_class *cl = list_entry(p, struct htb_class,
un.leaf.drop_list);
unsigned int len;
if (cl->un.leaf.q->ops->drop &&
(len = cl->un.leaf.q->ops->drop(cl->un.leaf.q))) {
sch->q.qlen
if (!cl->un.leaf.q->q.qlen)
htb_deactivate(q, cl);
return len;
}
}
}
return 0;
}
/* reset all classes */
/* always caled under BH & queue lock */
static void htb_reset(struct Qdisc *sch)
{
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl;
struct hlist_node *n;
unsigned int i;
for (i = 0; i < q->clhash.hashsize; i++) {
<API key>(cl, n, &q->clhash.hash[i], common.hnode) {
if (cl->level)
memset(&cl->un.inner, 0, sizeof(cl->un.inner));
else {
if (cl->un.leaf.q)
qdisc_reset(cl->un.leaf.q);
INIT_LIST_HEAD(&cl->un.leaf.drop_list);
}
cl->prio_activity = 0;
cl->cmode = HTB_CAN_SEND;
}
}
<API key>(&q->watchdog);
__skb_queue_purge(&q->direct_queue);
sch->q.qlen = 0;
memset(q->row, 0, sizeof(q->row));
memset(q->row_mask, 0, sizeof(q->row_mask));
memset(q->wait_pq, 0, sizeof(q->wait_pq));
memset(q->ptr, 0, sizeof(q->ptr));
for (i = 0; i < TC_HTB_NUMPRIO; i++)
INIT_LIST_HEAD(q->drops + i);
}
static const struct nla_policy htb_policy[TCA_HTB_MAX + 1] = {
[TCA_HTB_PARMS] = { .len = sizeof(struct tc_htb_opt) },
[TCA_HTB_INIT] = { .len = sizeof(struct tc_htb_glob) },
[TCA_HTB_CTAB] = { .type = NLA_BINARY, .len = TC_RTAB_SIZE },
[TCA_HTB_RTAB] = { .type = NLA_BINARY, .len = TC_RTAB_SIZE },
};
static int htb_init(struct Qdisc *sch, struct nlattr *opt)
{
struct htb_sched *q = qdisc_priv(sch);
struct nlattr *tb[TCA_HTB_INIT + 1];
struct tc_htb_glob *gopt;
int err;
int i;
if (!opt)
return -EINVAL;
err = nla_parse_nested(tb, TCA_HTB_INIT, opt, htb_policy);
if (err < 0)
return err;
if (tb[TCA_HTB_INIT] == NULL) {
printk(KERN_ERR "HTB: hey probably you have bad tc tool ?\n");
return -EINVAL;
}
gopt = nla_data(tb[TCA_HTB_INIT]);
if (gopt->version != HTB_VER >> 16) {
printk(KERN_ERR
"HTB: need tc/htb version %d (minor is %d), you have %d\n",
HTB_VER >> 16, HTB_VER & 0xffff, gopt->version);
return -EINVAL;
}
err = <API key>(&q->clhash);
if (err < 0)
return err;
for (i = 0; i < TC_HTB_NUMPRIO; i++)
INIT_LIST_HEAD(q->drops + i);
qdisc_watchdog_init(&q->watchdog, sch);
skb_queue_head_init(&q->direct_queue);
q->direct_qlen = qdisc_dev(sch)->tx_queue_len;
if (q->direct_qlen < 2) /* some devices have zero tx_queue_len */
q->direct_qlen = 2;
if ((q->rate2quantum = gopt->rate2quantum) < 1)
q->rate2quantum = 1;
q->defcls = gopt->defcls;
return 0;
}
static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
{
spinlock_t *root_lock = <API key>(sch);
struct htb_sched *q = qdisc_priv(sch);
struct nlattr *nest;
struct tc_htb_glob gopt;
spin_lock_bh(root_lock);
gopt.direct_pkts = q->direct_pkts;
gopt.version = HTB_VER;
gopt.rate2quantum = q->rate2quantum;
gopt.defcls = q->defcls;
gopt.debug = 0;
nest = nla_nest_start(skb, TCA_OPTIONS);
if (nest == NULL)
goto nla_put_failure;
NLA_PUT(skb, TCA_HTB_INIT, sizeof(gopt), &gopt);
nla_nest_end(skb, nest);
spin_unlock_bh(root_lock);
return skb->len;
nla_put_failure:
spin_unlock_bh(root_lock);
nla_nest_cancel(skb, nest);
return -1;
}
static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
struct sk_buff *skb, struct tcmsg *tcm)
{
struct htb_class *cl = (struct htb_class *)arg;
spinlock_t *root_lock = <API key>(sch);
struct nlattr *nest;
struct tc_htb_opt opt;
spin_lock_bh(root_lock);
tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT;
tcm->tcm_handle = cl->common.classid;
if (!cl->level && cl->un.leaf.q)
tcm->tcm_info = cl->un.leaf.q->handle;
nest = nla_nest_start(skb, TCA_OPTIONS);
if (nest == NULL)
goto nla_put_failure;
memset(&opt, 0, sizeof(opt));
opt.rate = cl->rate->rate;
opt.buffer = cl->buffer;
opt.ceil = cl->ceil->rate;
opt.cbuffer = cl->cbuffer;
opt.quantum = cl->un.leaf.quantum;
opt.prio = cl->un.leaf.prio;
opt.level = cl->level;
NLA_PUT(skb, TCA_HTB_PARMS, sizeof(opt), &opt);
nla_nest_end(skb, nest);
spin_unlock_bh(root_lock);
return skb->len;
nla_put_failure:
spin_unlock_bh(root_lock);
nla_nest_cancel(skb, nest);
return -1;
}
static int
<API key>(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d)
{
struct htb_class *cl = (struct htb_class *)arg;
if (!cl->level && cl->un.leaf.q)
cl->qstats.qlen = cl->un.leaf.q->q.qlen;
cl->xstats.tokens = cl->tokens;
cl->xstats.ctokens = cl->ctokens;
if (<API key>(d, &cl->bstats) < 0 ||
<API key>(d, &cl->rate_est) < 0 ||
<API key>(d, &cl->qstats) < 0)
return -1;
return gnet_stats_copy_app(d, &cl->xstats, sizeof(cl->xstats));
}
static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old)
{
struct htb_class *cl = (struct htb_class *)arg;
if (cl && !cl->level) {
if (new == NULL &&
(new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
&pfifo_qdisc_ops,
cl->common.classid))
== NULL)
return -ENOBUFS;
sch_tree_lock(sch);
if ((*old = xchg(&cl->un.leaf.q, new)) != NULL) {
<API key>(*old, (*old)->q.qlen);
qdisc_reset(*old);
}
sch_tree_unlock(sch);
return 0;
}
return -ENOENT;
}
static struct Qdisc *htb_leaf(struct Qdisc *sch, unsigned long arg)
{
struct htb_class *cl = (struct htb_class *)arg;
return (cl && !cl->level) ? cl->un.leaf.q : NULL;
}
static void htb_qlen_notify(struct Qdisc *sch, unsigned long arg)
{
struct htb_class *cl = (struct htb_class *)arg;
if (cl->un.leaf.q->q.qlen == 0)
htb_deactivate(qdisc_priv(sch), cl);
}
static unsigned long htb_get(struct Qdisc *sch, u32 classid)
{
struct htb_class *cl = htb_find(classid, sch);
if (cl)
cl->refcnt++;
return (unsigned long)cl;
}
static inline int <API key>(struct htb_class *cl)
{
if (!cl->parent)
/* the root class */
return 0;
if (cl->parent->children > 1)
/* not the last child */
return 0;
return 1;
}
static void htb_parent_to_leaf(struct htb_sched *q, struct htb_class *cl,
struct Qdisc *new_q)
{
struct htb_class *parent = cl->parent;
WARN_ON(cl->level || !cl->un.leaf.q || cl->prio_activity);
if (parent->cmode != HTB_CAN_SEND)
htb_safe_rb_erase(&parent->pq_node, q->wait_pq + parent->level);
parent->level = 0;
memset(&parent->un.inner, 0, sizeof(parent->un.inner));
INIT_LIST_HEAD(&parent->un.leaf.drop_list);
parent->un.leaf.q = new_q ? new_q : &noop_qdisc;
parent->un.leaf.quantum = parent->quantum;
parent->un.leaf.prio = parent->prio;
parent->tokens = parent->buffer;
parent->ctokens = parent->cbuffer;
parent->t_c = psched_get_time();
parent->cmode = HTB_CAN_SEND;
}
static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)
{
if (!cl->level) {
WARN_ON(!cl->un.leaf.q);
qdisc_destroy(cl->un.leaf.q);
}
gen_kill_estimator(&cl->bstats, &cl->rate_est);
qdisc_put_rtab(cl->rate);
qdisc_put_rtab(cl->ceil);
tcf_destroy_chain(&cl->filter_list);
kfree(cl);
}
/* always caled under BH & queue lock */
static void htb_destroy(struct Qdisc *sch)
{
struct htb_sched *q = qdisc_priv(sch);
struct hlist_node *n, *next;
struct htb_class *cl;
unsigned int i;
<API key>(&q->watchdog);
/* This line used to be after htb_destroy_class call below
and surprisingly it worked in 2.4. But it must precede it
because filter need its target class alive to be able to call
unbind_filter on it (without Oops). */
tcf_destroy_chain(&q->filter_list);
for (i = 0; i < q->clhash.hashsize; i++) {
<API key>(cl, n, &q->clhash.hash[i], common.hnode)
tcf_destroy_chain(&cl->filter_list);
}
for (i = 0; i < q->clhash.hashsize; i++) {
<API key>(cl, n, next, &q->clhash.hash[i],
common.hnode)
htb_destroy_class(sch, cl);
}
<API key>(&q->clhash);
__skb_queue_purge(&q->direct_queue);
}
static int htb_delete(struct Qdisc *sch, unsigned long arg)
{
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = (struct htb_class *)arg;
unsigned int qlen;
struct Qdisc *new_q = NULL;
int last_child = 0;
// TODO: why don't allow to delete subtree ? references ? does
// tc subsys quarantee us that in htb_destroy it holds no class
// refs so that we can remove children safely there ?
if (cl->children || cl->filter_cnt)
return -EBUSY;
if (!cl->level && <API key>(cl)) {
new_q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
&pfifo_qdisc_ops,
cl->parent->common.classid);
last_child = 1;
}
sch_tree_lock(sch);
if (!cl->level) {
qlen = cl->un.leaf.q->q.qlen;
qdisc_reset(cl->un.leaf.q);
<API key>(cl->un.leaf.q, qlen);
}
/* delete from hash and active; remainder in destroy_class */
<API key>(&q->clhash, &cl->common);
if (cl->parent)
cl->parent->children
if (cl->prio_activity)
htb_deactivate(q, cl);
if (cl->cmode != HTB_CAN_SEND)
htb_safe_rb_erase(&cl->pq_node, q->wait_pq + cl->level);
if (last_child)
htb_parent_to_leaf(q, cl, new_q);
if (--cl->refcnt == 0)
htb_destroy_class(sch, cl);
sch_tree_unlock(sch);
return 0;
}
static void htb_put(struct Qdisc *sch, unsigned long arg)
{
struct htb_class *cl = (struct htb_class *)arg;
if (--cl->refcnt == 0)
htb_destroy_class(sch, cl);
}
static int htb_change_class(struct Qdisc *sch, u32 classid,
u32 parentid, struct nlattr **tca,
unsigned long *arg)
{
int err = -EINVAL;
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = (struct htb_class *)*arg, *parent;
struct nlattr *opt = tca[TCA_OPTIONS];
struct qdisc_rate_table *rtab = NULL, *ctab = NULL;
struct nlattr *tb[TCA_HTB_RTAB + 1];
struct tc_htb_opt *hopt;
/* extract all subattrs from opt attr */
if (!opt)
goto failure;
err = nla_parse_nested(tb, TCA_HTB_RTAB, opt, htb_policy);
if (err < 0)
goto failure;
err = -EINVAL;
if (tb[TCA_HTB_PARMS] == NULL)
goto failure;
parent = parentid == TC_H_ROOT ? NULL : htb_find(parentid, sch);
hopt = nla_data(tb[TCA_HTB_PARMS]);
rtab = qdisc_get_rtab(&hopt->rate, tb[TCA_HTB_RTAB]);
ctab = qdisc_get_rtab(&hopt->ceil, tb[TCA_HTB_CTAB]);
if (!rtab || !ctab)
goto failure;
if (!cl) { /* new class */
struct Qdisc *new_q;
int prio;
struct {
struct nlattr nla;
struct gnet_estimator opt;
} est = {
.nla = {
.nla_len = nla_attr_size(sizeof(est.opt)),
.nla_type = TCA_RATE,
},
.opt = {
/* 4s interval, 16s averaging constant */
.interval = 2,
.ewma_log = 2,
},
};
/* check for valid classid */
if (!classid || TC_H_MAJ(classid ^ sch->handle)
|| htb_find(classid, sch))
goto failure;
/* check maximal depth */
if (parent && parent->parent && parent->parent->level < 2) {
printk(KERN_ERR "htb: tree is too deep\n");
goto failure;
}
err = -ENOBUFS;
if ((cl = kzalloc(sizeof(*cl), GFP_KERNEL)) == NULL)
goto failure;
gen_new_estimator(&cl->bstats, &cl->rate_est,
<API key>(sch),
tca[TCA_RATE] ? : &est.nla);
cl->refcnt = 1;
cl->children = 0;
INIT_LIST_HEAD(&cl->un.leaf.drop_list);
RB_CLEAR_NODE(&cl->pq_node);
for (prio = 0; prio < TC_HTB_NUMPRIO; prio++)
RB_CLEAR_NODE(&cl->node[prio]);
/* create leaf qdisc early because it uses kmalloc(GFP_KERNEL)
so that can't be used inside of sch_tree_lock
-- thanks to Karlis Peisenieks */
new_q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
&pfifo_qdisc_ops, classid);
sch_tree_lock(sch);
if (parent && !parent->level) {
unsigned int qlen = parent->un.leaf.q->q.qlen;
/* turn parent into inner node */
qdisc_reset(parent->un.leaf.q);
<API key>(parent->un.leaf.q, qlen);
qdisc_destroy(parent->un.leaf.q);
if (parent->prio_activity)
htb_deactivate(q, parent);
/* remove from evt list because of level change */
if (parent->cmode != HTB_CAN_SEND) {
htb_safe_rb_erase(&parent->pq_node, q->wait_pq);
parent->cmode = HTB_CAN_SEND;
}
parent->level = (parent->parent ? parent->parent->level
: TC_HTB_MAXDEPTH) - 1;
memset(&parent->un.inner, 0, sizeof(parent->un.inner));
}
/* leaf (we) needs elementary qdisc */
cl->un.leaf.q = new_q ? new_q : &noop_qdisc;
cl->common.classid = classid;
cl->parent = parent;
/* set class to be in HTB_CAN_SEND state */
cl->tokens = hopt->buffer;
cl->ctokens = hopt->cbuffer;
cl->mbuffer = 60 * <API key>; /* 1min */
cl->t_c = psched_get_time();
cl->cmode = HTB_CAN_SEND;
/* attach to the hash list and parent's family */
<API key>(&q->clhash, &cl->common);
if (parent)
parent->children++;
} else {
if (tca[TCA_RATE])
<API key>(&cl->bstats, &cl->rate_est,
<API key>(sch),
tca[TCA_RATE]);
sch_tree_lock(sch);
}
/* it used to be a nasty bug here, we have to check that node
is really leaf before changing cl->un.leaf ! */
if (!cl->level) {
cl->un.leaf.quantum = rtab->rate.rate / q->rate2quantum;
if (!hopt->quantum && cl->un.leaf.quantum < 1000) {
printk(KERN_WARNING
"HTB: quantum of class %X is small. Consider r2q change.\n",
cl->common.classid);
cl->un.leaf.quantum = 1000;
}
if (!hopt->quantum && cl->un.leaf.quantum > 200000) {
printk(KERN_WARNING
"HTB: quantum of class %X is big. Consider r2q change.\n",
cl->common.classid);
cl->un.leaf.quantum = 200000;
}
if (hopt->quantum)
cl->un.leaf.quantum = hopt->quantum;
if ((cl->un.leaf.prio = hopt->prio) >= TC_HTB_NUMPRIO)
cl->un.leaf.prio = TC_HTB_NUMPRIO - 1;
/* backup for htb_parent_to_leaf */
cl->quantum = cl->un.leaf.quantum;
cl->prio = cl->un.leaf.prio;
}
cl->buffer = hopt->buffer;
cl->cbuffer = hopt->cbuffer;
if (cl->rate)
qdisc_put_rtab(cl->rate);
cl->rate = rtab;
if (cl->ceil)
qdisc_put_rtab(cl->ceil);
cl->ceil = ctab;
sch_tree_unlock(sch);
<API key>(sch, &q->clhash);
*arg = (unsigned long)cl;
return 0;
failure:
if (rtab)
qdisc_put_rtab(rtab);
if (ctab)
qdisc_put_rtab(ctab);
return err;
}
static struct tcf_proto **htb_find_tcf(struct Qdisc *sch, unsigned long arg)
{
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl = (struct htb_class *)arg;
struct tcf_proto **fl = cl ? &cl->filter_list : &q->filter_list;
return fl;
}
static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent,
u32 classid)
{
struct htb_class *cl = htb_find(classid, sch);
/*if (cl && !cl->level) return 0;
The line above used to be there to prevent attaching filters to
leaves. But at least tc_index filter uses this just to get class
for other reasons so that we have to allow for it.
-
19.6.2002 As Werner explained it is ok - bind filter is just
another way to "lock" the class - unlike "get" this lock can
be broken by class during destroy IIUC.
*/
if (cl)
cl->filter_cnt++;
return (unsigned long)cl;
}
static void htb_unbind_filter(struct Qdisc *sch, unsigned long arg)
{
struct htb_class *cl = (struct htb_class *)arg;
if (cl)
cl->filter_cnt
}
static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)
{
struct htb_sched *q = qdisc_priv(sch);
struct htb_class *cl;
struct hlist_node *n;
unsigned int i;
if (arg->stop)
return;
for (i = 0; i < q->clhash.hashsize; i++) {
<API key>(cl, n, &q->clhash.hash[i], common.hnode) {
if (arg->count < arg->skip) {
arg->count++;
continue;
}
if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
arg->stop = 1;
return;
}
arg->count++;
}
}
}
static const struct Qdisc_class_ops htb_class_ops = {
.graft = htb_graft,
.leaf = htb_leaf,
.qlen_notify = htb_qlen_notify,
.get = htb_get,
.put = htb_put,
.change = htb_change_class,
.delete = htb_delete,
.walk = htb_walk,
.tcf_chain = htb_find_tcf,
.bind_tcf = htb_bind_filter,
.unbind_tcf = htb_unbind_filter,
.dump = htb_dump_class,
.dump_stats = <API key>,
};
static struct Qdisc_ops htb_qdisc_ops __read_mostly = {
.next = NULL,
.cl_ops = &htb_class_ops,
.id = "htb",
.priv_size = sizeof(struct htb_sched),
.enqueue = htb_enqueue,
.dequeue = htb_dequeue,
.requeue = htb_requeue,
.drop = htb_drop,
.init = htb_init,
.reset = htb_reset,
.destroy = htb_destroy,
.change = NULL /* htb_change */,
.dump = htb_dump,
.owner = THIS_MODULE,
};
static int __init htb_module_init(void)
{
return register_qdisc(&htb_qdisc_ops);
}
static void __exit htb_module_exit(void)
{
unregister_qdisc(&htb_qdisc_ops);
}
module_init(htb_module_init)
module_exit(htb_module_exit)
MODULE_LICENSE("GPL"); |
#ifndef PRE_LEXER_H
#define PRE_LEXER_H
#include <glib.h>
/* Structure to store lexer state. */
typedef struct
{
gchar* stream; /* Pointer to the local copy of input string. */
guint length; /* Length of input string; stored to reduce calls to strlen(). */
guint next_index; /* Index of next (to be read) character from input. */
guint mark_index; /* Location, last marked. Useful for getting substrings as part of highlighting */
} PreLexerState;
/* Enum for tokens generated by pre-lexer and lexer. */
typedef enum
{
T_UNKNOWN=0, //Unknown
/* These are all Pre-Lexer tokens, returned by pre-lexer */
PL_DECIMAL, //Decimal saperator
PL_DIGIT, //Decimal digit
PL_HEX, //A-F of Hex digits
PL_SUPER_DIGIT, //Super digits
PL_SUPER_MINUS, //Super minus
PL_SUB_DIGIT, //Sub digits
PL_FRACTION, //Fractions
PL_DEGREE, //Degree
PL_MINUTE, //Minutes
PL_SECOND, //10 //Seconds
PL_LETTER, //Alphabets
PL_EOS, //End of stream. Yay!!
PL_SKIP, //Skip this symbol (whitespace or newline).
/* These are all tokens, returned by Lexer. */
T_ADD, //Plus
T_SUBTRACT, //Minus
T_MULTIPLY, //Multiply
T_DIV, //Divide (note can't use T_DIVIDE as it is defined in *BSD as an "integer divide fault" trap type value)
T_MOD, //Modulus
T_L_FLOOR, //Floor ( Left )
T_R_FLOOR, //20 //Floor ( Right )
T_L_CEILING, //Ceiling ( Left )
T_R_CEILING, //Ceiling ( Right )
T_ROOT, //Square root
T_ROOT_3, //Cube root
T_ROOT_4, //Fourth root
T_NOT, //Bitwise NOT
T_AND, //Bitwise AND
T_OR, //Bitwise OR
T_XOR, //Bitwise XOR
T_IN, //30 //IN ( for converter )
T_NUMBER, //Number
T_SUP_NUMBER, //Super Number
T_NSUP_NUMBER, //Negative Super Number
T_SUB_NUMBER, //Sub Number
T_FUNCTION, //Function
T_VARIABLE, //Variable name
T_ASSIGN,
T_L_R_BRACKET,
T_R_R_BRACKET,
T_L_S_BRACKET,
T_R_S_BRACKET,
T_L_C_BRACKET,
T_R_C_BRACKET,
T_ABS,
T_POWER,
T_FACTORIAL,
T_PERCENTAGE
} LexerTokenType;
/* Creates a scanner state. Useful when multiple scanners are in action. */
PreLexerState* pl_create_scanner(const gchar*);
/* Destroy and free memory used by LexerState object. */
void pl_destroy_scanner(PreLexerState*);
/* Roll back last scanned unichar. */
void pl_roll_back(PreLexerState*);
/* Get validated gunichar from input stream. */
gunichar <API key>(PreLexerState*);
/* Set marker index. To be used for highlighting and error reporting. */
void pl_set_marker(PreLexerState*);
/* Get marked substring. To be used for error reporting. */
gchar* <API key>(const PreLexerState*);
/* Get next Pre-Lexer token from stream. */
LexerTokenType pl_get_next_token(PreLexerState*);
#endif /* PRE_LEXER_H */ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.