answer stringlengths 15 1.25M |
|---|
var assert = require('assert')
var UINT32 = require('..').UINT32
describe('UINT32 constructor', function () {
describe('with no parameters', function () {
it('should properly initialize', function (done) {
var u = UINT32()
assert.equal( u._low, 0 )
assert.equal( u._high, 0 )
done()
})
})
describe('with low and high bits', function () {
describe('0, 0', function () {
it('should properly initialize', function (done) {
var u = UINT32(0, 0)
assert.equal( u._low, 0 )
assert.equal( u._high, 0 )
done()
})
})
describe('1, 0', function () {
it('should properly initialize', function (done) {
var u = UINT32(1, 0)
assert.equal( u._low, 1 )
assert.equal( u._high, 0 )
done()
})
})
describe('0, 1', function () {
it('should properly initialize', function (done) {
var u = UINT32(0, 1)
assert.equal( u._low, 0 )
assert.equal( u._high, 1 )
done()
})
})
describe('3, 5', function () {
it('should properly initialize', function (done) {
var u = UINT32(3, 5)
assert.equal( u._low, 3 )
assert.equal( u._high, 5 )
done()
})
})
})
describe('with number', function () {
describe('0', function () {
it('should properly initialize', function (done) {
var u = UINT32(0)
assert.equal( u._low, 0 )
assert.equal( u._high, 0 )
done()
})
})
describe('1', function () {
it('should properly initialize', function (done) {
var u = UINT32(1)
assert.equal( u._low, 1 )
assert.equal( u._high, 0 )
done()
})
})
describe('3', function () {
it('should properly initialize', function (done) {
var u = UINT32(3)
assert.equal( u._low, 3 )
assert.equal( u._high, 0 )
done()
})
})
describe('with high bit', function () {
it('should properly initialize', function (done) {
var u = UINT32( Math.pow(2,17)+123 )
assert.equal( u._low, 123 )
assert.equal( u._high, 2 )
done()
})
})
})
describe('with string', function () {
describe('"0"', function () {
it('should properly initialize', function (done) {
var u = UINT32('0')
assert.equal( u._low, 0 )
assert.equal( u._high, 0 )
done()
})
})
describe('"1"', function () {
it('should properly initialize', function (done) {
var u = UINT32('1')
assert.equal( u._low, 1 )
assert.equal( u._high, 0 )
done()
})
})
describe('10', function () {
it('should properly initialize', function (done) {
var u = UINT32('10')
assert.equal( u._low, 10 )
assert.equal( u._high, 0 )
done()
})
})
describe('with high bit', function () {
it('should properly initialize', function (done) {
var u = UINT32( '' + (Math.pow(2,17)+123) )
assert.equal( u._low, 123 )
assert.equal( u._high, 2 )
done()
})
})
describe('with radix 10', function () {
it('should properly initialize', function (done) {
var u = UINT32( '123', 10 )
assert.equal( u._low, 123 )
assert.equal( u._high, 0 )
done()
})
})
describe('with radix 2', function () {
it('should properly initialize', function (done) {
var u = UINT32( '1111011', 2 )
assert.equal( u._low, 123 )
assert.equal( u._high, 0 )
done()
})
})
describe('with radix 16', function () {
it('should properly initialize', function (done) {
var u = UINT32( '7B', 16 )
assert.equal( u._low, 123 )
assert.equal( u._high, 0 )
done()
})
})
describe('8000 with radix 16', function () {
it('should properly initialize', function (done) {
var u = UINT32( '8000', 16 )
assert.equal( u._low, 32768 )
assert.equal( u._high, 0 )
done()
})
})
describe('80000000 with radix 16', function () {
it('should properly initialize', function (done) {
var u = UINT32( '80000000', 16 )
assert.equal( u._low, 0 )
assert.equal( u._high, 32768 )
done()
})
})
describe('maximum unsigned 32 bits value in base 2', function () {
it('should properly initialize', function (done) {
var u = UINT32( Array(33).join('1'), 2 )
assert.equal( u._low, 65535 )
assert.equal( u._high, 65535 )
done()
})
})
describe('maximum unsigned 32 bits value in base 16', function () {
it('should properly initialize', function (done) {
var u = UINT32( Array(9).join('F'), 16 )
assert.equal( u._low, 65535 )
assert.equal( u._high, 65535 )
done()
})
})
})
}) |
// <API key>: GPL-2.0+
// wm831x-ldo.c -- LDO driver for the WM831x series
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/slab.h>
#include <linux/mfd/wm831x/core.h>
#include <linux/mfd/wm831x/regulator.h>
#include <linux/mfd/wm831x/pdata.h>
#define WM831X_LDO_MAX_NAME 9
#define WM831X_LDO_CONTROL 0
#define <API key> 1
#define <API key> 2
#define <API key> 0
#define <API key> 1
struct wm831x_ldo {
char name[WM831X_LDO_MAX_NAME];
char supply_name[WM831X_LDO_MAX_NAME];
struct regulator_desc desc;
int base;
struct wm831x *wm831x;
struct regulator_dev *regulator;
};
/*
* Shared
*/
static irqreturn_t wm831x_ldo_uv_irq(int irq, void *data)
{
struct wm831x_ldo *ldo = data;
regulator_lock(ldo->regulator);
<API key>(ldo->regulator,
<API key>,
NULL);
regulator_unlock(ldo->regulator);
return IRQ_HANDLED;
}
/*
* General purpose LDOs
*/
static const struct <API key> <API key>[] = {
<API key>(900000, 0, 14, 50000),
<API key>(1700000, 15, 31, 100000),
};
static int <API key>(struct regulator_dev *rdev,
int uV)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int sel, reg = ldo->base + <API key>;
sel = <API key>(rdev, uV, uV);
if (sel < 0)
return sel;
return wm831x_set_bits(wm831x, reg, <API key>, sel);
}
static unsigned int <API key>(struct regulator_dev *rdev)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int ctrl_reg = ldo->base + WM831X_LDO_CONTROL;
int on_reg = ldo->base + <API key>;
int ret;
ret = wm831x_reg_read(wm831x, on_reg);
if (ret < 0)
return ret;
if (!(ret & WM831X_LDO1_ON_MODE))
return <API key>;
ret = wm831x_reg_read(wm831x, ctrl_reg);
if (ret < 0)
return ret;
if (ret & WM831X_LDO1_LP_MODE)
return <API key>;
else
return REGULATOR_MODE_IDLE;
}
static int <API key>(struct regulator_dev *rdev,
unsigned int mode)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int ctrl_reg = ldo->base + WM831X_LDO_CONTROL;
int on_reg = ldo->base + <API key>;
int ret;
switch (mode) {
case <API key>:
ret = wm831x_set_bits(wm831x, on_reg,
WM831X_LDO1_ON_MODE, 0);
if (ret < 0)
return ret;
break;
case REGULATOR_MODE_IDLE:
ret = wm831x_set_bits(wm831x, ctrl_reg,
WM831X_LDO1_LP_MODE, 0);
if (ret < 0)
return ret;
ret = wm831x_set_bits(wm831x, on_reg,
WM831X_LDO1_ON_MODE,
WM831X_LDO1_ON_MODE);
if (ret < 0)
return ret;
break;
case <API key>:
ret = wm831x_set_bits(wm831x, ctrl_reg,
WM831X_LDO1_LP_MODE,
WM831X_LDO1_LP_MODE);
if (ret < 0)
return ret;
ret = wm831x_set_bits(wm831x, on_reg,
WM831X_LDO1_ON_MODE,
WM831X_LDO1_ON_MODE);
if (ret < 0)
return ret;
break;
default:
return -EINVAL;
}
return 0;
}
static int <API key>(struct regulator_dev *rdev)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int mask = 1 << rdev_get_id(rdev);
int ret;
/* Is the regulator on? */
ret = wm831x_reg_read(wm831x, WM831X_LDO_STATUS);
if (ret < 0)
return ret;
if (!(ret & mask))
return <API key>;
/* Is it reporting under voltage? */
ret = wm831x_reg_read(wm831x, <API key>);
if (ret < 0)
return ret;
if (ret & mask)
return <API key>;
ret = <API key>(rdev);
if (ret < 0)
return ret;
else
return <API key>(ret);
}
static unsigned int <API key>(struct regulator_dev *rdev,
int input_uV,
int output_uV, int load_uA)
{
if (load_uA < 20000)
return <API key>;
if (load_uA < 50000)
return REGULATOR_MODE_IDLE;
return <API key>;
}
static const struct regulator_ops wm831x_gp_ldo_ops = {
.list_voltage = <API key>,
.map_voltage = <API key>,
.get_voltage_sel = <API key>,
.set_voltage_sel = <API key>,
.set_suspend_voltage = <API key>,
.get_mode = <API key>,
.set_mode = <API key>,
.get_status = <API key>,
.get_optimum_mode = <API key>,
.get_bypass = <API key>,
.set_bypass = <API key>,
.is_enabled = <API key>,
.enable = <API key>,
.disable = <API key>,
};
static int wm831x_gp_ldo_probe(struct platform_device *pdev)
{
struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
struct regulator_config config = { };
int id;
struct wm831x_ldo *ldo;
struct resource *res;
int ret, irq;
if (pdata && pdata->wm831x_num)
id = (pdata->wm831x_num * 10) + 1;
else
id = 0;
id = pdev->id - id;
dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1);
ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
if (!ldo)
return -ENOMEM;
ldo->wm831x = wm831x;
res = <API key>(pdev, IORESOURCE_REG, 0);
if (res == NULL) {
dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL;
goto err;
}
ldo->base = res->start;
snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
ldo->desc.name = ldo->name;
snprintf(ldo->supply_name, sizeof(ldo->supply_name),
"LDO%dVDD", id + 1);
ldo->desc.supply_name = ldo->supply_name;
ldo->desc.id = id;
ldo->desc.type = REGULATOR_VOLTAGE;
ldo->desc.n_voltages = 32;
ldo->desc.ops = &wm831x_gp_ldo_ops;
ldo->desc.owner = THIS_MODULE;
ldo->desc.vsel_reg = ldo->base + <API key>;
ldo->desc.vsel_mask = <API key>;
ldo->desc.enable_reg = WM831X_LDO_ENABLE;
ldo->desc.enable_mask = 1 << id;
ldo->desc.bypass_reg = ldo->base;
ldo->desc.bypass_mask = WM831X_LDO1_SWI;
ldo->desc.linear_ranges = <API key>;
ldo->desc.n_linear_ranges = ARRAY_SIZE(<API key>);
config.dev = pdev->dev.parent;
if (pdata)
config.init_data = pdata->ldo[id];
config.driver_data = ldo;
config.regmap = wm831x->regmap;
ldo->regulator = <API key>(&pdev->dev, &ldo->desc,
&config);
if (IS_ERR(ldo->regulator)) {
ret = PTR_ERR(ldo->regulator);
dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
id + 1, ret);
goto err;
}
irq = wm831x_irq(wm831x, <API key>(pdev, "UV"));
ret = <API key>(&pdev->dev, irq, NULL,
wm831x_ldo_uv_irq,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
ldo->name,
ldo);
if (ret != 0) {
dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
irq, ret);
goto err;
}
<API key>(pdev, ldo);
return 0;
err:
return ret;
}
static struct platform_driver <API key> = {
.probe = wm831x_gp_ldo_probe,
.driver = {
.name = "wm831x-ldo",
},
};
/*
* Analogue LDOs
*/
static const struct <API key> wm831x_aldo_ranges[] = {
<API key>(1000000, 0, 12, 50000),
<API key>(1700000, 13, 31, 100000),
};
static int <API key>(struct regulator_dev *rdev,
int uV)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int sel, reg = ldo->base + <API key>;
sel = <API key>(rdev, uV, uV);
if (sel < 0)
return sel;
return wm831x_set_bits(wm831x, reg, <API key>, sel);
}
static unsigned int <API key>(struct regulator_dev *rdev)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int on_reg = ldo->base + <API key>;
int ret;
ret = wm831x_reg_read(wm831x, on_reg);
if (ret < 0)
return 0;
if (ret & WM831X_LDO7_ON_MODE)
return REGULATOR_MODE_IDLE;
else
return <API key>;
}
static int <API key>(struct regulator_dev *rdev,
unsigned int mode)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int on_reg = ldo->base + <API key>;
int ret;
switch (mode) {
case <API key>:
ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE, 0);
if (ret < 0)
return ret;
break;
case REGULATOR_MODE_IDLE:
ret = wm831x_set_bits(wm831x, on_reg, WM831X_LDO7_ON_MODE,
WM831X_LDO7_ON_MODE);
if (ret < 0)
return ret;
break;
default:
return -EINVAL;
}
return 0;
}
static int <API key>(struct regulator_dev *rdev)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int mask = 1 << rdev_get_id(rdev);
int ret;
/* Is the regulator on? */
ret = wm831x_reg_read(wm831x, WM831X_LDO_STATUS);
if (ret < 0)
return ret;
if (!(ret & mask))
return <API key>;
/* Is it reporting under voltage? */
ret = wm831x_reg_read(wm831x, <API key>);
if (ret < 0)
return ret;
if (ret & mask)
return <API key>;
ret = <API key>(rdev);
if (ret < 0)
return ret;
else
return <API key>(ret);
}
static const struct regulator_ops wm831x_aldo_ops = {
.list_voltage = <API key>,
.map_voltage = <API key>,
.get_voltage_sel = <API key>,
.set_voltage_sel = <API key>,
.set_suspend_voltage = <API key>,
.get_mode = <API key>,
.set_mode = <API key>,
.get_status = <API key>,
.set_bypass = <API key>,
.get_bypass = <API key>,
.is_enabled = <API key>,
.enable = <API key>,
.disable = <API key>,
};
static int wm831x_aldo_probe(struct platform_device *pdev)
{
struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
struct regulator_config config = { };
int id;
struct wm831x_ldo *ldo;
struct resource *res;
int ret, irq;
if (pdata && pdata->wm831x_num)
id = (pdata->wm831x_num * 10) + 1;
else
id = 0;
id = pdev->id - id;
dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1);
ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
if (!ldo)
return -ENOMEM;
ldo->wm831x = wm831x;
res = <API key>(pdev, IORESOURCE_REG, 0);
if (res == NULL) {
dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL;
goto err;
}
ldo->base = res->start;
snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
ldo->desc.name = ldo->name;
snprintf(ldo->supply_name, sizeof(ldo->supply_name),
"LDO%dVDD", id + 1);
ldo->desc.supply_name = ldo->supply_name;
ldo->desc.id = id;
ldo->desc.type = REGULATOR_VOLTAGE;
ldo->desc.n_voltages = 32;
ldo->desc.linear_ranges = wm831x_aldo_ranges;
ldo->desc.n_linear_ranges = ARRAY_SIZE(wm831x_aldo_ranges);
ldo->desc.ops = &wm831x_aldo_ops;
ldo->desc.owner = THIS_MODULE;
ldo->desc.vsel_reg = ldo->base + <API key>;
ldo->desc.vsel_mask = <API key>;
ldo->desc.enable_reg = WM831X_LDO_ENABLE;
ldo->desc.enable_mask = 1 << id;
ldo->desc.bypass_reg = ldo->base;
ldo->desc.bypass_mask = WM831X_LDO7_SWI;
config.dev = pdev->dev.parent;
if (pdata)
config.init_data = pdata->ldo[id];
config.driver_data = ldo;
config.regmap = wm831x->regmap;
ldo->regulator = <API key>(&pdev->dev, &ldo->desc,
&config);
if (IS_ERR(ldo->regulator)) {
ret = PTR_ERR(ldo->regulator);
dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
id + 1, ret);
goto err;
}
irq = wm831x_irq(wm831x, <API key>(pdev, "UV"));
ret = <API key>(&pdev->dev, irq, NULL,
wm831x_ldo_uv_irq,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
ldo->name, ldo);
if (ret != 0) {
dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
irq, ret);
goto err;
}
<API key>(pdev, ldo);
return 0;
err:
return ret;
}
static struct platform_driver wm831x_aldo_driver = {
.probe = wm831x_aldo_probe,
.driver = {
.name = "wm831x-aldo",
},
};
/*
* Alive LDO
*/
#define <API key> 0xf
static int <API key>(struct regulator_dev *rdev,
int uV)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int sel, reg = ldo->base + <API key>;
sel = <API key>(rdev, uV, uV);
if (sel < 0)
return sel;
return wm831x_set_bits(wm831x, reg, <API key>, sel);
}
static int <API key>(struct regulator_dev *rdev)
{
struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
struct wm831x *wm831x = ldo->wm831x;
int mask = 1 << rdev_get_id(rdev);
int ret;
/* Is the regulator on? */
ret = wm831x_reg_read(wm831x, WM831X_LDO_STATUS);
if (ret < 0)
return ret;
if (ret & mask)
return REGULATOR_STATUS_ON;
else
return <API key>;
}
static const struct regulator_ops <API key> = {
.list_voltage = <API key>,
.map_voltage = <API key>,
.get_voltage_sel = <API key>,
.set_voltage_sel = <API key>,
.set_suspend_voltage = <API key>,
.get_status = <API key>,
.is_enabled = <API key>,
.enable = <API key>,
.disable = <API key>,
};
static int <API key>(struct platform_device *pdev)
{
struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
struct regulator_config config = { };
int id;
struct wm831x_ldo *ldo;
struct resource *res;
int ret;
if (pdata && pdata->wm831x_num)
id = (pdata->wm831x_num * 10) + 1;
else
id = 0;
id = pdev->id - id;
dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1);
ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
if (!ldo)
return -ENOMEM;
ldo->wm831x = wm831x;
res = <API key>(pdev, IORESOURCE_REG, 0);
if (res == NULL) {
dev_err(&pdev->dev, "No REG resource\n");
ret = -EINVAL;
goto err;
}
ldo->base = res->start;
snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1);
ldo->desc.name = ldo->name;
snprintf(ldo->supply_name, sizeof(ldo->supply_name),
"LDO%dVDD", id + 1);
ldo->desc.supply_name = ldo->supply_name;
ldo->desc.id = id;
ldo->desc.type = REGULATOR_VOLTAGE;
ldo->desc.n_voltages = <API key> + 1;
ldo->desc.ops = &<API key>;
ldo->desc.owner = THIS_MODULE;
ldo->desc.vsel_reg = ldo->base + <API key>;
ldo->desc.vsel_mask = <API key>;
ldo->desc.enable_reg = WM831X_LDO_ENABLE;
ldo->desc.enable_mask = 1 << id;
ldo->desc.min_uV = 800000;
ldo->desc.uV_step = 50000;
ldo->desc.enable_time = 1000;
config.dev = pdev->dev.parent;
if (pdata)
config.init_data = pdata->ldo[id];
config.driver_data = ldo;
config.regmap = wm831x->regmap;
ldo->regulator = <API key>(&pdev->dev, &ldo->desc,
&config);
if (IS_ERR(ldo->regulator)) {
ret = PTR_ERR(ldo->regulator);
dev_err(wm831x->dev, "Failed to register LDO%d: %d\n",
id + 1, ret);
goto err;
}
<API key>(pdev, ldo);
return 0;
err:
return ret;
}
static struct platform_driver <API key> = {
.probe = <API key>,
.driver = {
.name = "wm831x-alive-ldo",
},
};
static struct platform_driver * const drivers[] = {
&<API key>,
&wm831x_aldo_driver,
&<API key>,
};
static int __init wm831x_ldo_init(void)
{
return <API key>(drivers, ARRAY_SIZE(drivers));
}
subsys_initcall(wm831x_ldo_init);
static void __exit wm831x_ldo_exit(void)
{
<API key>(drivers, ARRAY_SIZE(drivers));
}
module_exit(wm831x_ldo_exit);
/* Module information */
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("WM831x LDO driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:wm831x-ldo");
MODULE_ALIAS("platform:wm831x-aldo");
MODULE_ALIAS("platform:wm831x-aliveldo"); |
YUI.add('recordset-base', function (Y, NAME) {
/**
* Provides a wrapper around a standard javascript object. Can be inserted into a Recordset instance.
*
* @class Record
*/
var Record = Y.Base.create('record', Y.Base, [], {
_setId: function() {
return Y.guid();
},
initializer: function() {
},
destructor: function() {
},
/**
* Retrieve a particular (or all) values from the object
*
* @param field {string} (optional) The key to retrieve the value from. If not supplied, the entire object is returned.
* @method getValue
* @public
*/
getValue: function(field) {
if (field === undefined) {
return this.get("data");
}
else {
return this.get("data")[field];
}
return null;
}
},
{
ATTRS: {
/**
* @description Unique ID of the record instance
* @attribute id
* @type string
*/
id: {
valueFn: "_setId"
},
/**
* @description The object stored within the record instance
* @attribute data
* @type object
*/
data: {
value: null
}
}
});
Y.Record = Record;
/**
The Recordset utility provides a standard way for dealing with
a collection of similar objects.
@module recordset
@main recordset
@submodule recordset-base
**/
var ArrayList = Y.ArrayList,
Lang = Y.Lang,
/**
The Recordset utility provides a standard way for dealing with
a collection of similar objects.
Provides the base Recordset implementation, which can be extended to add
additional functionality, such as custom indexing. sorting, and filtering.
@class Recordset
@extends Base
@uses ArrayList
@param config {Object} Configuration object with initial attribute values
@constructor
**/
Recordset = Y.Base.create('recordset', Y.Base, [], {
/**
* Publish default functions for events. Create the initial hash table.
*
* @method initializer
* @protected
*/
initializer: function() {
// The reason the conditional is needed is because of two scenarios:
// 1. Instantiating new Y.Recordset() will not go into the setter of "records", and so it is necessary to create this._items in the initializer.
// 2. Instantiating new Y.Recordset({records: [{...}]}) will call the setter of "records" and create this._items. In this case, we don't want that to be overwritten by [].
if (!this._items) {
this._items = [];
}
//set up event listener to fire events when recordset is modified in anyway
this.publish({
/**
* <p>At least one record is being added. Additional properties of
* the event are:</p>
* <dl>
* <dt>added</dt>
* <dd>Array of new records to be added</dd>
* <dt>index</dt>
* <dd>The insertion index in the Recordset's internal
* array</dd>
* </dl>
*
* <p>Preventing this event will cause the new records NOT to be
* added to the Recordset's internal collection.</p>
*
* @event add
* @preventable _defAddFn
*/
add: { defaultFn: this._defAddFn },
/**
* <p>At least one record is being removed. Additional properties of
* the event are:</p>
* <dl>
* <dt>removed</dt>
* <dd>Array of records to be removed</dd>
* <dt>range</dt>
* <dd>Number of records to be removed</dd>
* <dt>index</dt>
* <dd>The starting index in the Recordset's internal
* array from which to remove records</dd>
* </dl>
*
* <p>Preventing this event will cause the records NOT to be
* removed from the Recordset's internal collection.</p>
*
* @event remove
* @preventable _defRemoveFn
*/
remove: { defaultFn: this._defRemoveFn },
/**
* The Recordset is being flushed of all records.
*
* @event empty
* @preventable _defEmptyFn
*/
empty: { defaultFn: this._defEmptyFn },
/**
* <p>At least one record is being updated. Additional properties of
* the event are:</p>
* <dl>
* <dt>updated</dt>
* <dd>Array of records with updated values</dd>
* <dt>overwritten</dt>
* <dd>Array of current records that will be replaced</dd>
* <dt>index</dt>
* <dd>The starting index in the Recordset's internal
* array from which to update will apply</dd>
* </dl>
*
* <p>Preventing this event will cause the records NOT to be
* updated in the Recordset's internal collection.</p>
*
* @event update
* @preventable _defUpdateFn
*/
update: { defaultFn: this._defUpdateFn }
});
this._buildHashTable(this.get('key'));
this.after([
'recordsChange',
'add',
'remove',
'update',
'empty'], this._updateHash);
},
/**
* Returns the record with particular ID or index
*
* @method getRecord
* @param i {String, Number} The ID of the record if a string, or the index if a number.
* @return {Record} A Y.Record instance
*/
getRecord: function(i) {
if (Lang.isString(i)) {
return this.get('table')[i];
}
else if (Lang.isNumber(i)) {
return this._items[i];
}
return null;
},
/**
* Returns the record at a particular index
*
* @method getRecordByIndex
* @param i {Number} Index at which the required record resides
* @return {Record} A Y.Record instance
*/
getRecordByIndex: function(i) {
return this._items[i];
},
/**
* Returns a range of records beginning at particular index
*
* @method getRecordsByIndex
* @param index {Number} Index at which the required record resides
* @param range {Number} (Optional) Number of records to retrieve. The default is 1
* @return {Array} An array of Y.Record instances
*/
getRecordsByIndex: function(index, range) {
var i = 0,
returnedRecords = [];
//Range cannot take on negative values
range = (Lang.isNumber(range) && (range > 0)) ? range: 1;
for (; i < range; i++) {
returnedRecords.push(this._items[index + i]);
}
return returnedRecords;
},
/**
* Returns the length of the recordset
*
* @method getLength
* @return {Number} Number of records in the recordset
*/
getLength: function() {
return this.size();
},
/**
Gets an array of values for a data _key_ in the set's records. If no _key_
is supplied, the returned array will contain the full data object for each
record.
@method getValuesByKey
@param {String} [key] Data property to get from all records
@return {Array} An array of values for the given _key_ if supplied.
Otherwise, an array of each record's data hash.
**/
getValuesByKey: function(key) {
var i = 0,
len = this._items.length,
retVals = [];
for (; i < len; i++) {
retVals.push(this._items[i].getValue(key));
}
return retVals;
},
/**
* Adds one or more Records to the RecordSet at the given index. If index is null, then adds the Records to the end of the RecordSet.
*
* @method add
* @param {Record|Object|Array} oData A Y.Record instance, An object literal of data or an array of object literals
* @param [index] {Number} [index] Index at which to add the record(s)
* @return {Recordset} The updated recordset instance
*/
add: function(oData, index) {
var newRecords = [],
idx,
i = 0;
idx = (Lang.isNumber(index) && (index > -1)) ? index: this._items.length;
//Passing in array of object literals for oData
if (Lang.isArray(oData)) {
for (; i < oData.length; i++) {
newRecords[i] = this._changeToRecord(oData[i]);
}
} else if (Lang.isObject(oData)) {
newRecords[0] = this._changeToRecord(oData);
}
this.fire('add', {
added: newRecords,
index: idx
});
return this;
},
/**
Removes one or more Records to the RecordSet at the given index. If index
is null, then removes a single Record from the end of the RecordSet.
@method remove
@param {Number} [index] Index at which to remove the record(s) from
@param {Number} [range] Number of records to remove (including the one
at the index)
@return {Recordset} The updated recordset instance
**/
remove: function(index, range) {
var remRecords = [];
//Default is to only remove the last record - the length is always 1 greater than the last index
index = (index > -1) ? index: (this._items.length - 1);
range = (range > 0) ? range: 1;
remRecords = this._items.slice(index, (index + range));
this.fire('remove', {
removed: remRecords,
range: range,
index: index
});
//this._recordRemoved(remRecords, index);
//return ({data: remRecords, index:index});
return this;
},
/**
* Empties the recordset
*
* @method empty
* @return {Recordset} The updated recordset instance
*/
empty: function() {
this.fire('empty', {});
return this;
},
/**
Updates the recordset with the new records passed in. Overwrites existing
records when updating the index with the new records.
@method update
@param {Record|Object|Array} data A Y.Record instance, An object literal of
data or an array of object literals
@param {Number} [index] The index to start updating from.
@return {Recordset} The updated recordset instance
**/
update: function(data, index) {
var rec,
arr,
i = 0;
// Whatever is passed in, we are changing it to an array so that it can
// be easily iterated in the _defUpdateFn method
arr = (!(Lang.isArray(data))) ? [data] : data;
rec = this._items.slice(index, index + arr.length);
for (; i < arr.length; i++) {
arr[i] = this._changeToRecord(arr[i]);
}
this.fire('update', {
updated: arr,
overwritten: rec,
index: index
});
return this;
},
/**
* Default behavior for the "add" event. Adds Record instances starting from
* the index specified in `e.index`.
*
* @method _defAddFn
* @param {EventFacade} e The add event
* @private
*/
_defAddFn: function(e) {
this._items.splice.apply(this._items, [e.index, 0].concat(e.added));
},
/**
* Default behavior for the "remove" event. Removes Records from the
* internal array starting from `e.index`. By default, it will remove one
* Record. But if `e.range` is set, it will remove that many Records.
*
* @method _defRemoveFn
* @param {EventFacade} e The remove event
* @private
*/
_defRemoveFn: function(e) {
this._items.splice(e.index, e.range || 1);
},
/**
* Default behavior for the "update" event. Sets Record instances for each
* item in `e.updated` at indexes starting from `e.index`.
*
* @method _defUpdateFn
* @param {EventFacade} e The update event
* @private
*/
_defUpdateFn: function(e) {
for (var i = 0; i < e.updated.length; i++) {
this._items[e.index + i] = this._changeToRecord(e.updated[i]);
}
},
/**
* Default behavior for the "empty" event. Clears the internal array of
* Records.
*
* @method _defEmptyFn
* @param {EventFacade} e The empty event
* @private
*/
_defEmptyFn: function(e) {
this._items = [];
Y.log('empty fired');
},
/**
Updates the internal hash table.
@method _defUpdateHash
@param {EventFacade} e Event triggering the hash table update
@private
**/
_updateHash: function (e) {
var handler = "_hash",
type = e.type.replace(/.*:/,''),
newHash;
// _hashAdd, _hashRemove, _hashEmpty, etc
// Not a switch or else if setup to allow for external expansion.
handler += type.charAt(0).toUpperCase() + type.slice(1);
newHash = this[handler] &&
this[handler](this.get('table'), this.get('key'), e);
if (newHash) {
this.set('table', newHash);
}
},
/**
Regenerates the hash table from the current internal array of Records.
@method _hashRecordsChange
@param {Object} hash The hash map before replacement
@param {String} key The key by which to add items to the hash
@param {Object} e The event or object containing the items to be added.
Items are expected to be stored in an array assigned to
the `added` property.
@return {Object} The updated hash map
@private
**/
_hashRecordsChange: function (hash, key, e) {
return this._buildHashTable(key);
},
/**
Builds a hash table from the current internal array of Records.
@method _buildHashTable
@param {String} key The Record key to hash the items by
@return {Object} A new hash map of Records keyed by each Records' key
@private
**/
_buildHashTable: function (key) {
return this._hashAdd({}, key, { added: this._items });
},
/**
Adds items to the hash table. Items are the values, and the keys are the
values of the item's attribute named in the `key` parameter.
@method _hashAdd
@param {Object} hash The hash map before adding items
@param {String} key The key by which to add the items to the hash
@param {Object} e The event or object containing the items to be added.
Items are expected to be stored in an array assigned to
the `added` property.
@return {Object} The updated hash map
@private
**/
_hashAdd: function(hash, key, e) {
var items = e.added,
i, len;
for (i = 0, len = e.added.length; i < len; ++i) {
hash[items[i].get(key)] = items[i];
}
return hash;
},
/**
Removes items from the hash table.
@method _hashRemove
@param {Object} hash The hash map before removing items
@param {String} key The key by which to remove the items from the hash
@param {Object} e The event or object containing the items to be removed.
Items are expected to be stored in an array assigned to
the `removed` property.
@return {Object} The updated hash map
@private
**/
_hashRemove: function(hash, key, e) {
for (var i = e.removed.length - 1; i >= 0; --i) {
delete hash[e.removed[i].get(key)];
}
return hash;
},
/**
Updates items in the hash table.
@method _hashUpdate
@param {Object} hash The hash map before updating items
@param {String} key The key by which to update the items to the hash
@param {Object} e The event or object containing the items to be updated.
Items are expected to be stored in an array assigned to
the `updated` property. Optionally, items can be
identified for being overwritten by including them in an
array assigned to the `overwritten` property.
@return {Object} The updated hash map
@private
**/
_hashUpdate: function (hash, key, e) {
if (e.overwritten && e.overwritten.length) {
hash = this._hashRemove(hash, key, { removed: e.overwritten });
}
return this._hashAdd(hash, key, { added: e.updated });
},
/**
Clears the hash table.
@method _hashEmpty
@param {Object} hash The hash map before adding items
@param {String} key The key by which to remove the items from the hash
@param {Object} e The event or object containing the items to be removed.
Items are expected to be stored in an array assigned to
the `removed` property.
@return {Object} An empty hash
@private
**/
_hashEmpty: function() {
return {};
},
/**
* Sets up the hashtable with all the records currently in the recordset
*
* @method _initHashTable
* @private
*/
_initHashTable: function() {
return this._hashAdd({}, this.get('key'), { added: this._items || [] });
},
/**
* Helper method - it takes an object bag and converts it to a Y.Record
*
* @method _changeToRecord
* @param obj {Object|Record} Any objet literal or Y.Record instance
* @return {Record} A Record instance.
* @private
*/
_changeToRecord: function(obj) {
return (obj instanceof Y.Record) ? obj : new Y.Record({ data: obj });
},
/**
Ensures the value being set is an array of Record instances. If array items
are raw object data, they are turned into Records.
@method _setRecords
@param {Record[]|Object[]} items The Records or data Objects to store as
Records.
@return {Record[]}
**/
_setRecords: function (items) {
if (!Y.Lang.isArray(items)) {
return Y.Attribute.INVALID_VALUE;
}
var records = [],
i, len;
// FIXME: This should use the flyweight pattern if possible
for (i = 0, len = items.length; i < len; ++i) {
records[i] = this._changeToRecord(items[i]);
}
return (this._items = records);
}
}, {
ATTRS: {
/**
* An array of Records that the Recordset is storing. Passing an array
* of raw record data is also accepted. The data for each item will be
* wrapped in a Record instance.
*
* @attribute records
* @type {Record[]}
*/
records: {
// TODO: necessary? valueFn?
lazyAdd: false,
getter: function() {
// give them a copy, not the internal object
return Y.Array(this._items);
},
setter: "_setRecords"
},
/**
A hash table where the ID of the record is the key, and the record
instance is the value.
@attribute table
@type object
**/
table: {
valueFn: '_initHashTable'
},
/**
The ID to use as the key in the hash table.
@attribute key
@type string
**/
key: {
value: 'id',
readOnly: true
}
}
});
Y.augment(Recordset, ArrayList);
Y.Recordset = Recordset;
}, '@VERSION@', {"requires": ["base", "arraylist"]}); |
# Customize the complete sign-in page (GitLab Enterprise Edition only)
Please see [Branded login page](http://doc.gitlab.com/ee/customization/branded_login_page.html)
# Add a welcome message to the sign-in page (GitLab Community Edition)
It is possible to add a markdown-formatted welcome message to your GitLab
sign-in page. Users of GitLab Enterprise Edition should use the [branded login
page feature](/ee/customization/branded_login_page.html) instead.
## Omnibus-gitlab example
In `/etc/gitlab/gitlab.rb`:
ruby
gitlab_rails['extra_sign_in_text'] = <<'EOS'
# ACME GitLab
Welcome to the [ACME](http:
EOS
Run `sudo gitlab-ctl reconfigure` for changes to take effect.
## Installation from source
In `/home/git/gitlab/config/gitlab.yml`:
yaml
# snip
production:
# snip
extra:
sign_in_text: |
# ACME GitLab
Welcome to the [ACME](http:
Run `sudo service gitlab reload` for the change to take effect. |
// <API key>: GPL-2.0
// Regulator Driver for Freescale MC13892 PMIC
// Based on draft driver from Arnaud Patard <arnaud.patard@rtp-net.org>
#include <linux/mfd/mc13892.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/driver.h>
#include <linux/platform_device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/module.h>
#include "mc13xxx.h"
#define MC13892_REVISION 7
#define MC13892_POWERCTL0 13
#define <API key> 3
#define <API key> 20
#define <API key> (7<<20)
#define <API key> (1<<23)
#define <API key> (1<<23)
#define MC13892_SWITCHERS0 24
#define <API key> 0
#define <API key> (0x1f<<0)
#define <API key> (1<<23)
#define <API key> 0
#define MC13892_SWITCHERS1 25
#define <API key> 0
#define <API key> (0x1f<<0)
#define <API key> (1<<23)
#define <API key> 0
#define MC13892_SWITCHERS2 26
#define <API key> 0
#define <API key> (0x1f<<0)
#define <API key> (1<<23)
#define <API key> 0
#define MC13892_SWITCHERS3 27
#define <API key> 0
#define <API key> (0x1f<<0)
#define <API key> (1<<23)
#define <API key> 0
#define MC13892_SWITCHERS4 28
#define <API key> 0
#define <API key> (8<<0)
#define <API key> (0xf<<0)
#define <API key> 10
#define <API key> (8<<10)
#define <API key> (0xf<<10)
#define MC13892_SWITCHERS5 29
#define <API key> 0
#define <API key> (8<<0)
#define <API key> (0xf<<0)
#define <API key> 8
#define <API key> (8<<8)
#define <API key> (0xf<<8)
#define <API key> (1<<20)
#define <API key> 30
#define <API key> 0
#define <API key> 4
#define <API key> 6
#define <API key> 9
#define <API key> 11
#define <API key> 14
#define <API key> 16
#define <API key> (3<<0)
#define <API key> (3<<4)
#define <API key> (7<<6)
#define <API key> (3<<9)
#define <API key> (3<<11)
#define <API key> (1<<14)
#define <API key> (3<<16)
#define <API key> 31
#define <API key> 2
#define <API key> 4
#define <API key> 6
#define <API key> (3<<2)
#define <API key> (3<<4)
#define <API key> (7<<6)
#define <API key> 32
#define <API key> (1<<0)
#define <API key> (1<<1)
#define <API key> (1<<2)
#define <API key> (1<<3)
#define <API key> (1<<4)
#define <API key> (1<<5)
#define <API key> (1<<9)
#define <API key> (1<<10)
#define <API key> (1<<11)
#define <API key> (1<<12)
#define <API key> (1<<13)
#define <API key> (1<<14)
#define <API key> (1<<15)
#define <API key> (1<<16)
#define <API key> (1<<17)
#define <API key> (1<<18)
#define <API key> (1<<19)
#define <API key> (1<<20)
#define <API key> 33
#define <API key> (1<<0)
#define <API key> (1<<1)
#define <API key> (1<<2)
#define <API key> (1<<6)
#define <API key> (1<<7)
#define <API key> (1<<8)
#define <API key> (1<<9)
#define <API key> (1<<12)
#define <API key> (1<<13)
#define <API key> (1<<14)
#define <API key> (1<<15)
#define <API key> (1<<16)
#define <API key> (1<<17)
#define <API key> (1<<18)
#define <API key> (1<<19)
#define <API key> (1<<20)
#define MC13892_POWERMISC 34
#define <API key> (1<<6)
#define <API key> (1<<8)
#define <API key> (1<<10)
#define <API key> (1<<12)
#define <API key> (1<<15)
#define <API key> (1<<16)
#define <API key> (1<<21)
#define <API key> (3 << 15)
#define MC13892_USB1 50
#define MC13892_USB1_VUSBEN (1<<3)
static const unsigned int mc13892_vcoincell[] = {
2500000, 2700000, 2800000, 2900000, 3000000, 3100000,
3200000, 3300000,
};
static const unsigned int mc13892_sw1[] = {
600000, 625000, 650000, 675000, 700000, 725000,
750000, 775000, 800000, 825000, 850000, 875000,
900000, 925000, 950000, 975000, 1000000, 1025000,
1050000, 1075000, 1100000, 1125000, 1150000, 1175000,
1200000, 1225000, 1250000, 1275000, 1300000, 1325000,
1350000, 1375000
};
/*
* Note: this table is used to derive SWxVSEL by index into
* the array. Offset the values by the index of 1100000uV
* to get the actual register value for that voltage selector
* if the HI bit is to be set as well.
*/
#define <API key> 20
static const unsigned int mc13892_sw[] = {
600000, 625000, 650000, 675000, 700000, 725000,
750000, 775000, 800000, 825000, 850000, 875000,
900000, 925000, 950000, 975000, 1000000, 1025000,
1050000, 1075000, 1100000, 1125000, 1150000, 1175000,
1200000, 1225000, 1250000, 1275000, 1300000, 1325000,
1350000, 1375000, 1400000, 1425000, 1450000, 1475000,
1500000, 1525000, 1550000, 1575000, 1600000, 1625000,
1650000, 1675000, 1700000, 1725000, 1750000, 1775000,
1800000, 1825000, 1850000, 1875000
};
static const unsigned int mc13892_swbst[] = {
5000000,
};
static const unsigned int mc13892_viohi[] = {
2775000,
};
static const unsigned int mc13892_vpll[] = {
1050000, 1250000, 1650000, 1800000,
};
static const unsigned int mc13892_vdig[] = {
1050000, 1250000, 1650000, 1800000,
};
static const unsigned int mc13892_vsd[] = {
1800000, 2000000, 2600000, 2700000,
2800000, 2900000, 3000000, 3150000,
};
static const unsigned int mc13892_vusb2[] = {
2400000, 2600000, 2700000, 2775000,
};
static const unsigned int mc13892_vvideo[] = {
2700000, 2775000, 2500000, 2600000,
};
static const unsigned int mc13892_vaudio[] = {
2300000, 2500000, 2775000, 3000000,
};
static const unsigned int mc13892_vcam[] = {
2500000, 2600000, 2750000, 3000000,
};
static const unsigned int mc13892_vgen1[] = {
1200000, 1500000, 2775000, 3150000,
};
static const unsigned int mc13892_vgen2[] = {
1200000, 1500000, 1600000, 1800000,
2700000, 2800000, 3000000, 3150000,
};
static const unsigned int mc13892_vgen3[] = {
1800000, 2900000,
};
static const unsigned int mc13892_vusb[] = {
3300000,
};
static const unsigned int mc13892_gpo[] = {
2750000,
};
static const unsigned int mc13892_pwgtdrv[] = {
5000000,
};
static const struct regulator_ops <API key>;
static const struct regulator_ops <API key>;
#define <API key>(name, node, reg, voltages) \
<API key>(MC13892_, name, node, reg, voltages, \
<API key>)
#define MC13892_GPO_DEFINE(name, node, reg, voltages) \
MC13xxx_GPO_DEFINE(MC13892_, name, node, reg, voltages, \
<API key>)
#define MC13892_SW_DEFINE(name, node, reg, vsel_reg, voltages) \
MC13xxx_DEFINE(MC13892_, name, node, reg, vsel_reg, voltages, \
<API key>)
#define MC13892_DEFINE_REGU(name, node, reg, vsel_reg, voltages) \
MC13xxx_DEFINE(MC13892_, name, node, reg, vsel_reg, voltages, \
<API key>)
static struct mc13xxx_regulator mc13892_regulators[] = {
MC13892_DEFINE_REGU(VCOINCELL, vcoincell, POWERCTL0, POWERCTL0, mc13892_vcoincell),
MC13892_SW_DEFINE(SW1, sw1, SWITCHERS0, SWITCHERS0, mc13892_sw1),
MC13892_SW_DEFINE(SW2, sw2, SWITCHERS1, SWITCHERS1, mc13892_sw),
MC13892_SW_DEFINE(SW3, sw3, SWITCHERS2, SWITCHERS2, mc13892_sw),
MC13892_SW_DEFINE(SW4, sw4, SWITCHERS3, SWITCHERS3, mc13892_sw),
<API key>(SWBST, swbst, SWITCHERS5, mc13892_swbst),
<API key>(VIOHI, viohi, REGULATORMODE0, mc13892_viohi),
MC13892_DEFINE_REGU(VPLL, vpll, REGULATORMODE0, REGULATORSETTING0,
mc13892_vpll),
MC13892_DEFINE_REGU(VDIG, vdig, REGULATORMODE0, REGULATORSETTING0,
mc13892_vdig),
MC13892_DEFINE_REGU(VSD, vsd, REGULATORMODE1, REGULATORSETTING1,
mc13892_vsd),
MC13892_DEFINE_REGU(VUSB2, vusb2, REGULATORMODE0, REGULATORSETTING0,
mc13892_vusb2),
MC13892_DEFINE_REGU(VVIDEO, vvideo, REGULATORMODE1, REGULATORSETTING1,
mc13892_vvideo),
MC13892_DEFINE_REGU(VAUDIO, vaudio, REGULATORMODE1, REGULATORSETTING1,
mc13892_vaudio),
MC13892_DEFINE_REGU(VCAM, vcam, REGULATORMODE1, REGULATORSETTING0,
mc13892_vcam),
MC13892_DEFINE_REGU(VGEN1, vgen1, REGULATORMODE0, REGULATORSETTING0,
mc13892_vgen1),
MC13892_DEFINE_REGU(VGEN2, vgen2, REGULATORMODE0, REGULATORSETTING0,
mc13892_vgen2),
MC13892_DEFINE_REGU(VGEN3, vgen3, REGULATORMODE1, REGULATORSETTING0,
mc13892_vgen3),
<API key>(VUSB, vusb, USB1, mc13892_vusb),
MC13892_GPO_DEFINE(GPO1, gpo1, POWERMISC, mc13892_gpo),
MC13892_GPO_DEFINE(GPO2, gpo2, POWERMISC, mc13892_gpo),
MC13892_GPO_DEFINE(GPO3, gpo3, POWERMISC, mc13892_gpo),
MC13892_GPO_DEFINE(GPO4, gpo4, POWERMISC, mc13892_gpo),
MC13892_GPO_DEFINE(PWGT1SPI, pwgt1spi, POWERMISC, mc13892_pwgtdrv),
MC13892_GPO_DEFINE(PWGT2SPI, pwgt2spi, POWERMISC, mc13892_pwgtdrv),
};
static int <API key>(struct <API key> *priv, u32 mask,
u32 val)
{
struct mc13xxx *mc13892 = priv->mc13xxx;
int ret;
u32 valread;
BUG_ON(val & ~mask);
mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_read(mc13892, MC13892_POWERMISC, &valread);
if (ret)
goto out;
/* Update the stored state for Power Gates. */
priv-><API key> =
(priv-><API key> & ~mask) | val;
priv-><API key> &= <API key>;
/* Construct the new register value */
valread = (valread & ~mask) | val;
/* Overwrite the PWGTxEN with the stored version */
valread = (valread & ~<API key>) |
priv-><API key>;
ret = mc13xxx_reg_write(mc13892, MC13892_POWERMISC, valread);
out:
mc13xxx_unlock(priv->mc13xxx);
return ret;
}
static int <API key>(struct regulator_dev *rdev)
{
struct <API key> *priv = rdev_get_drvdata(rdev);
int id = rdev_get_id(rdev);
u32 en_val = mc13892_regulators[id].enable_bit;
u32 mask = mc13892_regulators[id].enable_bit;
dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
/* Power Gate enable value is 0 */
if (id == MC13892_PWGT1SPI || id == MC13892_PWGT2SPI)
en_val = 0;
if (id == MC13892_GPO4)
mask |= <API key>;
return <API key>(priv, mask, en_val);
}
static int <API key>(struct regulator_dev *rdev)
{
struct <API key> *priv = rdev_get_drvdata(rdev);
int id = rdev_get_id(rdev);
u32 dis_val = 0;
dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
/* Power Gate disable value is 1 */
if (id == MC13892_PWGT1SPI || id == MC13892_PWGT2SPI)
dis_val = mc13892_regulators[id].enable_bit;
return <API key>(priv, mc13892_regulators[id].enable_bit,
dis_val);
}
static int <API key>(struct regulator_dev *rdev)
{
struct <API key> *priv = rdev_get_drvdata(rdev);
int ret, id = rdev_get_id(rdev);
unsigned int val;
mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_read(priv->mc13xxx, mc13892_regulators[id].reg, &val);
mc13xxx_unlock(priv->mc13xxx);
if (ret)
return ret;
/* Power Gates state is stored in <API key>
* where the meaning of bits is negated */
val = (val & ~<API key>) |
(priv-><API key> ^ <API key>);
return (val & mc13892_regulators[id].enable_bit) != 0;
}
static const struct regulator_ops <API key> = {
.enable = <API key>,
.disable = <API key>,
.is_enabled = <API key>,
.list_voltage = <API key>,
.set_voltage = <API key>,
};
static int <API key>(struct regulator_dev *rdev)
{
struct <API key> *priv = rdev_get_drvdata(rdev);
int ret, id = rdev_get_id(rdev);
unsigned int val, selector;
dev_dbg(rdev_get_dev(rdev), "%s id: %d\n", __func__, id);
mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_read(priv->mc13xxx,
mc13892_regulators[id].vsel_reg, &val);
mc13xxx_unlock(priv->mc13xxx);
if (ret)
return ret;
/*
* Figure out if the HI bit is set inside the switcher mode register
* since this means the selector value we return is at a different
* offset into the selector table.
*
* According to the MC13892 documentation note 59 (Table 47) the SW1
* buck switcher does not support output range programming therefore
* the HI bit must always remain 0. So do not do anything strange if
* our register is MC13892_SWITCHERS0.
*/
selector = val & mc13892_regulators[id].vsel_mask;
if ((mc13892_regulators[id].vsel_reg != MC13892_SWITCHERS0) &&
(val & <API key>)) {
selector += <API key>;
}
dev_dbg(rdev_get_dev(rdev), "%s id: %d val: 0x%08x selector: %d\n",
__func__, id, val, selector);
return selector;
}
static int <API key>(struct regulator_dev *rdev,
unsigned selector)
{
struct <API key> *priv = rdev_get_drvdata(rdev);
int volt, mask, id = rdev_get_id(rdev);
u32 reg_value;
int ret;
volt = rdev->desc->volt_table[selector];
mask = mc13892_regulators[id].vsel_mask;
reg_value = selector;
/*
* Don't mess with the HI bit or support HI voltage offsets for SW1.
*
* Since the get_voltage_sel callback has given a fudged value for
* the selector offset, we need to back out that offset if HI is
* to be set so we write the correct value to the register.
*
* The HI bit addition and selector offset handling COULD be more
* complicated by shifting and masking off the voltage selector part
* of the register then logical OR it back in, but since the selector
* is at bits 4:0 there is very little point. This makes the whole
* thing more readable and we do far less work.
*/
if (mc13892_regulators[id].vsel_reg != MC13892_SWITCHERS0) {
mask |= <API key>;
if (volt > 1375000) {
reg_value -= <API key>;
reg_value |= <API key>;
} else {
reg_value &= ~<API key>;
}
}
mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13892_regulators[id].vsel_reg,
mask, reg_value);
mc13xxx_unlock(priv->mc13xxx);
return ret;
}
static const struct regulator_ops <API key> = {
.list_voltage = <API key>,
.map_voltage = <API key>,
.set_voltage_sel = <API key>,
.get_voltage_sel = <API key>,
};
static int <API key>(struct regulator_dev *rdev, unsigned int mode)
{
unsigned int en_val = 0;
struct <API key> *priv = rdev_get_drvdata(rdev);
int ret, id = rdev_get_id(rdev);
if (mode == REGULATOR_MODE_FAST)
en_val = <API key>;
mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_rmw(priv->mc13xxx, mc13892_regulators[id].reg,
<API key>, en_val);
mc13xxx_unlock(priv->mc13xxx);
return ret;
}
static unsigned int <API key>(struct regulator_dev *rdev)
{
struct <API key> *priv = rdev_get_drvdata(rdev);
int ret, id = rdev_get_id(rdev);
unsigned int val;
mc13xxx_lock(priv->mc13xxx);
ret = mc13xxx_reg_read(priv->mc13xxx, mc13892_regulators[id].reg, &val);
mc13xxx_unlock(priv->mc13xxx);
if (ret)
return ret;
if (val & <API key>)
return REGULATOR_MODE_FAST;
return <API key>;
}
static struct regulator_ops mc13892_vcam_ops;
static int <API key>(struct platform_device *pdev)
{
struct <API key> *priv;
struct mc13xxx *mc13892 = dev_get_drvdata(pdev->dev.parent);
struct <API key> *pdata =
dev_get_platdata(&pdev->dev);
struct <API key> *mc13xxx_data;
struct regulator_config config = { };
int i, ret;
int num_regulators = 0;
u32 val;
num_regulators = <API key>(pdev);
if (num_regulators <= 0 && pdata)
num_regulators = pdata->num_regulators;
if (num_regulators <= 0)
return -EINVAL;
priv = devm_kzalloc(&pdev->dev,
struct_size(priv, regulators, num_regulators),
GFP_KERNEL);
if (!priv)
return -ENOMEM;
priv->num_regulators = num_regulators;
priv->mc13xxx_regulators = mc13892_regulators;
priv->mc13xxx = mc13892;
<API key>(pdev, priv);
mc13xxx_lock(mc13892);
ret = mc13xxx_reg_read(mc13892, MC13892_REVISION, &val);
if (ret)
goto err_unlock;
/* enable switch auto mode (on 2.0A silicon only) */
if ((val & 0x0000FFFF) == 0x45d0) {
ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS4,
<API key> |
<API key>,
<API key> |
<API key>);
if (ret)
goto err_unlock;
ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS5,
<API key> |
<API key>,
<API key> |
<API key>);
if (ret)
goto err_unlock;
}
mc13xxx_unlock(mc13892);
/* update mc13892_vcam ops */
memcpy(&mc13892_vcam_ops, mc13892_regulators[MC13892_VCAM].desc.ops,
sizeof(struct regulator_ops));
mc13892_vcam_ops.set_mode = <API key>;
mc13892_vcam_ops.get_mode = <API key>;
mc13892_regulators[MC13892_VCAM].desc.ops = &mc13892_vcam_ops;
mc13xxx_data = <API key>(pdev, mc13892_regulators,
ARRAY_SIZE(mc13892_regulators));
for (i = 0; i < priv->num_regulators; i++) {
struct regulator_init_data *init_data;
struct regulator_desc *desc;
struct device_node *node = NULL;
int id;
if (mc13xxx_data) {
id = mc13xxx_data[i].id;
init_data = mc13xxx_data[i].init_data;
node = mc13xxx_data[i].node;
} else {
id = pdata->regulators[i].id;
init_data = pdata->regulators[i].init_data;
}
desc = &mc13892_regulators[id].desc;
config.dev = &pdev->dev;
config.init_data = init_data;
config.driver_data = priv;
config.of_node = node;
priv->regulators[i] = <API key>(&pdev->dev, desc,
&config);
if (IS_ERR(priv->regulators[i])) {
dev_err(&pdev->dev, "failed to register regulator %s\n",
mc13892_regulators[i].desc.name);
return PTR_ERR(priv->regulators[i]);
}
}
return 0;
err_unlock:
mc13xxx_unlock(mc13892);
return ret;
}
static struct platform_driver <API key> = {
.driver = {
.name = "mc13892-regulator",
},
.probe = <API key>,
};
static int __init <API key>(void)
{
return <API key>(&<API key>);
}
subsys_initcall(<API key>);
static void __exit <API key>(void)
{
<API key>(&<API key>);
}
module_exit(<API key>);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Yong Shen <yong.shen@linaro.org>");
MODULE_DESCRIPTION("Regulator Driver for Freescale MC13892 PMIC");
MODULE_ALIAS("platform:mc13892-regulator"); |
<?php
defined('_JEXEC') or die;
/**
* This models supports retrieving lists of contact categories.
*
* @package Joomla.Site
* @subpackage com_contact
* @since 1.6
*/
class <API key> extends JModelLegacy
{
/**
* Model context string.
*
* @var string
*/
public $_context = 'com_contact.categories';
/**
* The category context (allows other extensions to derived from this model).
*
* @var string
*/
protected $_extension = 'com_contact';
private $_parent = null;
private $_items = null;
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/
protected function populateState()
{
$app = JFactory::getApplication();
$this->setState('filter.extension', $this->_extension);
// Get the parent id if defined.
$parentId = JRequest::getInt('id');
$this->setState('filter.parentId', $parentId);
$params = $app->getParams();
$this->setState('params', $params);
$this->setState('filter.published', 1);
$this->setState('filter.access', true);
}
/**
* Method to get a store id based on model configuration state.
*
* This is necessary because the model is used by the component and
* different modules that might need different sets of data or different
* ordering requirements.
*
* @param string $id A prefix for the store id.
*
* @return string A store id.
*/
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':'.$this->getState('filter.extension');
$id .= ':'.$this->getState('filter.published');
$id .= ':'.$this->getState('filter.access');
$id .= ':'.$this->getState('filter.parentId');
return parent::getStoreId($id);
}
/**
* redefine the function an add some properties to make the styling more easy
*
* @return mixed An array of data items on success, false on failure.
*/
public function getItems()
{
if(!count($this->_items))
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$params = new JRegistry();
if($active)
{
$params->loadString($active->params);
}
$options = array();
$options['countItems'] = $params->get('show_cat_items_cat', 1) || !$params->get('<API key>', 0);
$categories = JCategories::getInstance('Contact', $options);
$this->_parent = $categories->get($this->getState('filter.parentId', 'root'));
if(is_object($this->_parent))
{
$this->_items = $this->_parent->getChildren();
} else {
$this->_items = false;
}
}
return $this->_items;
}
public function getParent()
{
if(!is_object($this->_parent))
{
$this->getItems();
}
return $this->_parent;
}
} |
/**
* @constructor
* @extends {WebInspector.SidebarPane}
*/
WebInspector.<API key> = function()
{
WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack"));
this._model = WebInspector.debuggerModel;
this.bodyElement.addEventListener("keydown", this._keyDown.bind(this), true);
this.bodyElement.tabIndex = 0;
}
WebInspector.<API key>.prototype = {
update: function(callFrames)
{
this.bodyElement.removeChildren();
delete this.<API key>;
this.placards = [];
if (!callFrames) {
var infoElement = document.createElement("div");
infoElement.className = "info";
infoElement.textContent = WebInspector.UIString("Not Paused");
this.bodyElement.appendChild(infoElement);
return;
}
for (var i = 0; i < callFrames.length; ++i) {
var callFrame = callFrames[i];
var placard = new WebInspector.<API key>.Placard(callFrame, this);
placard.element.addEventListener("click", this._placardSelected.bind(this, placard), false);
this.placards.push(placard);
this.bodyElement.appendChild(placard.element);
}
},
<API key>: function(x)
{
for (var i = 0; i < this.placards.length; ++i) {
var placard = this.placards[i];
placard.selected = (placard._callFrame === x);
}
},
/**
* @param {Event=} event
* @return {boolean}
*/
<API key>: function(event)
{
var index = this.<API key>();
if (index == -1)
return true;
this.<API key>(index + 1);
return true;
},
/**
* @param {Event=} event
* @return {boolean}
*/
<API key>: function(event)
{
var index = this.<API key>();
if (index == -1)
return true;
this.<API key>(index - 1);
return true;
},
/**
* @param {number} index
*/
<API key>: function(index)
{
if (index < 0 || index >= this.placards.length)
return;
this._placardSelected(this.placards[index])
},
/**
* @return {number}
*/
<API key>: function()
{
if (!this._model.selectedCallFrame())
return -1;
for (var i = 0; i < this.placards.length; ++i) {
var placard = this.placards[i];
if (placard._callFrame === this._model.selectedCallFrame())
return i;
}
return -1;
},
_placardSelected: function(placard)
{
this._model.<API key>(placard._callFrame);
},
_copyStackTrace: function()
{
var text = "";
for (var i = 0; i < this.placards.length; ++i)
text += this.placards[i].title + " (" + this.placards[i].subtitle + ")\n";
<API key>.copyText(text);
},
/**
* @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, function(Event=):boolean)} <API key>
*/
registerShortcuts: function(<API key>)
{
<API key>(WebInspector.<API key>.ShortcutKeys.NextCallFrame, this.<API key>.bind(this));
<API key>(WebInspector.<API key>.ShortcutKeys.PrevCallFrame, this.<API key>.bind(this));
},
setStatus: function(status)
{
if (!this.<API key>) {
this.<API key> = document.createElement("div");
this.<API key>.className = "info";
this.bodyElement.appendChild(this.<API key>);
}
if (typeof status === "string")
this.<API key>.textContent = status;
else {
this.<API key>.removeChildren();
this.<API key>.appendChild(status);
}
},
_keyDown: function(event)
{
if (event.altKey || event.shiftKey || event.metaKey || event.ctrlKey)
return;
if (event.keyIdentifier === "Up") {
this.<API key>();
event.consume();
} else if (event.keyIdentifier === "Down") {
this.<API key>();
event.consume();
}
},
__proto__: WebInspector.SidebarPane.prototype
}
/**
* @constructor
* @extends {WebInspector.Placard}
* @param {WebInspector.DebuggerModel.CallFrame} callFrame
* @param {WebInspector.<API key>} pane
*/
WebInspector.<API key>.Placard = function(callFrame, pane)
{
WebInspector.Placard.call(this, callFrame.functionName || WebInspector.UIString("(anonymous function)"), "");
callFrame.createLiveLocation(this._update.bind(this));
this.element.addEventListener("contextmenu", this._placardContextMenu.bind(this), true);
this._callFrame = callFrame;
this._pane = pane;
}
WebInspector.<API key>.Placard.prototype = {
_update: function(uiLocation)
{
this.subtitle = WebInspector.formatLinkText(uiLocation.uiSourceCode.originURL(), uiLocation.lineNumber).<API key>(100);
},
_placardContextMenu: function(event)
{
var contextMenu = new WebInspector.ContextMenu(event);
if (WebInspector.debuggerModel.canSetScriptSource()) {
contextMenu.appendItem(WebInspector.UIString(WebInspector.<API key>() ? "Restart frame" : "Restart Frame"), this._restartFrame.bind(this));
contextMenu.appendSeparator();
}
contextMenu.appendItem(WebInspector.UIString(WebInspector.<API key>() ? "Copy stack trace" : "Copy Stack Trace"), this._pane._copyStackTrace.bind(this._pane));
contextMenu.show();
},
_restartFrame: function()
{
this._callFrame.restart(undefined);
},
__proto__: WebInspector.Placard.prototype
} |
# -*- coding: utf-8 -*-
# OpenERP, Open Source Management Solution
# This program is free software: you can redistribute it and/or modify
# published by the Free Software Foundation, either version 3 of the
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
import time
from openerp.osv import fields, osv
class <API key>(osv.osv_memory):
"""
This wizard provides the crossovered budget summary report'
"""
_name = 'account.budget.crossvered.summary.report'
_description = 'Account Budget crossvered summary report'
_columns = {
'date_from': fields.date('Start of period', required=True),
'date_to': fields.date('End of period', required=True),
}
_defaults = {
'date_from': lambda *a: time.strftime('%Y-01-01'),
'date_to': lambda *a: time.strftime('%Y-%m-%d'),
}
def check_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids, context=context)[0]
datas = {
'ids': context.get('active_ids',[]),
'model': 'crossovered.budget',
'form': data
}
datas['form']['ids'] = datas['ids']
datas['form']['report'] = 'analytic-one'
return self.pool['report'].get_action(cr, uid, [], 'account_budget.<API key>', data=datas, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
<?php
require_once('self.php');
?><html>
<head><title>SimpleTest testing links</title></head>
<body>
<p>
A target for the
<a href="http:
test suite.
</p>
<ul>
<li><a href="<?php print my_path(); ?>network_confirm.php">Absolute</a></li>
<li><a href="network_confirm.php">Relative</a></li>
<li><a href="network_confirm.php" id="1">Id</a></li>
<li><a href="network_confirm.php">märcêl kiek'eboe</a></li>
</ul>
</body>
</html> |
<?php
interface I_Router
{
function serve_request();
static function get_instance();
} |
(function($) {
/**
* Class: $.jqplot.MeterGaugeRenderer
* Plugin renderer to draw a meter gauge chart.
*
* Data consists of a single series with 1 data point to position the gauge needle.
*
* To use this renderer, you need to include the
* meter gauge renderer plugin, for example:
*
* > <script type="text/javascript" src="plugins/jqplot.meterGaugeRenderer.js"></script>
*
* Properties described here are passed into the $.jqplot function
* as options on the series renderer. For example:
*
* > plot0 = $.jqplot('chart0',[[18]],{
* > title: 'Network Speed',
* > seriesDefaults: {
* > renderer: $.jqplot.MeterGaugeRenderer,
* > rendererOptions: {
* > label: 'MB/s'
* > }
* > }
* > });
*
* A meterGauge plot does not support events.
*/
$.jqplot.MeterGaugeRenderer = function(){
$.jqplot.LineRenderer.call(this);
};
$.jqplot.MeterGaugeRenderer.prototype = new $.jqplot.LineRenderer();
$.jqplot.MeterGaugeRenderer.prototype.constructor = $.jqplot.MeterGaugeRenderer;
// called with scope of a series
$.jqplot.MeterGaugeRenderer.prototype.init = function(options) {
// Group: Properties
// prop: diameter
// Outer diameter of the meterGauge, auto computed by default
this.diameter = null;
// prop: padding
// padding between the meterGauge and plot edges, auto
// calculated by default.
this.padding = null;
// prop: shadowOffset
// offset of the shadow from the gauge ring and offset of
// each succesive stroke of the shadow from the last.
this.shadowOffset = 2;
// prop: shadowAlpha
// transparency of the shadow (0 = transparent, 1 = opaque)
this.shadowAlpha = 0.07;
// prop: shadowDepth
// number of strokes to apply to the shadow,
// each stroke offset shadowOffset from the last.
this.shadowDepth = 4;
// prop: background
// background color of the inside of the gauge.
this.background = "#efefef";
// prop: ringColor
// color of the outer ring, hub, and needle of the gauge.
this.ringColor = "#BBC6D0";
// needle color not implemented yet.
this.needleColor = "#C3D3E5";
// prop: tickColor
// color of the tick marks around the gauge.
this.tickColor = "989898";
// prop: ringWidth
// width of the ring around the gauge. Auto computed by default.
this.ringWidth = null;
// prop: min
// Minimum value on the gauge. Auto computed by default
this.min;
// prop: max
// Maximum value on the gauge. Auto computed by default
this.max;
// prop: ticks
// Array of tick values. Auto computed by default.
this.ticks = [];
// prop: showTicks
// true to show ticks around gauge.
this.showTicks = true;
// prop: showTickLabels
// true to show tick labels next to ticks.
this.showTickLabels = true;
// prop: label
// A gauge label like 'kph' or 'Volts'
this.label = null;
// prop: labelHeightAdjust
// Number of Pixels to offset the label up (-) or down (+) from its default position.
this.labelHeightAdjust = 0;
// prop: labelPosition
// Where to position the label, either 'inside' or 'bottom'.
this.labelPosition = 'inside';
// prop: intervals
// Array of ranges to be drawn around the gauge.
// Array of form:
// > [value1, value2, ...]
// indicating the values for the first, second, ... intervals.
this.intervals = [];
// prop: intervalColors
// Array of colors to use for the intervals.
this.intervalColors = [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"];
// prop: intervalInnerRadius
// Radius of the inner circle of the interval ring.
this.intervalInnerRadius = null;
// prop: intervalOuterRadius
// Radius of the outer circle of the interval ring.
this.intervalOuterRadius = null;
this.tickRenderer = $.jqplot.<API key>;
// ticks spaced every 1, 2, 2.5, 5, 10, 20, .1, .2, .25, .5, etc.
this.tickPositions = [1, 2, 2.5, 5, 10];
// prop: tickSpacing
// Degrees between ticks. This is a target number, if
// incompatible span and ticks are supplied, a suitable
// spacing close to this value will be computed.
this.tickSpacing = 30;
this.numberMinorTicks = null;
// prop: hubRadius
// Radius of the hub at the bottom center of gauge which the needle attaches to.
// Auto computed by default
this.hubRadius = null;
// prop: tickPadding
// padding of the tick marks to the outer ring and the tick labels to marks.
// Auto computed by default.
this.tickPadding = null;
// prop: needleThickness
// Maximum thickness the needle. Auto computed by default.
this.needleThickness = null;
// prop: needlePad
// Padding between needle and inner edge of the ring when the needle is at the min or max gauge value.
this.needlePad = 6;
// prop: pegNeedle
// True will stop needle just below/above the min/max values if data is below/above min/max,
// as if the meter is "pegged".
this.pegNeedle = true;
this._type = 'meterGauge';
$.extend(true, this, options);
this.type = null;
this.numberTicks = null;
this.tickInterval = null;
// span, the sweep (in degrees) from min to max. This gauge is
// a semi-circle.
this.span = 180;
// get rid of this nonsense
// this.innerSpan = this.span;
if (this.type == 'circular') {
this.semiCircular = false;
}
else if (this.type != 'circular') {
this.semiCircular = true;
}
else {
this.semiCircular = (this.span <= 180) ? true : false;
}
this._tickPoints = [];
// reference to label element.
this._labelElem = null;
// start the gauge at the beginning of the span
this.startAngle = (90 + (360 - this.span)/2) * Math.PI/180;
this.endAngle = (90 - (360 - this.span)/2) * Math.PI/180;
this.setmin = !!(this.min == null);
this.setmax = !!(this.max == null);
// if given intervals and is an array of values, create labels and colors.
if (this.intervals.length) {
if (this.intervals[0].length == null || this.intervals.length == 1) {
for (var i=0; i<this.intervals.length; i++) {
this.intervals[i] = [this.intervals[i], this.intervals[i], this.intervalColors[i]];
}
}
else if (this.intervals[0].length == 2) {
for (i=0; i<this.intervals.length; i++) {
this.intervals[i] = [this.intervals[i][0], this.intervals[i][1], this.intervalColors[i]];
}
}
}
// compute min, max and ticks if not supplied:
if (this.ticks.length) {
if (this.ticks[0].length == null || this.ticks[0].length == 1) {
for (var i=0; i<this.ticks.length; i++) {
this.ticks[i] = [this.ticks[i], this.ticks[i]];
}
}
this.min = (this.min == null) ? this.ticks[0][0] : this.min;
this.max = (this.max == null) ? this.ticks[this.ticks.length-1][0] : this.max;
this.setmin = false;
this.setmax = false;
this.numberTicks = this.ticks.length;
this.tickInterval = this.ticks[1][0] - this.ticks[0][0];
this.tickFactor = Math.floor(parseFloat((Math.log(this.tickInterval)/Math.log(10)).toFixed(11)));
// use the first interal to calculate minor ticks;
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
if (!this.numberMinorTicks) {
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
}
if (!this.numberMinorTicks) {
this.numberMinorTicks = 1;
}
}
else if (this.intervals.length) {
this.min = (this.min == null) ? 0 : this.min;
this.setmin = false;
if (this.max == null) {
if (this.intervals[this.intervals.length-1][0] >= this.data[0][1]) {
this.max = this.intervals[this.intervals.length-1][0];
this.setmax = false;
}
}
else {
this.setmax = false;
}
}
else {
// no ticks and no intervals supplied, put needle in middle
this.min = (this.min == null) ? 0 : this.min;
this.setmin = false;
if (this.max == null) {
this.max = this.data[0][1] * 1.25;
this.setmax = true;
}
else {
this.setmax = false;
}
}
};
$.jqplot.MeterGaugeRenderer.prototype.setGridData = function(plot) {
// set gridData property. This will hold angle in radians of each data point.
var stack = [];
var td = [];
var sa = this.startAngle;
for (var i=0; i<this.data.length; i++){
stack.push(this.data[i][1]);
td.push([this.data[i][0]]);
if (i>0) {
stack[i] += stack[i-1];
}
}
var fact = Math.PI*2/stack[stack.length - 1];
for (var i=0; i<stack.length; i++) {
td[i][1] = stack[i] * fact;
}
this.gridData = td;
};
$.jqplot.MeterGaugeRenderer.prototype.makeGridData = function(data, plot) {
var stack = [];
var td = [];
var sa = this.startAngle;
for (var i=0; i<data.length; i++){
stack.push(data[i][1]);
td.push([data[i][0]]);
if (i>0) {
stack[i] += stack[i-1];
}
}
var fact = Math.PI*2/stack[stack.length - 1];
for (var i=0; i<stack.length; i++) {
td[i][1] = stack[i] * fact;
}
return td;
};
function getnmt(pos, interval, fact) {
var temp;
for (var i=pos.length-1; i>=0; i
temp = interval/(pos[i] * Math.pow(10, fact));
if (temp == 4 || temp == 5) {
return temp - 1;
}
}
return null;
}
// called with scope of series
$.jqplot.MeterGaugeRenderer.prototype.draw = function (ctx, gd, options) {
var i;
var opts = (options != undefined) ? options : {};
// offset and direction of offset due to legend placement
var offx = 0;
var offy = 0;
var trans = 1;
if (options.legendInfo && options.legendInfo.placement == 'inside') {
var li = options.legendInfo;
switch (li.location) {
case 'nw':
offx = li.width + li.xoffset;
break;
case 'w':
offx = li.width + li.xoffset;
break;
case 'sw':
offx = li.width + li.xoffset;
break;
case 'ne':
offx = li.width + li.xoffset;
trans = -1;
break;
case 'e':
offx = li.width + li.xoffset;
trans = -1;
break;
case 'se':
offx = li.width + li.xoffset;
trans = -1;
break;
case 'n':
offy = li.height + li.yoffset;
break;
case 's':
offy = li.height + li.yoffset;
trans = -1;
break;
default:
break;
}
}
// pre-draw so can get it's dimensions.
if (this.label) {
this._labelElem = $('<div class="<API key>" style="position:absolute;">'+this.label+'</div>');
this.canvas._elem.after(this._labelElem);
}
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
var cw = ctx.canvas.width;
var ch = ctx.canvas.height;
if (this.padding == null) {
this.padding = Math.round(Math.min(cw, ch)/30);
}
var w = cw - offx - 2 * this.padding;
var h = ch - offy - 2 * this.padding;
if (this.labelPosition == 'bottom' && this.label) {
h -= this._labelElem.outerHeight(true);
}
var mindim = Math.min(w,h);
var d = mindim;
if (!this.diameter) {
if (this.semiCircular) {
if ( w >= 2*h) {
if (!this.ringWidth) {
this.ringWidth = 2*h/35;
}
this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
this.diameter = 2 * (h - 2*this.innerPad);
}
else {
if (!this.ringWidth) {
this.ringWidth = w/35;
}
this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
this.diameter = w - 2*this.innerPad - this.ringWidth - this.padding;
}
// center taking into account legend and over draw for gauge bottom below hub.
// this will be center of hub.
this._center = [(cw - trans * offx)/2 + trans * offx, (ch + trans*offy - this.padding - this.ringWidth - this.innerPad)];
}
else {
if (!this.ringWidth) {
this.ringWidth = d/35;
}
this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
this.innerPad = 0;
this.diameter = d - this.ringWidth;
// center in middle of canvas taking into account legend.
// will be center of hub.
this._center = [(cw-trans*offx)/2 + trans * offx, (ch-trans*offy)/2 + trans * offy];
}
}
if (this._labelElem && this.labelPosition == 'bottom') {
this._center[1] -= this._labelElem.outerHeight(true);
}
this._radius = this.diameter/2;
this.tickSpacing = 6000/this.diameter;
if (!this.hubRadius) {
this.hubRadius = this.diameter/18;
}
this.shadowOffset = 0.5 + this.ringWidth/9;
this.shadowWidth = this.ringWidth*1;
this.tickPadding = 3 + Math.pow(this.diameter/20, 0.7);
this.tickOuterRadius = this._radius - this.ringWidth/2 - this.tickPadding;
this.tickLength = (this.showTicks) ? this._radius/13 : 0;
if (this.ticks.length == 0) {
// no ticks, lets make some.
var max = this.max,
min = this.min,
setmax = this.setmax,
setmin = this.setmin,
ti = (max - min) * this.tickSpacing / this.span;
var tf = Math.floor(parseFloat((Math.log(ti)/Math.log(10)).toFixed(11)));
var tp = (ti/Math.pow(10, tf));
(tp > 2 && tp <= 2.5) ? tp = 2.5 : tp = Math.ceil(tp);
var t = this.tickPositions;
var tpindex, nt;
for (i=0; i<t.length; i++) {
if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
ti = t[i]*Math.pow(10, tf);
tpindex = i;
}
}
for (i=0; i<t.length; i++) {
if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
ti = t[i]*Math.pow(10, tf);
nt = Math.ceil((max - min) / ti);
}
}
// both max and min are free
if (setmax && setmin) {
var tmin = (min > 0) ? min - min % ti : min - min % ti - ti;
if (!this.forceZero) {
var diff = Math.min(min - tmin, 0.8*ti);
var ntp = Math.floor(diff/t[tpindex]);
if (ntp > 1) {
tmin = tmin + t[tpindex] * (ntp-1);
if (parseInt(tmin, 10) != tmin && parseInt(tmin-t[tpindex], 10) == tmin-t[tpindex]) {
tmin = tmin - t[tpindex];
}
}
}
if (min == tmin) {
min -= ti;
}
else {
// tmin should always be lower than dataMin
if (min - tmin > 0.23*ti) {
min = tmin;
}
else {
min = tmin -ti;
nt += 1;
}
}
nt += 1;
var tmax = min + (nt - 1) * ti;
if (max >= tmax) {
tmax += ti;
nt += 1;
}
// now tmax should always be mroe than dataMax
if (tmax - max < 0.23*ti) {
tmax += ti;
nt += 1;
}
this.max = max = tmax;
this.min = min;
this.tickInterval = ti;
this.numberTicks = nt;
var it;
for (i=0; i<nt; i++) {
it = parseFloat((min+i*ti).toFixed(11));
this.ticks.push([it, it]);
}
this.max = this.ticks[nt-1][1];
this.tickFactor = tf;
// determine number of minor ticks
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
if (!this.numberMinorTicks) {
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
}
}
// max is free, min is fixed
else if (setmax) {
var tmax = min + (nt - 1) * ti;
if (max >= tmax) {
max = tmax + ti;
nt += 1;
}
else {
max = tmax;
}
this.tickInterval = this.tickInterval || ti;
this.numberTicks = this.numberTicks || nt;
var it;
for (i=0; i<this.numberTicks; i++) {
it = parseFloat((min+i*this.tickInterval).toFixed(11));
this.ticks.push([it, it]);
}
this.max = this.ticks[this.numberTicks-1][1];
this.tickFactor = tf;
// determine number of minor ticks
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
if (!this.numberMinorTicks) {
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
}
}
// not setting max or min
if (!setmax && !setmin) {
var range = this.max - this.min;
tf = Math.floor(parseFloat((Math.log(range)/Math.log(10)).toFixed(11))) - 1;
var nticks = [5,6,4,7,3,8,9,10,2], res, numticks, nonSigDigits=0, sigRange;
// check to see how many zeros are at the end of the range
if (range > 1) {
var rstr = String(range);
if (rstr.search(/\./) == -1) {
var pos = rstr.search(/0+$/);
nonSigDigits = (pos > 0) ? rstr.length - pos - 1 : 0;
}
}
sigRange = range/Math.pow(10, nonSigDigits);
for (i=0; i<nticks.length; i++) {
res = sigRange/(nticks[i]-1);
if (res == parseInt(res, 10)) {
this.numberTicks = nticks[i];
this.tickInterval = range/(this.numberTicks-1);
this.tickFactor = tf+1;
break;
}
}
var it;
for (i=0; i<this.numberTicks; i++) {
it = parseFloat((this.min+i*this.tickInterval).toFixed(11));
this.ticks.push([it, it]);
}
// determine number of minor ticks
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
if (!this.numberMinorTicks) {
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
}
if (!this.numberMinorTicks) {
this.numberMinorTicks = 1;
var nums = [4, 5, 3, 6, 2];
for (i=0; i<5; i++) {
var temp = this.tickInterval/nums[i];
if (temp == parseInt(temp, 10)) {
this.numberMinorTicks = nums[i]-1;
break;
}
}
}
}
}
var r = this._radius,
sa = this.startAngle,
ea = this.endAngle,
pi = Math.PI,
hpi = Math.PI/2;
if (this.semiCircular) {
var overAngle = Math.atan(this.innerPad/r),
outersa = this.outerStartAngle = sa - overAngle,
outerea = this.outerEndAngle = ea + overAngle,
hubsa = this.hubStartAngle = sa - Math.atan(this.innerPad/this.hubRadius*2),
hubea = this.hubEndAngle = ea + Math.atan(this.innerPad/this.hubRadius*2);
ctx.save();
ctx.translate(this._center[0], this._center[1]);
ctx.lineJoin = "round";
ctx.lineCap = "round";
// draw the innerbackground
ctx.save();
ctx.beginPath();
ctx.fillStyle = this.background;
ctx.arc(0, 0, r, outersa, outerea, false);
ctx.closePath();
ctx.fill();
ctx.restore();
// draw the shadow
// the outer ring.
var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
ctx.save();
for (var i=0; i<this.shadowDepth; i++) {
ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
ctx.beginPath();
ctx.strokeStyle = shadowColor;
ctx.lineWidth = this.shadowWidth;
ctx.arc(0 ,0, r, outersa, outerea, false);
ctx.closePath();
ctx.stroke();
}
ctx.restore();
// the inner hub.
ctx.save();
var tempd = parseInt((this.shadowDepth+1)/2, 10);
for (var i=0; i<tempd; i++) {
ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
ctx.beginPath();
ctx.fillStyle = shadowColor;
ctx.arc(0 ,0, this.hubRadius, hubsa, hubea, false);
ctx.closePath();
ctx.fill();
}
ctx.restore();
// draw the outer ring.
ctx.save();
ctx.beginPath();
ctx.strokeStyle = this.ringColor;
ctx.lineWidth = this.ringWidth;
ctx.arc(0 ,0, r, outersa, outerea, false);
ctx.closePath();
ctx.stroke();
ctx.restore();
// draw the hub
ctx.save();
ctx.beginPath();
ctx.fillStyle = this.ringColor;
ctx.arc(0 ,0, this.hubRadius,hubsa, hubea, false);
ctx.closePath();
ctx.fill();
ctx.restore();
// draw the ticks
if (this.showTicks) {
ctx.save();
var orad = this.tickOuterRadius,
tl = this.tickLength,
mtl = tl/2,
nmt = this.numberMinorTicks,
ts = this.span * Math.PI / 180 / (this.ticks.length-1),
mts = ts/(nmt + 1);
for (i = 0; i<this.ticks.length; i++) {
ctx.beginPath();
ctx.lineWidth = 1.5 + this.diameter/360;
ctx.strokeStyle = this.ringColor;
var wps = ts*i+sa;
ctx.moveTo(-orad * Math.cos(ts*i+sa), orad * Math.sin(ts*i+sa));
ctx.lineTo(-(orad-tl) * Math.cos(ts*i+sa), (orad - tl) * Math.sin(ts*i+sa));
this._tickPoints.push([(orad-tl) * Math.cos(ts*i+sa) + this._center[0] + this.canvas._offsets.left, (orad - tl) * Math.sin(ts*i+sa) + this._center[1] + this.canvas._offsets.top, ts*i+sa]);
ctx.stroke();
ctx.lineWidth = 1.0 + this.diameter/440;
if (i<this.ticks.length-1) {
for (var j=1; j<=nmt; j++) {
ctx.beginPath();
ctx.moveTo(-orad * Math.cos(ts*i+mts*j+sa), orad * Math.sin(ts*i+mts*j+sa));
ctx.lineTo(-(orad-mtl) * Math.cos(ts*i+mts*j+sa), (orad-mtl) * Math.sin(ts*i+mts*j+sa));
ctx.stroke();
}
}
}
ctx.restore();
}
// draw the tick labels
if (this.showTickLabels) {
var elem, l, t, ew, eh, dim, maxdim=0;
var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
for (i=0; i<this.ticks.length; i++) {
elem = $('<div class="<API key>" style="position:absolute;">'+this.ticks[i][1]+'</div>');
this.canvas._elem.after(elem);
ew = elem.outerWidth(true);
eh = elem.outerHeight(true);
l = this._tickPoints[i][0] - ew * (this._tickPoints[i][2]-Math.PI)/Math.PI - tp * Math.cos(this._tickPoints[i][2]);
t = this._tickPoints[i][1] - eh/2 + eh/2 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) + tp/3 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) ;
// t = this._tickPoints[i][1] - eh/2 - eh/2 * Math.sin(this._tickPoints[i][2]) - tp/2 * Math.sin(this._tickPoints[i][2]);
elem.css({left:l, top:t});
dim = ew*Math.cos(this._tickPoints[i][2]) + eh*Math.sin(Math.PI/2+this._tickPoints[i][2]/2);
maxdim = (dim > maxdim) ? dim : maxdim;
}
}
// draw the gauge label
if (this.label && this.labelPosition == 'inside') {
var l = this._center[0] + this.canvas._offsets.left;
var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
var t = 0.5*(this._center[1] + this.canvas._offsets.top - this.hubRadius) + 0.5*(this._center[1] + this.canvas._offsets.top - this.tickOuterRadius + this.tickLength + tp) + this.labelHeightAdjust;
// this._labelElem = $('<div class="<API key>" style="position:absolute;">'+this.label+'</div>');
// this.canvas._elem.after(this._labelElem);
l -= this._labelElem.outerWidth(true)/2;
t -= this._labelElem.outerHeight(true)/2;
this._labelElem.css({left:l, top:t});
}
else if (this.label && this.labelPosition == 'bottom') {
var l = this._center[0] + this.canvas._offsets.left - this._labelElem.outerWidth(true)/2;
var t = this._center[1] + this.canvas._offsets.top + this.innerPad + + this.ringWidth + this.padding + this.labelHeightAdjust;
this._labelElem.css({left:l, top:t});
}
// draw the intervals
ctx.save();
var inner = this.intervalInnerRadius || this.hubRadius * 1.5;
if (this.intervalOuterRadius == null) {
if (this.showTickLabels) {
var outer = (this.tickOuterRadius - this.tickLength - this.tickPadding - this.diameter/8);
}
else {
var outer = (this.tickOuterRadius - this.tickLength - this.diameter/16);
}
}
else {
var outer = this.intervalOuterRadius;
}
var range = this.max - this.min;
var intrange = this.intervals[this.intervals.length-1] - this.min;
var start, end, span = this.span*Math.PI/180;
for (i=0; i<this.intervals.length; i++) {
start = (i == 0) ? sa : sa + (this.intervals[i-1][0] - this.min)*span/range;
if (start < 0) {
start = 0;
}
end = sa + (this.intervals[i][0] - this.min)*span/range;
if (end < 0) {
end = 0;
}
ctx.beginPath();
ctx.fillStyle = this.intervals[i][2];
ctx.arc(0, 0, inner, start, end, false);
ctx.lineTo(outer*Math.cos(end), outer*Math.sin(end));
ctx.arc(0, 0, outer, end, start, true);
ctx.lineTo(inner*Math.cos(start), inner*Math.sin(start));
ctx.closePath();
ctx.fill();
}
ctx.restore();
// draw the needle
var datapoint = this.data[0][1];
var dataspan = this.max - this.min;
if (this.pegNeedle) {
if (this.data[0][1] > this.max + dataspan*3/this.span) {
datapoint = this.max + dataspan*3/this.span;
}
if (this.data[0][1] < this.min - dataspan*3/this.span) {
datapoint = this.min - dataspan*3/this.span;
}
}
var dataang = (datapoint - this.min)/dataspan * this.span * Math.PI/180 + this.startAngle;
ctx.save();
ctx.beginPath();
ctx.fillStyle = this.ringColor;
ctx.strokeStyle = this.ringColor;
this.needleLength = (this.tickOuterRadius - this.tickLength) * 0.85;
this.needleThickness = (this.needleThickness < 2) ? 2 : this.needleThickness;
var endwidth = this.needleThickness * 0.4;
var dl = this.needleLength/10;
var dt = (this.needleThickness - endwidth)/10;
var templ;
for (var i=0; i<10; i++) {
templ = this.needleThickness - i*dt;
ctx.moveTo(dl*i*Math.cos(dataang), dl*i*Math.sin(dataang));
ctx.lineWidth = templ;
ctx.lineTo(dl*(i+1)*Math.cos(dataang), dl*(i+1)*Math.sin(dataang));
ctx.stroke();
}
ctx.restore();
}
else {
this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
}
};
$.jqplot.<API key> = function() {
$.jqplot.LinearAxisRenderer.call(this);
};
$.jqplot.<API key>.prototype = new $.jqplot.LinearAxisRenderer();
$.jqplot.<API key>.prototype.constructor = $.jqplot.<API key>;
// There are no traditional axes on a gauge chart. We just need to provide
// dummy objects with properties so the plot will render.
// called with scope of axis object.
$.jqplot.<API key>.prototype.init = function(options){
this.tickRenderer = $.jqplot.<API key>;
$.extend(true, this, options);
// I don't think I'm going to need _dataBounds here.
// have to go Axis scaling in a way to fit chart onto plot area
// and provide u2p and p2u functionality for mouse cursor, etc.
// for convienence set _dataBounds to 0 and 100 and
// set min/max to 0 and 100.
this._dataBounds = {min:0, max:100};
this.min = 0;
this.max = 100;
this.showTicks = false;
this.ticks = [];
this.showMark = false;
this.show = false;
};
$.jqplot.<API key> = function(){
$.jqplot.TableLegendRenderer.call(this);
};
$.jqplot.<API key>.prototype = new $.jqplot.TableLegendRenderer();
$.jqplot.<API key>.prototype.constructor = $.jqplot.<API key>;
/**
* Class: $.jqplot.<API key>
*Meter gauges don't typically have a legend, this overrides the default legend renderer.
*/
$.jqplot.<API key>.prototype.init = function(options) {
// Maximum number of rows in the legend. 0 or null for unlimited.
this.numberRows = null;
// Maximum number of columns in the legend. 0 or null for unlimited.
this.numberColumns = null;
$.extend(true, this, options);
};
// called with context of legend
$.jqplot.<API key>.prototype.draw = function() {
if (this.show) {
var series = this._series;
var ss = 'position:absolute;';
ss += (this.background) ? 'background:'+this.background+';' : '';
ss += (this.border) ? 'border:'+this.border+';' : '';
ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
// MeterGauge charts legends don't go by number of series, but by number of data points
// in the series. Refactor things here for that.
var pad = false,
reverse = false,
nr, nc;
var s = series[0];
if (s.show) {
var pd = s.data;
if (this.numberRows) {
nr = this.numberRows;
if (!this.numberColumns){
nc = Math.ceil(pd.length/nr);
}
else{
nc = this.numberColumns;
}
}
else if (this.numberColumns) {
nc = this.numberColumns;
nr = Math.ceil(pd.length/this.numberColumns);
}
else {
nr = pd.length;
nc = 1;
}
var i, j, tr, td1, td2, lt, rs, color;
var idx = 0;
for (i=0; i<nr; i++) {
if (reverse){
tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
}
else{
tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
}
for (j=0; j<nc; j++) {
if (idx < pd.length){
// debugger
lt = this.labels[idx] || pd[idx][0].toString();
color = s.color;
if (!reverse){
if (i>0){
pad = true;
}
else{
pad = false;
}
}
else{
if (i == nr -1){
pad = false;
}
else{
pad = true;
}
}
rs = (pad) ? this.rowSpacing : '0';
td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
'<div><div class="<API key>" style="border-color:'+color+';"></div>'+
'</div></td>');
td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
if (this.escapeHtml){
td2.text(lt);
}
else {
td2.html(lt);
}
if (reverse) {
td2.prependTo(tr);
td1.prependTo(tr);
}
else {
td1.appendTo(tr);
td2.appendTo(tr);
}
pad = true;
}
idx++;
}
}
}
}
return this._elem;
};
// setup default renderers for axes and legend so user doesn't have to
// called with scope of plot
function preInit(target, data, options) {
// debugger
options = options || {};
options.axesDefaults = options.axesDefaults || {};
options.legend = options.legend || {};
options.seriesDefaults = options.seriesDefaults || {};
options.grid = options.grid || {};
// only set these if there is a gauge series
var setopts = false;
if (options.seriesDefaults.renderer == $.jqplot.MeterGaugeRenderer) {
setopts = true;
}
else if (options.series) {
for (var i=0; i < options.series.length; i++) {
if (options.series[i].renderer == $.jqplot.MeterGaugeRenderer) {
setopts = true;
}
}
}
if (setopts) {
options.axesDefaults.renderer = $.jqplot.<API key>;
options.legend.renderer = $.jqplot.<API key>;
options.legend.preDraw = true;
options.grid.background = options.grid.background || 'white';
options.grid.drawGridlines = false;
options.grid.borderWidth = (options.grid.borderWidth != null) ? options.grid.borderWidth : 0;
options.grid.shadow = (options.grid.shadow != null) ? options.grid.shadow : false;
}
}
// called with scope of plot
function postParseOptions(options) {
}
$.jqplot.preInitHooks.push(preInit);
$.jqplot.<API key>.push(postParseOptions);
$.jqplot.<API key> = function() {
$.jqplot.AxisTickRenderer.call(this);
};
$.jqplot.<API key>.prototype = new $.jqplot.AxisTickRenderer();
$.jqplot.<API key>.prototype.constructor = $.jqplot.<API key>;
})(jQuery); |
#!/usr/bin/env python
from boto.logs.layer1 import <API key>
from tests.unit import <API key>
class TestDescribeLogs(<API key>):
connection_class = <API key>
def default_body(self):
return b'{"logGroups": []}'
def test_describe(self):
self.set_http_response(status_code=200)
api_response = self.service_connection.describe_log_groups()
self.assertEqual(0, len(api_response['logGroups']))
self.<API key>({})
target = self.actual_request.headers['X-Amz-Target']
self.assertTrue('DescribeLogGroups' in target) |
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"), require("./sha1"), require("./hmac"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./sha1", "./hmac"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var WordArray = C_lib.WordArray;
var C_algo = C.algo;
var MD5 = C_algo.MD5;
var EvpKDF = C_algo.EvpKDF = Base.extend({
/**
* Configuration options.
*
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
* @property {Hasher} hasher The hash algorithm to use. Default: MD5
* @property {number} iterations The number of iterations to perform. Default: 1
*/
cfg: Base.extend({
keySize: 128/32,
hasher: MD5,
iterations: 1
}),
/**
* Initializes a newly created key derivation function.
*
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
*
* @example
*
* var kdf = CryptoJS.algo.EvpKDF.create();
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
*/
init: function (cfg) {
this.cfg = this.cfg.extend(cfg);
},
/**
* Derives a key from a password.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
*
* @return {WordArray} The derived key.
*
* @example
*
* var key = kdf.compute(password, salt);
*/
compute: function (password, salt) {
// Shortcut
var cfg = this.cfg;
// Init hasher
var hasher = cfg.hasher.create();
// Initial values
var derivedKey = WordArray.create();
// Shortcuts
var derivedKeyWords = derivedKey.words;
var keySize = cfg.keySize;
var iterations = cfg.iterations;
// Generate key
while (derivedKeyWords.length < keySize) {
if (block) {
hasher.update(block);
}
var block = hasher.update(password).finalize(salt);
hasher.reset();
// Iterations
for (var i = 1; i < iterations; i++) {
block = hasher.finalize(block);
hasher.reset();
}
derivedKey.concat(block);
}
derivedKey.sigBytes = keySize * 4;
return derivedKey;
}
});
/**
* Derives a key from a password.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
* @param {Object} cfg (Optional) The configuration options to use for this computation.
*
* @return {WordArray} The derived key.
*
* @static
*
* @example
*
* var key = CryptoJS.EvpKDF(password, salt);
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
*/
C.EvpKDF = function (password, salt, cfg) {
return EvpKDF.create(cfg).compute(password, salt);
};
}());
return CryptoJS.EvpKDF;
})); |
(function($) {
var fc = $.fullCalendar;
var formatDate = fc.formatDate;
var parseISO8601 = fc.parseISO8601;
var addDays = fc.addDays;
var applyAll = fc.applyAll;
fc.sourceNormalizers.push(function(sourceOptions) {
if (sourceOptions.dataType == 'gcal' ||
sourceOptions.dataType === undefined &&
(sourceOptions.url || '').match(/^(http|https):\/\/www.google.com\/calendar\/feeds\
sourceOptions.dataType = 'gcal';
if (sourceOptions.editable === undefined) {
sourceOptions.editable = false;
}
}
});
fc.sourceFetchers.push(function(sourceOptions, start, end) {
if (sourceOptions.dataType == 'gcal') {
return transformOptions(sourceOptions, start, end);
}
});
function transformOptions(sourceOptions, start, end) {
var success = sourceOptions.success;
var data = $.extend({}, sourceOptions.data || {}, {
'start-min': formatDate(start, 'u'),
'start-max': formatDate(end, 'u'),
'singleevents': true,
'max-results': 9999
});
var ctz = sourceOptions.currentTimezone;
if (ctz) {
data.ctz = ctz = ctz.replace(' ', '_');
}
return $.extend({}, sourceOptions, {
url: sourceOptions.url.replace(/\/basic$/, '/full') + '?alt=json-in-script&callback=?',
dataType: 'jsonp',
data: data,
startParam: false,
endParam: false,
success: function(data) {
var events = [];
if (data.feed.entry) {
$.each(data.feed.entry, function(i, entry) {
var startStr = entry['gd$when'][0]['startTime'];
var start = parseISO8601(startStr, true);
var end = parseISO8601(entry['gd$when'][0]['endTime'], true);
var allDay = startStr.indexOf('T') == -1;
var url;
$.each(entry.link, function(i, link) {
if (link.type == 'text/html') {
url = link.href;
if (ctz) {
url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz;
}
}
});
if (allDay) {
addDays(end, -1); // make inclusive
}
events.push({
id: entry['gCal$uid']['value'],
title: entry['title']['$t'],
url: url,
start: start,
end: end,
allDay: allDay,
location: entry['gd$where'][0]['valueString'],
description: entry['content']['$t']
});
});
}
var args = [events].concat(Array.prototype.slice.call(arguments, 1));
var res = applyAll(success, this, args);
if ($.isArray(res)) {
return res;
}
return events;
}
});
}
// legacy
fc.gcalFeed = function(url, sourceOptions) {
return $.extend({}, sourceOptions, { url: url, dataType: 'gcal' });
};
})(jQuery); |
#include <linux/err.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/sii8240.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/wait.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/power_supply.h>
#include <video/edid.h>
#include <linux/mfd/max77693.h>
#include "../../../video/edid.h"
#include <linux/input.h>
#include "../msm_fb.h"
#include "../external_common.h"
#include "sii8240_rcp.h"
#include "sii8240_driver.h"
#include <linux/ctype.h>
#ifdef <API key>
#include <mach/scm.h>
#endif
#define <API key> 0
#ifdef CONFIG_MFD_MAX77693
#include <linux/mfd/max77693-private.h>
#endif
static struct device *sii8240_mhldev;
static struct sii8240_data *g_sii8240;
#ifdef <API key>
static struct hdcp_auth_status g_monitor_cmd;
#endif
static bool check_vbus_present(void);
struct class *sec_mhl;
EXPORT_SYMBOL(sec_mhl);
static int mhl_write_byte_reg(struct i2c_client *client, u32 offset,
u8 value)
{
int ret = <API key>(client, offset, value);
if (unlikely(ret < 0))
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
static int mhl_read_byte_reg(struct i2c_client *client, unsigned int offset,
u8 *value)
{
int ret;
if (!value)
return -EINVAL;
ret = <API key>(client, offset);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
*value = ret & 0x000000FF;
return 0;
}
static int mhl_write_block_reg(struct i2c_client *client, unsigned int offset,
u8 len, u8 *values)
{
int ret;
if (!values)
return -EINVAL;
ret = <API key>(client, offset, len, values);
if (unlikely(ret < 0))
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
static int mhl_read_block_reg(struct i2c_client *client, unsigned int offset,
u8 len, u8 *values)
{
int ret;
if (!values)
return -EINVAL;
ret = <API key>(client, offset, len, values);
if (unlikely(ret < 0))
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
static int mhl_modify_reg(struct i2c_client *i2c_client, u8 offset,
u8 mask, u8 data)
{
u8 rd;
int ret;
ret = mhl_read_byte_reg(i2c_client, offset, &rd);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
rd &= ~mask;
rd |= (data & mask);
ret = mhl_write_byte_reg(i2c_client, offset, rd);
if (unlikely(ret < 0))
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
/* NOTE: Registers are set and cleared either by 1 or 0.
* Functions calling these mhl_set_reg and mhl_clear_reg should
* take care of these register-specific details and adjust the mask
*/
static int mhl_clear_reg(struct i2c_client *client, unsigned int offset,
u8 mask)
{
int ret;
u8 value;
ret = mhl_read_byte_reg(client, offset, &value);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
value &= ~mask;
ret = mhl_write_byte_reg(client, offset, value);
if (unlikely(ret < 0))
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
static int mhl_set_reg(struct i2c_client *client, unsigned int offset,
u8 mask)
{
int ret;
u8 value;
ret = mhl_read_byte_reg(client, offset, &value);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
value |= mask;
ret = mhl_write_byte_reg(client, offset, value);
if (unlikely(ret < 0))
pr_err("[ERROR] sii8240: %s():%d offset:0x%X ret:%d\n",
__func__, __LINE__, offset, ret);
return ret;
}
#ifdef <API key>
static void <API key>(unsigned long data)
{
struct sii8240_data *sii8240;
sii8240 = dev_get_drvdata(sii8240_mhldev);
schedule_work(&sii8240-><API key>);
}
static void <API key>(struct work_struct *work)
{
int ret;
unsigned char rd_data = 0, hdcp_query = 0, status = 0;
struct sii8240_data *sii8240 = dev_get_drvdata(sii8240_mhldev);
struct i2c_client *tpi = sii8240->pdata->tpi_client;
if (sii8240->state < <API key>) {
g_monitor_cmd.a |= 0x08;
g_monitor_cmd.a &= ~(0x01);
del_timer_sync(&sii8240->mhl_timer);
scm_call(_SCM_SVC_OEM, _SCM_OEM_CMD, &g_monitor_cmd, sizeof(g_monitor_cmd), NULL, 0);
pr_info("%s() g_monitor_cmd.a = %d\n", __func__, g_monitor_cmd.a);
pr_info("%s() : mhl status = %d\n", __func__, sii8240->state);
return;
}
ret = mhl_read_byte_reg(tpi, <API key>, &hdcp_query);
if (unlikely(ret < 0)) {
pr_err ("[ERROR] %s() mhl already has been shut down\n", __func__);
return;
}
rd_data = hdcp_query & HDCP_REPEATER_MASK;
if (rd_data) {
status = hdcp_query & <API key>;
pr_info("%s() repeater extended = %d\n", __func__, status);
} else {
status = hdcp_query & <API key>;
pr_info("%s() local = %d\n", __func__, status);
}
if (status == 0) {
g_monitor_cmd.a |= 0x04;
scm_call(_SCM_SVC_OEM, _SCM_OEM_CMD, &g_monitor_cmd, sizeof(g_monitor_cmd), NULL, 0);
pr_info("%s() g_monitor_cmd.a = %d\n", __func__, g_monitor_cmd.a);
} else {
g_monitor_cmd.a |= 0x02;
scm_call(_SCM_SVC_OEM, _SCM_OEM_CMD, &g_monitor_cmd, sizeof(g_monitor_cmd), NULL, 0);
pr_info("%s() g_monitor_cmd.a = %d\n", __func__, g_monitor_cmd.a);
}
mod_timer(&sii8240->mhl_timer, jiffies + msecs_to_jiffies(1000));
}
#endif
static int set_mute_mode(struct sii8240_data *sii8240, bool mute)
{
int ret;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
pr_info("set_mute_mode : %d\n", mute);
if (mute)
ret = mhl_modify_reg(tpi, 0x1A, AV_MUTE_MASK, AV_MUTE_MASK);
else
ret = mhl_modify_reg(tpi, 0x1A, AV_MUTE_MASK, AV_MUTE_NORMAL);
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
pr_debug("sii8240: send avi infoframe %d\n", sii8240->hdmi_sink);
if (sii8240->hdmi_sink) {
ret = mhl_write_block_reg(tpi, 0x0C, SIZE_AVI_INFOFRAME,
sii8240->output_avi_data);
}
return ret;
}
#ifdef <API key>
static int sii8240_hdcp_on(struct sii8240_data *sii8240, bool hdcp_on)
{
int ret = 0;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
if (hdcp_on) {
pr_info("sii8240:HDCP On\n");
ret = mhl_modify_reg(tpi, HDCP_CTRL,
<API key> |
<API key>,
<API key> |
<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() unable to set HDCP_CTRL register\n", __func__);
return ret;
}
#ifdef <API key>
g_monitor_cmd.a = 0x01;
g_monitor_cmd.b = NULL;
g_monitor_cmd.c = NULL;
g_monitor_cmd.d = 0;
scm_call(_SCM_SVC_OEM, _SCM_OEM_CMD, &g_monitor_cmd, sizeof(g_monitor_cmd), NULL, 0);
pr_info("%s() g_monitor_cmd.a = %d\n", __func__, g_monitor_cmd.a);
#endif
} else {
pr_info("sii8240:HDCP Off\n");
ret = mhl_write_byte_reg(tpi, HDCP_CTRL, 0x00);
if (unlikely(ret < 0)) {
pr_err("[ERROR] unable to reset HDCP_CTRL register to 0x00\n");
return ret;
}
#ifdef <API key>
g_monitor_cmd.a |= 0x08;
g_monitor_cmd.a &= ~(0x01);
del_timer_sync(&sii8240->mhl_timer);
cancel_work_sync(&sii8240-><API key>);
scm_call(_SCM_SVC_OEM, _SCM_OEM_CMD, &g_monitor_cmd, sizeof(g_monitor_cmd), NULL, 0);
pr_info("%s() g_monitor_cmd.a = %d\n", __func__, g_monitor_cmd.a);
#endif
}
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
ret = set_mute_mode(sii8240, true);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() set_mute_mode fail %d\n", __func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(tpi, 0x1A,
<API key>, <API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_modify_reg fail %d\n", __func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(tpi, 0x1A,
<API key>, <API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_modify_reg fail %d\n", __func__, __LINE__);
return ret;
}
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() <API key> fail %d\n", __func__, __LINE__);
return ret;
}
return ret;
}
#endif
static int tmds_control(struct sii8240_data *sii8240, bool tmds_on)
{
int ret = 0;
#ifdef <API key>
u8 value, value2;
#endif
struct i2c_client *tpi = sii8240->pdata->tpi_client;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
pr_info("sii8240 : %s() TMDS ==> %d\n", __func__, tmds_on);
ret = mhl_modify_reg(hdmi, 0x81, 0x3F, 0x3C);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d mhl_modify_reg failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(hdmi, 0x87, 0x07, 0x03);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d mhl_modify_reg failed !\n",
__func__, __LINE__);
return ret;
}
switch (tmds_on) {
case true:
#ifdef <API key>
ret = mhl_read_byte_reg(tpi, 0x1A, &value);
if (<API key> & value) {
pr_info("sii8240: TMDS is power_down\n");
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d <API key> failed !\n",
__func__, __LINE__);
return ret;
}
} else {
ret = mhl_read_byte_reg(tpi, 0x29, &value2);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d mhl_read_byte_reg failed !\n",
__func__, __LINE__);
return ret;
}
if (LINK_STATUS_NORMAL != (LINK_STATUS_MASK & value2)) {
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d <API key> failed !\n",
__func__, __LINE__);
return ret;
}
} else if (AV_MUTE_MUTED & value) {
ret = set_mute_mode(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d set_mute_mode failed !\n",
__func__, __LINE__);
return ret;
}
}
}
#else
ret = mhl_modify_reg(tpi, 0x1A,
AV_MUTE_MASK|<API key>,
AV_MUTE_NORMAL|<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d mhl_modify_reg failed !\n",
__func__, __LINE__);
return ret;
}
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d <API key> failed !\n",
__func__, __LINE__);
return ret;
}
if (unlikely(ret < 0))
pr_err("[ERROR] %s() send AVIF fail\n", __func__);
#endif
break;
case false:
#ifdef <API key>
sii8240_hdcp_on(sii8240, false);
#endif
sii8240->regs.intr_masks.intr_tpi_mask_value = 0x0;
ret = mhl_write_byte_reg(tpi, 0x3C, 0x0);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
pr_info("<API key> |AV_MUTE_NORMAL\n");
ret = mhl_modify_reg(tpi, 0x1A,
<API key> | AV_MUTE_MASK,
<API key> | AV_MUTE_MASK);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
break;
default:
pr_err("[ERROR] %s() unknown value\n", __func__);
break;
}
return ret;
}
static int set_hdmi_mode(struct sii8240_data *sii8240, bool hdmi_mode)
{
int ret = 0;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
ret = mhl_modify_reg(hdmi, 0xA1,
<API key>,
<API key>);
if (hdmi_mode) {
ret = mhl_modify_reg(hdmi, 0xA1,
<API key>,
<API key>);
ret = mhl_modify_reg(tpi, 0x1A, <API key>,
<API key>);
ret = mhl_write_byte_reg(hdmi, 0x90, 0xF5);
ret = mhl_write_byte_reg(hdmi, 0x91, 0x06);
ret = mhl_modify_reg(hdmi, 0xA3,
<API key>,
<API key>);
} else{
ret = mhl_modify_reg(hdmi, 0xA1,
<API key>,
<API key>);
ret = mhl_modify_reg(tpi, 0x1A, <API key>,
<API key>);
ret = mhl_write_byte_reg(hdmi, 0x90, 0xFF);
ret = mhl_write_byte_reg(hdmi, 0x91, 0xFF);
ret = mhl_modify_reg(hdmi, 0xA3,
<API key>,
<API key>);
}
sii8240->hdmi_mode = hdmi_mode;
pr_info("sii8240: %s():HDMI mode = %d\n", __func__, hdmi_mode);
return ret;
}
static int sii8240_fifo_clear(struct sii8240_data *sii8240)
{
struct i2c_client *tmds = sii8240->pdata->tmds_client;
u8 data;
int ret;
pr_info("%s\n", __func__);
ret = mhl_read_byte_reg(tmds, 0xf2, &data);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() :%d mhl_read_byte_reg failed!\n", __func__, __LINE__);
return ret;
}
ret = mhl_set_reg(tmds,
TPI_DISABLE_REG, SW_TPI_EN_MASK);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() :%d mhl_set_reg failed!\n", __func__, __LINE__);
return ret;
}
if (0x20 & data) {
ret = mhl_write_byte_reg(tmds,
0xF2, data & ~0x20);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() :%d mhl_write_byte_reg failed!\n", __func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(tmds, 0xF3, 0x0F, 0x09);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() :%d mhl_modify_reg failed!\n", __func__, __LINE__);
return ret;
}
}
ret = mhl_clear_reg(tmds,
TPI_DISABLE_REG, SW_TPI_EN_MASK);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() :%d mhl_clear_reg failed!\n", __func__, __LINE__);
return ret;
}
return ret;
}
#ifdef <API key>
static int <API key>(struct sii8240_data *sii8240)
{
u8 aksv[AKSV_SIZE];
int ret, i, cnt;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
memset(aksv, 0x00, AKSV_SIZE);
cnt = 0;
ret = mhl_read_block_reg(tpi, HDCP_KEY, AKSV_SIZE, aksv);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
pr_info("sii8240: AKSV :0x%x, 0x%x, 0x%x, 0x%x, 0x%x",
aksv[0], aksv[1], aksv[2], aksv[3], aksv[4]);
for (i = 0; i < AKSV_SIZE; i++) {
while (aksv[i] != 0x00) {
if (aksv[i] & 0x01)
cnt++;
aksv[i] >>= 1;
}
}
if (cnt != NUM_OF_ONES_IN_KSV) {
pr_cont(" -> Illegal AKSV !\n");
ret = -EINVAL;
} else
pr_cont(" ->ok\n");
return ret;
}
static int <API key>(struct sii8240_data *sii8240, u8 hdcp_reg)
{
int ret = 0;
u8 rd_data = 0, hdcp_query;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
ret = mhl_read_byte_reg(tpi, <API key>, &hdcp_query);
if (unlikely(ret < 0)) {
pr_info("sii8240: HDCP query request fail\n");
return ret;
}
/*HDCP link status changed.
*Indicates a status change event in the LinkStatus (0x29) value.*/
if (hdcp_reg & <API key>) {
rd_data = hdcp_query & LINK_STATUS_MASK;
switch (rd_data) {
case LINK_STATUS_NORMAL:
pr_info("sii8240: %s():%d LINK_STATUS_NORMAL !!!\n",
__func__, __LINE__);
break;
case <API key>:
pr_info("sii8240: %s():%d <API key> !!!\n",
__func__, __LINE__);
if ((sii8240->hdmi_sink == false) && ((hdcp_query & 0x08) == 0)) {
ret = set_mute_mode(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: set_mute_mode on fail\n");
return ret;
}
}
ret = sii8240_hdcp_on(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: tmds_control on fail\n");
return ret;
}
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: <API key> fail\n");
return ret;
}
break;
case <API key>:
pr_info("sii8240: %s():%d <API key> !!!\n",
__func__, __LINE__);
sii8240_fifo_clear(sii8240);
ret = sii8240_hdcp_on(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: sii8240_hdcp_on off fail\n");
return ret;
}
msleep(100);
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: set_mute_mode on fail\n");
return ret;
}
break;
case <API key>:
pr_info("sii8240: %s():%d <API key> !!!\n",
__func__, __LINE__);
ret = sii8240_hdcp_on(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: hdcp off fail\n");
return ret;
}
break;
}
}
/*HDCP Authentication status changed.
*Indicates either that the previous authentication request has completed
*or that an Ri mismatch has caused authentication to fail.*/
if (hdcp_reg & <API key><API key>) {
rd_data = hdcp_query &
(<API key> |
<API key>);
switch (rd_data) {
case (<API key> |
<API key>):
pr_info("<API key>\n");
ret = sii8240_hdcp_on(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: sii8240_hdcp_on fail\n");
return ret;
}
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: <API key> fail\n");
return ret;
}
break;
case <API key>:
pr_info("sii8240: %s():%d <API key>\n",
__func__, __LINE__);
if (!(HDCP_REPEATER_MASK & hdcp_query)) {
ret = set_mute_mode(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: set_mute_mode off fail\n");
return ret;
}
#ifdef <API key>
if ((g_monitor_cmd.a & 0x01) == 0x01) {
/*start checking link status*/
<API key>((unsigned long) sii8240);
pr_info("%s():%d <API key>\n",
__func__, __LINE__);
} else
pr_err("[ERROR] : %s monitor state : %d\n",
__func__, g_monitor_cmd.a);
#endif
}
break;
case (<API key> |
<API key>):
pr_info("<API key>\n");
if (HDCP_REPEATER_MASK & hdcp_query) {
ret = set_mute_mode(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: set_mute_mode off fail\n");
return ret;
}
#ifdef <API key>
if ((g_monitor_cmd.a & 0x01) == 0x01) {
/*start checking link status*/
<API key>((unsigned long) sii8240);
pr_info("%s():%d <API key>\n",
__func__, __LINE__);
} else
pr_err("[ERROR] : %s monitor state : %d\n",
__func__, g_monitor_cmd.a);
#endif
}
break;
default:
pr_info("sii8240: %s():%d default !!!\n",
__func__, __LINE__);
ret = sii8240_hdcp_on(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: sii8240_hdcp_on fail\n");
return ret;
}
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s(%d) sii8240: tmds_control off fail\n", __func__, __LINE__);
return ret;
}
break;
}
}
/*Read BKSV Done.
*Various bits in 0x29 contain information acquired from BCAPs.*/
if (hdcp_reg & <API key>) {
pr_info("sii8240: %s():%d <API key>\n",
__func__, __LINE__);
set_hdmi_mode(sii8240, sii8240->hdmi_sink);
/*HDCP on*/
if (hdcp_query & <API key>) {
ret = sii8240_hdcp_on(sii8240, true);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s(%d):sii8240_hdcp_on is fail\n",
__func__, __LINE__);
return ret;
}
}
}
if (hdcp_reg & <API key>) {
pr_info("sii8240: %s():bksv err\n", __func__);
ret = sii8240_hdcp_on(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s(%d):sii8240_hdcp_on is fail\n",
__func__, __LINE__);
return ret;
}
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: tmds_control off fail\n");
return ret;
}
}
return 0;
}
#endif
static void <API key>(struct sii8240_data *sii8240, int exts)
{
u8 datablock;
u8 *edid;
int i, ieee_reg;
/* 3 = VSD */
datablock = 3;
i = 0x4;
edid = sii8240->edid + (exts * EDID_LENGTH);
for (; i < edid[2]; i += ((edid[i] & 0x1f) + 1)) {
/* Find vendor specific block */
if ((edid[i] >> 5) == datablock) {
ieee_reg = edid[i + 1] | (edid[i + 2] << 8) |
edid[i + 3] << 16;
if (ieee_reg == 0x000c03) {
pr_info("sii9240: hdmi_sink\n");
sii8240->hdmi_sink = true;
}
break;
}
}
}
static int <API key>(struct sii8240_data *sii8240, u8 edid_ext)
{
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
int ret;
int i = 0;
u8 data;
u16 temp = edid_ext << 7;
ret = mhl_set_reg(hdmi, <API key>, HW_EDID_DONE);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(hdmi, EDID_CTRL_REG,
EDID_MODE_EN | EDID_FIFO_ADDR_AUTO);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
if (!edid_ext) { /* Block-0 */
ret = mhl_write_byte_reg(hdmi, <API key>,
<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
} else { /* other EDID-extension blocks */
ret = mhl_write_byte_reg(hdmi, <API key>,
(1<<(edid_ext-1)));
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
}
/* TODO: use some completion mechanism or <API key>
* APIs instead of this loop */
do {
ret = mhl_read_byte_reg(hdmi, <API key>,
&data);
if (unlikely(ret < 0)) {
pr_info("sii8240:edid reg read failed!\n");
return ret;
}
if (data & HW_EDID_DONE) {
ret = mhl_write_byte_reg(hdmi,
<API key>,
HW_EDID_DONE);
if (unlikely(ret < 0)) {
pr_info("sii8240: edid done failed!\n");
return ret;
}
break;
}
if (data & HW_EDID_ERROR) {
ret = mhl_write_byte_reg(hdmi,
<API key>,
HW_EDID_ERROR);
if (unlikely(ret < 0)) {
pr_info("sii8240: edid read error!\n");
return ret;
}
sii8240_fifo_clear(sii8240);
ret = mhl_write_byte_reg(hdmi, <API key>,
<API key>);
if (unlikely(ret < 0)) {
pr_info("sii8240: edid block 0 failed !\n");
return ret;
}
}
usleep_range(1000, 2000);
i++;
} while (i < 100);
if (i == 100) {
pr_info("sii8240:%s():%d EDID READ timeout\n",
__func__, __LINE__);
return -ETIMEDOUT;
}
/* CHECK: 0,(1<<7),0,(1<<7) values being used in reference driver */
ret = mhl_write_byte_reg(hdmi, EDID_FIFO_ADDR_REG, (temp & 0xFF));
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
/* TODO 1: We can optimize this loop using loop unrolling techniques */
/* TODO 2: In one of the reference driver, block read is being used;
need to investiage on this */
/* SMBus allows at most 32 bytes, so read by 32 bytes 4 times. */
for (i = 0; i < EDID_LENGTH/I2C_SMBUS_BLOCK_MAX; i++) {
ret = mhl_read_block_reg(hdmi, <API key>,
I2C_SMBUS_BLOCK_MAX,
(&sii8240->edid[i*I2C_SMBUS_BLOCK_MAX +
edid_ext*EDID_LENGTH]));
if (unlikely(ret < 0)) {
pr_err("failed to read <API key>\n");
return ret;
}
}
return ret;
}
u8 <API key>(void)
{
struct sii8240_data *sii8240 = dev_get_drvdata(sii8240_mhldev);
return (sii8240->regs.peer_devcap[<API key>] >> 3) & 0x01;
}
u8 *<API key>(void)
{
pr_info("sii8240->edid : 0x%p\n", g_sii8240->edid);
return g_sii8240->edid;
}
static int sii8240_read_edid(struct sii8240_data *sii8240)
{
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
int ret;
int i;
u8 edid_exts;
sii8240->hdmi_sink = false;
memset(sii8240->edid, 0, sizeof(sii8240->edid));
/* Read EDID block-0 */
ret = <API key>(sii8240, 0);
if (unlikely(ret < 0))
goto err_exit;
edid_exts = sii8240->edid[0x7e]; /* no. of edid extensions */
/* boundary check for edid_exist: especially when mhl urgents
for disconnection, edid_exts get wrong value, in this case
reset edid_exts=1(default) to avoid kernel panic
by exceding sii8240->edid[0x7e] array boundary */
if (edid_exts >= (EDID_MAX_LENGTH/EDID_LENGTH)) {
pr_err("sii8240: edid_exts = %d is wrong\n", edid_exts);
sii8240->edid[0x7e] = 0x00;
edid_exts = 0;
}
if (!edid_exts) {
ret = mhl_write_byte_reg(hdmi, <API key>, (1<<0));
if (ret < 0)
return ret;
goto edid_populated;
}
for (i = 1; i <= edid_exts; i++) {
ret = <API key>(sii8240, i);
if (unlikely(ret < 0))
goto err_exit;
/* check hdmi mode if CEA BLOCK(ext edid[0] == 0x02) */
if (sii8240->edid[i * EDID_LENGTH] == 0x02)
<API key>(sii8240, i);
}
edid_populated:
print_hex_dump(KERN_INFO, "EDID = ",
DUMP_PREFIX_OFFSET, 16, 1,
sii8240->edid, EDID_LENGTH * (1 + edid_exts), false);
ret = mhl_write_byte_reg(hdmi, EDID_FIFO_ADDR_REG, 0);
if (unlikely(ret < 0))
goto err_exit;
/* Block operations can handle only 32 bytes at a time */
for (i = 0; i < (edid_exts+1)*(EDID_LENGTH/I2C_SMBUS_BLOCK_MAX); i++) {
ret = mhl_write_block_reg(hdmi, <API key>,
I2C_SMBUS_BLOCK_MAX,
&sii8240->edid[i*I2C_SMBUS_BLOCK_MAX]);
if (unlikely(ret < 0)) {
pr_err("sii8240: edid write block error\n");
break;
}
}
ret = mhl_write_byte_reg(hdmi, EDID_CTRL_REG, EDID_PRIME_VALID |
EDID_FIFO_ADDR_AUTO | EDID_MODE_EN);
if (unlikely(ret < 0))
goto err_exit;
ret = mhl_set_reg(sii8240->pdata->disc_client, POWER_CTRL_REG, PCLK_EN);
if (unlikely(ret < 0))
goto err_exit;
pr_info("sii8240: edid read and stored successfully\n");
return ret;
err_exit:
pr_err("@err_exit: hdmi_sink set to false\n");
sii8240->hdmi_sink = false;
return ret;
}
static int mhl_hpd_control_low(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
ret = mhl_modify_reg(tmds, UPSTRM_HPD_CTRL_REG,
<API key> |
<API key>,
<API key> |
<API key>);
if (unlikely(ret < 0)) {
pr_warn("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
sii8240->hpd_status = false;
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *disc = sii8240->pdata->disc_client;
ret = mhl_modify_reg(disc, 0x10, 0x1, 0x0);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(disc, 0x15,
<API key>, <API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(disc, 0x12, <API key> |
<API key> |
<API key> |
<API key> |
BIT_DC3_USB_EN_OFF |
<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_hpd_control_low(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *disc = sii8240->pdata->disc_client;
msleep(50);
ret = mhl_modify_reg(disc, 0x15, 0x40, 0x0);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
/*enable discovery*/
ret = mhl_modify_reg(disc, 0x10, 0x1, 0x1);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct i2c_client *disc = sii8240->pdata->disc_client;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
ret = mhl_write_byte_reg(tmds, 0x75,
sii8240->regs.intr_masks.intr1_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tmds, 0x76,
sii8240->regs.intr_masks.intr2_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tmds, 0x77,
sii8240->regs.intr_masks.intr3_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(disc, <API key>,
sii8240->regs.intr_masks.intr4_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tmds, 0x78,
sii8240->regs.intr_masks.intr5_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(cbus, <API key>,
sii8240->regs.intr_masks.<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(cbus, <API key>,
sii8240->regs.intr_masks.<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tmds, 0x7D,
sii8240->regs.intr_masks.intr7_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tmds, 0x7E,
sii8240->regs.intr_masks.intr8_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tpi, 0x3C,
sii8240->regs.intr_masks.intr_tpi_mask_value);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
return ret;
}
/* Functions for Switching Power States, Some boards use these
* functions,hence adding it here */
static int switch_to_d3(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
struct i2c_client *disc = sii8240->pdata->disc_client;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
memset(&sii8240->regs.intr_masks, 0, sizeof(sii8240->regs.intr_masks));
sii8240->regs.intr_masks.intr4_mask_value = <API key>;
sii8240->regs.link_mode = <API key>;
ret = <API key>(sii8240);
if (unlikely(ret < 0))
return ret;
ret = mhl_hpd_control_low(sii8240);
if (unlikely(ret < 0))
return ret;
ret = mhl_write_byte_reg(hdmi, MHLTX_TERM_CTRL_REG, 0xD0);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
/*Clear all interrupt*/
ret = mhl_write_byte_reg(disc, 0x21, 0xFF);
ret = mhl_write_byte_reg(tmds, 0x71, 0xFF);
ret = mhl_write_byte_reg(tmds, 0x72, 0xFF);
ret = mhl_write_byte_reg(tmds, 0x73, 0xFF);
ret = mhl_write_byte_reg(tmds, 0x74, 0xFF);
ret = mhl_write_byte_reg(tmds, 0x7B, 0xFF);
ret = mhl_write_byte_reg(tmds, 0x7C, 0xFF);
ret = mhl_write_byte_reg(tmds, 0xE0, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x8C, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x8E, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x92, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x94, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x96, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x98, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x9A, 0xFF);
ret = mhl_write_byte_reg(cbus, 0x9C, 0xFF);
ret = mhl_write_byte_reg(tpi, 0x3D, 0xFF);
msleep(50);
ret = mhl_modify_reg(disc, DISC_CTRL1_REG, 1<<0x0, 0x1);
ret = mhl_modify_reg(disc, 0x01, 1<<0x0, 0x0);
sii8240->state = <API key>;
pr_info("sii8240: D3: Power saving mode\n");
if (!sii8240->irq_enabled) {
enable_irq(sii8240->irq);
sii8240->irq_enabled = true;
pr_info("sii8240: interrupt enabled\n");
}
return 0;
}
/* toggle hpd line low for 100ms */
static void sii8240_toggle_hpd(struct i2c_client *client)
{
mhl_set_reg(client, UPSTRM_HPD_CTRL_REG, HPD_OVERRIDE_EN);
mhl_clear_reg(client, UPSTRM_HPD_CTRL_REG, <API key>);
msleep(100);
mhl_set_reg(client, UPSTRM_HPD_CTRL_REG, <API key>);
mhl_clear_reg(client, UPSTRM_HPD_CTRL_REG, HPD_OVERRIDE_EN);
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
u8 devcap[] = { DEV_STATE, DEV_MHL_VERSION, <API key>,
DEV_ADOPTER_ID_H, DEV_ADOPTER_ID_L, DEV_VID_LINK_MODE,
DEV_AUDIO_LINK_MODE, DEV_VIDEO_TYPE, DEV_LOGICAL_DEV,
DEV_BANDWIDTH, DEV_FEATURE_FLAG, DEV_DEVICE_ID_H,
DEV_DEVICE_ID_L, DEV_SCRATCHPAD_SIZE,
DEV_INT_STATUS_SIZE, DEV_RESERVED };
for (ret = 0; ret < DEVCAP_COUNT_MAX; ret++)
sii8240->regs.host_devcap[ret] = devcap[ret];
ret = mhl_write_block_reg(cbus, MHL_DEVCAP_DEVSTATE,
DEVCAP_COUNT_MAX, devcap);
if (unlikely(ret < 0))
return ret;
return 0;
}
/* Do we really need to do this? */
static int sii8240_cbus_init(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
ret = mhl_write_byte_reg(cbus, <API key>, 0xFF);
if (unlikely(ret < 0))
return ret;
ret = mhl_write_byte_reg(cbus, <API key>, 0xFF);
if (unlikely(ret < 0))
return ret;
ret = mhl_write_byte_reg(cbus, <API key>, 0xFF);
if (unlikely(ret < 0))
return ret;
ret = mhl_write_byte_reg(cbus, <API key>, 0xFF);
return ret;
}
static int sii8240_init_regs(struct sii8240_data *sii8240)
{
int ret = 0;
struct i2c_client *disc = sii8240->pdata->disc_client;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
pr_debug("sii8240_init_regs\n");
ret = mhl_modify_reg(disc, INT_CTRL_REG, 0x06, 0x00);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d failed !\n", __func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(disc, POWER_CTRL_REG, POWER_TO_D0);
if (unlikely(ret < 0))
return ret;
if (sii8240->state == STATE_MHL_CONNECTED) {
ret = mhl_modify_reg(disc, DISC_CTRL1_REG, (1<<1), 0x00);
if (unlikely(ret < 0))
return ret;
}
ret = mhl_write_byte_reg(hdmi, TMDS_CLK_EN_REG, 0x01);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(hdmi, TMDS_CH_EN_REG, 0x11);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_clear_reg(tmds, TPI_DISABLE_REG, SW_TPI_EN_MASK);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to clear register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tpi, TPI_HDCP_CTRL_REG, 0x00);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_set_reg(tpi, TPI_AV_MUTE_REG, AV_MUTE_MASK);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tpi, 0xBB, 0x76);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tpi, 0x3D, 0xFF);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(hdmi, 0xA4, 0x00);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(hdmi, 0x80,
<API key> |
<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(hdmi, 0x82, <API key>,
<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(hdmi, MHLTX_CTL4_REG, <API key> |
<API key>, sii8240->pdata->swing_level);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(cbus, 0xA7, 0x1C);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
if (sii8240->state == STATE_MHL_CONNECTED) {
ret = mhl_write_byte_reg(hdmi, MHLTX_TERM_CTRL_REG, 0x10);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_modify_reg(hdmi, MHLTX_CTL4_REG,
<API key> |
<API key>,
sii8240->pdata->swing_level);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
}
ret = mhl_write_byte_reg(hdmi, 0x87, 0x0A);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tmds, 0x85, 0x02);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(hdmi, 0x00, 0x00);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(hdmi, 0x4C, 0xD0);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(disc, 0x11, 0xA5);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(disc, DISC_CTRL6_REG, 0x11);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(disc, DISC_CTRL9_REG,
<API key> |
WAKE_DRVFLT | DISC_PULSE_PROCEED);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
if (sii8240->state == STATE_MHL_CONNECTED) {
ret = mhl_write_byte_reg(disc, DISC_CTRL1_REG, 0x27);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
} else {
ret = mhl_write_byte_reg(disc, DISC_CTRL1_REG, 0x26);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
}
ret = mhl_write_byte_reg(disc, DISC_CTRL3_REG, 0x86);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
/*This code is for disabling intr when cbus open*/
/*
ret = mhl_write_byte_reg(disc, 0x13, 0xAC);
if (unlikely(ret < 0))
return ret;
*/
ret = mhl_write_byte_reg(hdmi, <API key>,
DROP_GCP_PKT | DROP_AVI_PKT |
DROP_MPEG_PKT | DROP_SPIF_PKT |
DROP_CEA_CP_PKT | DROP_CEA_GAMUT_PKT);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
if (sii8240->state == STATE_DISCONNECTED) {
ret = mhl_modify_reg(disc, POWER_CTRL_REG,
BIT_DPD_PDIDCK_MASK, <API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return ret;
}
}
if (sii8240->state == STATE_MHL_CONNECTED) {
ret = mhl_modify_reg(disc, POWER_CTRL_REG,
BIT_DPD_PDIDCK_MASK, BIT_DPD_PDIDCK_MASK);
if (unlikely(ret < 0))
return ret;
}
/* In reference driver,HPD_OVERRIDE is enabled and HPD is set to low.
* Here, override of hpd is disabled(hence, hpd will propagate from
* downstream to upstream, no manual intervention).
*/
ret = mhl_modify_reg(tmds, UPSTRM_HPD_CTRL_REG, (1<<6), 0x0);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_hpd_control_low(sii8240);
if (sii8240->state == STATE_MHL_CONNECTED) {
ret = mhl_modify_reg(hdmi, 0xAC,
<API key> |
<API key>,
<API key> |
<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
}
ret = mhl_write_byte_reg(disc, 0x00, 0x84);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tmds, DCTL_REG, TRANSCODE_OFF |
TCLK_PHASE_INVERTED);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
#ifdef <API key>
ret = mhl_modify_reg(tmds, 0x80, <API key>,
<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
#endif
ret = sii8240_cbus_init(sii8240);
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to set register\n",
__func__, __LINE__);
return ret;
}
#ifdef <API key>
ret = <API key>(sii8240);
if (unlikely(ret < 0))
pr_err("<API key> failed !\n");
#endif/*<API key>*/
return ret;
}
/* Must call with sii8240->lock held */
static int <API key>(struct sii8240_data *sii8240, u8 req_type,
u8 offset, u8 first_data, u8 second_data)
{
int ret;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
bool write_offset = req_type & (START_READ_DEVCAP |
<API key> | START_WRITE_BURST);
bool write_first_data = req_type &
(<API key> | START_MSC_MSG);
bool write_second_data = req_type & START_MSC_MSG;
pr_debug("SEND:offset = 0x%x\n", offset);
if (write_offset)
mhl_write_byte_reg(cbus, <API key>, offset);
if (write_first_data)
mhl_write_byte_reg(cbus, MSC_SEND_DATA1_REG, first_data);
if (write_second_data)
mhl_write_byte_reg(cbus, MSC_SEND_DATA2_REG, second_data);
mutex_unlock(&sii8240->lock);
mutex_lock(&sii8240->msc_lock);
init_completion(&sii8240->cbus_complete);
mhl_write_byte_reg(cbus, <API key>, req_type);
ret = <API key>(&sii8240->cbus_complete,
msecs_to_jiffies(2000));
if (ret == 0)
pr_warn("sii8240: %s() timeout. type:0x%X, offset:0x%X\n",
__func__, req_type, offset);
mutex_unlock(&sii8240->msc_lock);
mutex_lock(&sii8240->lock);
return ret ? 0 : -EIO;
}
/* Must call with sii8240->lock held */
static int <API key>(struct sii8240_data *sii8240, u8 offset)
{
int ret;
u8 val;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
if (offset > 0xf)
return -EINVAL;
ret = <API key>(sii8240, START_READ_DEVCAP, offset, 0, 0);
if (unlikely(ret < 0))
pr_warn("msc req locked error\n");
ret = mhl_read_byte_reg(cbus, MSC_RCVD_DATA1_REG, &val);
if (unlikely(ret < 0)) {
pr_err("msc rcvd data reg read failing\n");
return ret;
}
return val;
}
static int <API key>(struct sii8240_data *sii8240,
u8 offset)
{
struct cbus_data *cbus_cmd;
int ret = 0;
cbus_cmd = kzalloc(sizeof(struct cbus_data), GFP_KERNEL);
if (!cbus_cmd) {
pr_err("sii8240: failed to allocate msc data\n");
return -ENOMEM;
}
cbus_cmd->cmd = READ_DEVCAP;
cbus_cmd->offset = offset;
cbus_cmd->use_completion = true;
init_completion(&cbus_cmd->complete);
list_add_tail(&cbus_cmd->list, &sii8240->cbus_data_list);
queue_work(sii8240->cbus_cmd_wqs, &sii8240->cbus_work);
mutex_unlock(&sii8240->lock);
ret = <API key>(&cbus_cmd->complete,
msecs_to_jiffies(2500));
mutex_lock(&sii8240->lock);
if (ret == 0)
pr_warn("sii8240: read devcap:0x%X time out !!\n", offset);
else
kfree(cbus_cmd);
return ret;
}
static int <API key>(struct sii8240_data *sii8240,
u8 command, u8 offset, u8 data)
{
struct cbus_data *cbus_cmd;
cbus_cmd = kzalloc(sizeof(struct cbus_data), GFP_KERNEL);
if (!cbus_cmd) {
pr_err("sii8240: failed to allocate msc data\n");
return -ENOMEM;
}
cbus_cmd->cmd = command;
cbus_cmd->offset = offset;
cbus_cmd->data = data; /*modified for 3.1.1.13*/
cbus_cmd->use_completion = false;
list_add_tail(&cbus_cmd->list, &sii8240->cbus_data_list);
queue_work(sii8240->cbus_cmd_wqs, &sii8240->cbus_work);
return 0;
}
bool is_key_supported(struct sii8240_data *sii8240, int keyindex)
{
u8 log_dev = DEV_LOGICAL_DEV;
if (sii8240_rcp_keymap[keyindex].key_code != KEY_UNKNOWN &&
sii8240_rcp_keymap[keyindex].key_code != KEY_RESERVED &&
(sii8240_rcp_keymap[keyindex].log_dev_type & log_dev))
return true;
else
return false;
}
static int <API key>(struct sii8240_data *sii8240)
{
struct input_dev *input;
int ret;
u8 i;
input = <API key>();
if (!input) {
pr_err("sii8240: failed to allocate input device\n");
return -ENOMEM;
}
set_bit(EV_KEY, input->evbit);
for (i = 0; i < <API key>; i++)
sii8240->keycode[i] = sii8240_rcp_keymap[i].key_code;
input->keycode = sii8240->keycode;
input->keycodemax = <API key>;
input->keycodesize = sizeof(sii8240->keycode[0]);
for (i = 0; i < <API key>; i++) {
if (is_key_supported(sii8240, i))
set_bit(sii8240->keycode[i], input->keybit);
}
input->name = "sii8240_rcp";
input->id.bustype = BUS_I2C;
input_set_drvdata(input, sii8240);
pr_debug("sii8240: registering input device\n");
ret = <API key>(input);
if (unlikely(ret < 0)) {
pr_err("sii8240: failed to register input device\n");
input_free_device(input);
return ret;
}
mutex_lock(&sii8240->input_lock);
sii8240->input_dev = input;
mutex_unlock(&sii8240->input_lock);
return 0;
}
static void rcp_key_report(struct sii8240_data *sii8240, u16 key)
{
pr_info("sii8240: report rcp key: %d\n", key);
mutex_lock(&sii8240->input_lock);
if (sii8240->input_dev) {
input_report_key(sii8240->input_dev, key, 1);
input_report_key(sii8240->input_dev, key, 0);
input_sync(sii8240->input_dev);
}
mutex_unlock(&sii8240->input_lock);
}
static void <API key>(struct sii8240_data *sii8240, u8 key)
{
if (key == 0x7E) {
pr_info("sii8240 : MHL switch event sent : 1\n");
switch_set_state(&sii8240->mhl_event_switch, 1);
}
if (key < <API key> && is_key_supported(sii8240, key)) {
/* Report the key */
rcp_key_report(sii8240, sii8240->keycode[key]);
/* Send the RCP ack */
<API key>(sii8240, START_MSC_MSG, 0, MSG_RCPK, key);
} else {
/* Send a RCPE(RCP Error Message) to Peer followed by RCPK with
* old key-code so that initiator(TV) can recognize
* failed key code */
<API key>(sii8240, START_MSC_MSG,
0, MSG_RCPE, RCPE_KEY_INVALID);
}
}
static void <API key>(struct sii8240_data *sii8240, u8 key)
{
u8 err = RAPK_NO_ERROR;
switch (key) {
case RAP_POLL:
/* no action, just sent to elicit an ACK */
break;
case RAP_CONTENT_ON:
/*TODO:A source shall not enable its TMDS unless it has received
* SET_HPD,sees active RxSense(RSEN) and sees PATH_EN{Sink} = 1
*/
tmds_control(sii8240, true);
break;
case RAP_CONTENT_OFF:
/*TODO: With MHL 1.2 Specs,For a Source, CONTENT_OFF does not
* necessarily means that TMDS output is disabled */
tmds_control(sii8240, false);
break;
default:
pr_warn("sii8240: unrecognized RAP code %u\n", key);
err = RAPK_UNRECOGNIZED;
}
<API key>(sii8240, START_MSC_MSG, 0, MSG_RAPK, err);
}
static void sii8240_power_down(struct sii8240_data *sii8240)
{
pr_info("%s()\n", __func__);
mhl_hpd_control_low(sii8240);
if (sii8240->irq_enabled) {
disable_irq_nosync(sii8240->irq);
sii8240->irq_enabled = false;
pr_info("sii8240: interrupt disabled\n");
}
sii8240->state = STATE_DISCONNECTED;
cancel_work_sync(&sii8240->cbus_work);
cancel_work_sync(&sii8240->redetect_work);
cancel_work_sync(&sii8240->avi_control_work);
del_timer_sync(&sii8240->avi_check_timer);
if (sii8240->pdata->power)
sii8240->pdata->power(0);
sii8240->muic_state = MHL_DETTACHED;
<API key>->sii8240_connected = false;
}
static int <API key>(struct sii8240_data *sii8240,
u8 offset, u8 data)
{
int ret = -1;
ret = <API key>
(sii8240, <API key>, offset, data, 0);
if (unlikely(ret < 0))
return ret;
if (offset == <API key> &&
data == <API key>) {
/* notify the peer by updating the status register too */
<API key>(sii8240, <API key>,
CBUS_MHL_INTR_REG_0,
MHL_INT_DCAP_CHG, 0);
}
return ret;
}
static bool check_vbus_present(void) {
bool ret = true;
union <API key> value;
psy_do_property("sec-charger", get, <API key>, value);
pr_info("sec-charger : %d\n", value.intval);
if (value.intval == <API key>
|| value.intval == <API key>)
ret = false;
pr_info("VBUS : %s in %s\n", ret ? "IN" : "OUT", __func__);
return ret;
}
static void <API key>(struct sii8240_data *sii8240)
{
u8 plim, dev_cat;
u16 adopter_id;
u8 *peer_devcap = sii8240->regs.peer_devcap;
if ((peer_devcap[<API key>] & 0xF0) >= 0x20) {
dev_cat = peer_devcap[MHL_DEVCAP_DEV_CAT];
pr_info("sii8240: DEV_CAT 0x%x\n", dev_cat);
if (((dev_cat >> 4) & 0x1) == 1) {
plim = ((dev_cat >> 5) & 0x3);
pr_info("sii8240 : PLIM 0x%x\n", plim);
if (sii8240->pdata->vbus_present)
sii8240->pdata->vbus_present(false, plim);
}
} else if ((peer_devcap[<API key>] & 0xF0) == 0x10) {
adopter_id = peer_devcap[<API key>] |
peer_devcap[<API key>] << 8;
pr_info("sii8240: adopter id:%d, reserved:%d\n",
adopter_id, peer_devcap[MHL_DEVCAP_RESERVED]);
if (adopter_id == 321 && peer_devcap[MHL_DEVCAP_RESERVED] == 2) {
if (sii8240->pdata->vbus_present)
sii8240->pdata->vbus_present(false, 0x01);
}
} else {
pr_err("sii8240:%s MHL version error - 0x%X\n", __func__,
peer_devcap[<API key>]);
}
}
static void sii8240_msc_event(struct work_struct *work)
{
int ret = -1;
struct cbus_data *data, *next;
struct sii8240_data *sii8240 = container_of(work, struct sii8240_data,
cbus_work);
mutex_lock(&sii8240->cbus_lock);
mutex_lock(&sii8240->lock);
<API key>(data, next, &sii8240->cbus_data_list, list) {
if (sii8240->cbus_abort) {
pr_warn("sii8240 : abort received. so wait 2secs\n");
sii8240->cbus_abort = false;
msleep(2000);
}
if (sii8240->state != STATE_DISCONNECTED) {
switch (data->cmd) {
case MSC_MSG:
switch (data->offset) {
case MSG_RCP:
pr_debug("sii8240: RCP KEY CODE:%d\n",
data->data);
<API key>(sii8240,
data->data);
break;
case MSG_RAP:
pr_debug("sii8240: RAP Arrived\n");
<API key>(sii8240,
data->data);
break;
case MSG_RCPK:
pr_debug("sii8240: RCPK Arrived\n");
break;
case MSG_RCPE:
pr_debug("sii8240: RCPE Arrived\n");
break;
case MSG_RAPK:
pr_debug("sii8240: RAPK Arrived\n");
break;
default:
pr_debug("sii8240: MAC error\n");
break;
}
break;
case READ_DEVCAP:
pr_debug("sii8240: READ_DEVCAP : 0x%X\n",
data->offset);
ret = <API key>(sii8240,
data->offset);
if (unlikely(ret < 0)) {
pr_err("error offset%d\n",
data->offset);
break;
}
sii8240->regs.peer_devcap[data->offset] = ret;
if (data->use_completion)
complete(&data->complete);
if (data->offset == MHL_DEVCAP_DEV_CAT)
<API key>(sii8240);
ret = 0;
break;
case SET_INT:
pr_info("sii8240: msc_event: SET_INT\n");
ret = <API key>(sii8240,
<API key>,
data->offset, data->data, 0);
if (unlikely(ret < 0))
pr_err("sii8240: error set_int req\n");
break;
case WRITE_STAT:
pr_info("sii8240: msc_event: WRITE_STAT\n");
ret = <API key>(sii8240,
data->offset, data->data);
if (unlikely(ret < 0))
pr_err("sii8240: error write_stat\n");
break;
case WRITE_BURST:
/* TODO: */
break;
case GET_STATE:
case GET_VENDOR_ID:
case SET_HPD:
case CLR_HPD:
case GET_MSC_ERR_CODE:
case GET_SC3_ERR_CODE:
case GET_SC1_ERR_CODE:
case GET_DDC_ERR_CODE:
ret = <API key>(sii8240,
START_MISC_CMD, data->offset,
data->data, 0);
if (unlikely(ret < 0))
pr_err("sii8240: offset%d,data=%d\n",
data->offset, data->data);
break;
default:
pr_info("sii8240: invalid msc command\n");
break;
}
}
list_del(&data->list);
if (!data->use_completion)
kfree(data);
}
mutex_unlock(&sii8240->lock);
mutex_unlock(&sii8240->cbus_lock);
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
mhl_modify_reg(hdmi, <API key>,
<API key>,
<API key>);
ret = mhl_read_block_reg(hdmi,
0xB8, INFO_BUFFER, sii8240->aviInfoFrame);
print_hex_dump(KERN_ERR, "sii8240: avi_info = ",
DUMP_PREFIX_NONE, 16, 1,
sii8240->aviInfoFrame, INFO_BUFFER, false);
return ret;
}
#ifdef MHL_2X_3D
static int <API key>(struct sii8240_data *sii8240)
{
int ret;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
ret = mhl_modify_reg(hdmi,
0xA3, <API key>,
<API key>);
ret = mhl_write_block_reg(hdmi, 0xB8,
INFO_BUFFER,
sii8240-><API key>);
return ret;
}
/*Video Format Data in 3D support *
* 0x00: burst id_h *
* 0x01: burst id_l *
* 0x02: check_sum *
* 0x03: total_entry *
* 0x04: sequence index *
* 0x05: number of entry *
* 0x06: vdi_0_h *
* 0x07: vdi_0_l *
* 0x08: vdi_1_h *
* 0x09: vdi_1_l *
* 0x0A: vdi_2_h *
* 0x0B: vdi_2_l *
* 0x0C: vdi_3_h *
* 0x0D: vdi_3_l *
* 0x0E: vdi_4_h *
* 0x0F: vdi_4_l */
static int <API key>(struct sii8240_data *sii8240,
u8 tot_ent, u8 num_ent, u8 *data)
{
struct i2c_client *tmds = sii8240->pdata->tmds_client;
int ret = 0;
if ((sii8240->vic_data.tot_ent - (sii8240->vic_data.num_ent + num_ent))
>= 0) {
pr_info("num_ent : %d\n", num_ent);
memcpy(&sii8240->vic_data.vdi[sii8240->vic_data.num_ent],
data, (2*num_ent));
sii8240->vic_data.num_ent += num_ent;
}
if (sii8240->vic_data.num_ent == sii8240->vic_data.tot_ent) {
if ((sii8240->hpd_status == true) &&
(sii8240->dtd_data.num_ent == sii8240->dtd_data.tot_ent)) {
/*make HPD be high*/
ret = mhl_modify_reg(tmds, UPSTRM_HPD_CTRL_REG,
<API key>|
<API key>,
<API key>|
<API key>);
}
pr_info("HPD high\n");
}
return ret;
}
static int <API key>(struct sii8240_data *sii8240,
u8 tot_ent, u8 num_ent, u8 *data)
{
struct i2c_client *tmds = sii8240->pdata->tmds_client;
int ret = 0;
if ((sii8240->dtd_data.tot_ent -
(sii8240->dtd_data.num_ent + num_ent)) >= 0) {
memcpy(&sii8240->dtd_data.vdi[sii8240->dtd_data.num_ent],
data, (2*num_ent));
sii8240->dtd_data.num_ent += num_ent;
}
if (sii8240->dtd_data.num_ent == sii8240->dtd_data.tot_ent) {
if ((sii8240->hpd_status == true) &&
(sii8240->vic_data.num_ent == sii8240->vic_data.tot_ent)) {
/*make HPD be high*/
ret = mhl_modify_reg(tmds, UPSTRM_HPD_CTRL_REG,
<API key>|
<API key>,
<API key>|
<API key>);
}
pr_info("HPD high\n");
}
return ret;
}
#endif
static int <API key>(struct sii8240_data *sii8240)
{
struct i2c_client *cbus = sii8240->pdata->cbus_client;
int ret = 0;
u8 scratchpad[16];
#ifdef MHL_2X_3D
u16 burst_id = 0;
#endif
memset(scratchpad, 0x00, 16);
ret = mhl_read_block_reg(cbus, <API key>, 16, scratchpad);
#ifdef MHL_2X_3D
burst_id = scratchpad[B_ID_H];
burst_id <<= 8;
burst_id |= scratchpad[B_ID_L];
switch (burst_id) {
case MHL_3D_VIC_CODE:
pr_info("vid code\n");
/*Initiation of first scratchpad*/
if (scratchpad[SEQ] == 0x01) {
sii8240->vic_data.tot_ent = scratchpad[TOT_ENT];
sii8240->vic_data.num_ent = 0;
}
<API key>(sii8240, scratchpad[TOT_ENT],
scratchpad[NUM_ENT], &scratchpad[VDI_0_H]);
break;
case MHL_3D_DTD_CODE:
pr_info("dtd code\n");
if (scratchpad[SEQ] == 0x01) {
sii8240->dtd_data.tot_ent = scratchpad[TOT_ENT];
sii8240->dtd_data.num_ent = 0;
}
<API key>(sii8240, scratchpad[TOT_ENT],
scratchpad[NUM_ENT], &scratchpad[VDI_0_H]);
break;
default:
pr_warn("invalid burst_id\n");
break;
}
#endif
return ret;
}
static int <API key>(struct sii8240_data *sii8240,
u8 *data)
{
u8 checksum = 0;
u8 i = 0;
u8 infoframedata[INFO_BUFFER];
memcpy(infoframedata, data, INFO_BUFFER);
for (i = 0; i < INFO_BUFFER; i++)
checksum += infoframedata[i];
checksum = 0x100 - checksum;
return checksum;
}
static void <API key>(struct sii8240_data *sii8240)
{
u8 checksum = 0;
u8 i;
/*these are set by the hardware*/
checksum = 0x82 + 0x02 + 0x0D;
for (i = 1; i < SIZE_AVI_INFOFRAME; i++)
checksum += sii8240->output_avi_data[i];
checksum = 0x100 - checksum;
sii8240->output_avi_data[0] = checksum;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0, i;
for (i = 0 ; i < INFO_BUFFER ; i++) {
if (sii8240-><API key>[i] !=
sii8240->aviInfoFrame[i])
ret = 1;
}
if (ret == 1) {
pr_info("%s() <API key>
print_hex_dump(KERN_ERR, "sii8240: avi_info = ",
DUMP_PREFIX_NONE, 16, 1,
sii8240-><API key>, INFO_BUFFER, false);
pr_info("%s() aviInfoFrame
print_hex_dump(KERN_ERR, "sii8240: avi_info = ",
DUMP_PREFIX_NONE, 16, 1,
sii8240->aviInfoFrame, INFO_BUFFER, false);
}
return ret;
}
static void <API key>
(struct sii8240_data *sii8240, bool pack_pixel)
{
int ret = 0;
u8 colorspace = 0;
u8 input_range = 0;
u8 data;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
if (pack_pixel)
pr_info("sii8240: %s(): pack_pixel\n", __func__);
else
pr_info("sii8240: %s(): none pack_pixel\n", __func__);
if (pack_pixel)
/*Video stream is encoded in PackedPixel mode*/
data = <API key>;
else
data = <API key>;
ret = mhl_modify_reg(tmds, 0x4A, <API key>, data);
if (pack_pixel)
/*The incoming HDMI pixel clock is multiplied
by 2 for PackedPixel mode*/
data = <API key>;
else
data = <API key>;
ret = mhl_modify_reg(hdmi, 0x83,
<API key>, data);
if (pack_pixel)
/*the outgoing MHL link clock is
configured as PackedPixel clock*/
data = 0x60;
else
data = 0xA0;
ret = mhl_write_byte_reg(hdmi, 0x85, data);
/*[INFO_DATA1] 0x00 : nodata
0x20 : YCbCr 4:2:2
0x40 : YCbCr 4:4:4
0x60 ; Future*/
colorspace = (sii8240-><API key>
[INFO_CHECKSUM + INFO_DATA1] & 0x60);
switch (colorspace) {
case 0x00:
pr_info("RGB :");
colorspace = 0x00;
/*[INFO_DATA3] 0x00 : Default
0x04 : Limited Range
0x08 : Full Range
0x0C : Reserved*/
input_range = (sii8240-><API key>
[INFO_CHECKSUM + INFO_DATA3] & 0x0C);
break;
case 0x20:
pr_info("YCBCR 422 :");
colorspace = 0x02;
input_range = (sii8240-><API key>
[INFO_CHECKSUM + INFO_DATA5] & 0xC0);
break;
case 0x40:
pr_info("YCBCR 444 :");
input_range = (sii8240-><API key>
[INFO_CHECKSUM + INFO_DATA5] & 0xC0);
colorspace = 0x01;
break;
case 0x60:
pr_info("FUTURE :");
colorspace = 0x00;
input_range = (sii8240-><API key>
[INFO_CHECKSUM + INFO_DATA5] & 0xC0);
break;
}
/*Input range checking*/
switch (input_range) {
case 0x00:
pr_info("input_range AUTO\n");
input_range = 0x00;
break;
case 0x04:
pr_info("input_range Limited\n");
input_range = 0x08;
break;
case 0x08:
pr_info("input_range FULL\n");
input_range = 0x04;
break;
case 0x0C:
pr_info("input_range Reserved\n");
input_range = 0x00;
break;
default:
pr_info("input_range default\n");
input_range = 0x00;
break;
}
if (!sii8240->hdmi_sink) {
colorspace = 0x00;
input_range = <API key>;
}
/*The output video encoding is forced to YCbCr 4:2:2
by setting the input video format and
output video format at TPI:0x09 and TPI:0x0A.*/
data = colorspace|input_range;
ret = mhl_modify_reg(tpi, 0x09,
<API key> |
<API key>, data);
if (pack_pixel)
colorspace = 0x02;
data = colorspace|input_range;
ret = mhl_modify_reg(tpi, 0x0A,
<API key> |
<API key>, data);
return;
}
static int <API key>(struct sii8240_data *sii8240)
{
/*set packed pixcel information*/
memset(sii8240->support_mhl_timing.avi_infoframe,
0x00, HDMI_VFRMT_MAX);
sii8240->support_mhl_timing.
avi_infoframe[HDMI_PATTERN_GEN] = 1;
sii8240->support_mhl_timing.
avi_infoframe[<API key>] = 1;
sii8240->support_mhl_timing.
avi_infoframe[<API key>] = 1;
#ifdef MHL_2X_3D
sii8240->support_mhl_timing.
avi_infoframe[<API key>] = 1;
sii8240->support_mhl_timing.
avi_infoframe[<API key>] = 1;
sii8240->support_mhl_timing.
avi_infoframe[<API key>] = 1;
sii8240->support_mhl_timing.
avi_infoframe[<API key>] = 1;
#endif
sii8240->support_mhl_timing.
avi_infoframe[<API key>] = 1;
return 1;
}
static bool <API key>(struct sii8240_data *sii8240, u8 vic)
{
bool ret = false;
/*get packed pixcel information*/
if (sii8240->support_mhl_timing.avi_infoframe[vic] == 1)
ret = true;
switch (vic) {
case <API key>:
case <API key>:
case <API key>:
case <API key>:
sii8240->input_3d_format = <API key>;
ret = false;
break;
default:
break;
}
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0;
bool patternGen = false;
u8 vic;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
pr_info("<API key>\n");
ret = <API key>(sii8240, sii8240->aviInfoFrame);
if (ret) {
pr_err("sii8240: avi info checksum is fail\n");
set_hdmi_mode(sii8240, false);
return ret;
}
/*AVI information was changed newly and checksum is also no problems*/
set_hdmi_mode(sii8240, true);
/* VIC = video format Identification Code
16 : 1920x1080p 60Hz
31 : 1920x1080p 50HZ
0 : no VIC format in CEA document */
vic = sii8240->aviInfoFrame[INFO_VIC];
patternGen = <API key>(sii8240, vic);
if (patternGen) {
pr_info("sii8240: over 75MHz\n");
sii8240->regs.link_mode &= ~<API key>;
sii8240->regs.link_mode |= <API key>;
} else {
sii8240->regs.link_mode &= ~<API key>;
sii8240->regs.link_mode |= <API key>;
}
pr_info("vic value = %d, linkmode = 0x%x\n",
vic, sii8240->regs.link_mode);
<API key>(sii8240, <API key>,
<API key>,
sii8240->regs.link_mode, 0);
/*Copy avi information to current variable*/
memcpy(&sii8240-><API key>,
&sii8240->aviInfoFrame, INFO_BUFFER);
memcpy(&sii8240->output_avi_data[0],
&sii8240->aviInfoFrame[INFO_CHECKSUM], SIZE_AVI_INFOFRAME);
if (patternGen) {
/*Because of the 16bits carried in PackedPixel mode,
if the incoming video encoding is RGB of YCbCr 4:4:4,
the video must be converted to YCbCr 4:2:2*/
sii8240->output_avi_data[INFO_DATA1] &= ~0x60;
sii8240->output_avi_data[INFO_DATA1] |= 0x20;
}
<API key>(sii8240);
/*HDMI input clock is under 75MHz*/
if (vic <= <API key> && vic != 0) {
pr_err("sii8240: under 75MHz\n");
mhl_write_byte_reg(hdmi, 0x4C, 0xD0);
}
/*HDMI input clock is over 75MHz*/
if (patternGen)
mhl_write_byte_reg(hdmi, 0x4C, 0xD0);
<API key>(sii8240, patternGen);
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret;
/*struct i2c_client *tpi = sii8240->pdata->tpi_client; */
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
pr_info("<API key>\n");
ret = <API key>(sii8240, sii8240->aviInfoFrame);
if (ret) {
pr_err("sii8240: avi info checksum is fail\n");
set_hdmi_mode(sii8240, false);
return ret;
}
/*AVI information was changed newly and checksum is also no problems*/
sii8240->regs.link_mode &= ~<API key>;
sii8240->regs.link_mode |= <API key>;
ret = <API key>(sii8240, <API key>,
<API key>, sii8240->regs.link_mode, 0);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d <API key> fail\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(hdmi, 0x4C, 0xD0);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d mhl_write_byte_reg\n",
__func__, __LINE__);
return ret;
}
/*bypass avi info*/
memcpy(&sii8240-><API key>,
&sii8240->aviInfoFrame, INFO_BUFFER);
pr_info("%s() change <API key>\n", __func__);
print_hex_dump(KERN_ERR, "sii8240: avi_info = ",
DUMP_PREFIX_NONE, 16, 1,
sii8240-><API key>, INFO_BUFFER, false);
memcpy(&sii8240->output_avi_data[0],
&sii8240->aviInfoFrame[INFO_CHECKSUM], SIZE_AVI_INFOFRAME);
<API key>(sii8240);
<API key>(sii8240, false);
return ret;
}
static void <API key>(struct work_struct *work)
{
struct sii8240_data *sii8240 = container_of(work, struct sii8240_data,
avi_control_work);
struct i2c_client *tmds = sii8240->pdata->tmds_client;
#ifdef <API key>
struct i2c_client *tpi = sii8240->pdata->tpi_client;
#endif
int ret = 0;
#ifdef MHL_2X_3D
struct cbus_data *cbus_cmd;
bool feature_3d = false;
#endif
mutex_lock(&sii8240->lock);
if (sii8240->avi_work == true) {
sii8240->avi_work = false;
switch (sii8240->avi_cmd) {
case HPD_HIGH_EVENT:
pr_info("***HPD high\n");
<API key>->sii8240_connected = true;
<API key>->hpd_feature(1);
/*reading devcap, but we can move this function
any other first settup*/
memset(sii8240->regs.peer_devcap, 0x0,
sizeof(sii8240->regs.peer_devcap));
/*We will read minimum devcap information*/
<API key>(sii8240,
<API key>);
<API key>(sii8240,
<API key>);
pr_info("sii8240: HPD high - MHL ver=0x%x, linkmode = 0x%x\n",
sii8240->regs.peer_devcap[<API key>],
sii8240->regs.peer_devcap[<API key>]);
ret = sii8240_read_edid(sii8240);
if (unlikely(ret < 0)) {
pr_info("sii8240: edid read failed\n");
goto exit;
}
if (((sii8240->regs.peer_devcap[<API key>] & 0xF0) >= 0x20)
&& (sii8240->regs.peer_devcap[<API key>] &
(<API key> |
<API key>)) &&
sii8240->hdmi_sink == true) {
pr_info("CEA_NEW_AVI MHL RX Ver.2.x\n");
#ifdef MHL_2X_3D
feature_3d = true;
/*Request 3D interrupt to sink device.
* To do msc command*/
cbus_cmd = kzalloc(sizeof(struct cbus_data),
GFP_KERNEL);
if (!cbus_cmd) {
pr_err("sii8240: failed to allocate cbus data\n");
goto exit;
}
cbus_cmd->cmd = SET_INT;
cbus_cmd->offset = CBUS_MHL_INTR_REG_0;
cbus_cmd->data = MHL_INT_3D_REQ;
list_add_tail(&cbus_cmd->list,
&sii8240->cbus_data_list);
queue_work(sii8240->cbus_cmd_wqs, &sii8240->cbus_work);
#endif
} else {
/* TODO: This case MHL 1.0*/
pr_info("CEA_NEW_AVI MHL RX Ver.1.x, Pixel 60\n");
}
if (sii8240->hdmi_sink) {
sii8240->regs.intr_masks.intr7_mask_value =
<API key>|<API key>;
mhl_write_byte_reg(tmds, 0x7D,
sii8240->regs.intr_masks.intr7_mask_value);
sii8240->regs.intr_masks.intr8_mask_value =
<API key>|<API key>;
ret = mhl_write_byte_reg(tmds, 0x7E,
sii8240->regs.intr_masks.intr8_mask_value);
if (unlikely(ret < 0))
pr_warn("[ERROR] : %s():%d failed !\n",
__func__, __LINE__);
sii8240->regs.intr_masks.intr5_mask_value =
<API key> | <API key>;
ret = mhl_write_byte_reg(tmds, 0x78,
sii8240->regs.intr_masks.intr5_mask_value);
if (unlikely(ret < 0))
pr_warn("[ERROR]: %s():%d failed !\n",
__func__, __LINE__);
}
/*make HPD be high*/
ret = mhl_modify_reg(tmds, UPSTRM_HPD_CTRL_REG,
<API key> |
<API key>,
<API key> |
<API key>);
if (unlikely(ret < 0))
pr_warn("sii8240: %s():%d failed !\n",
__func__, __LINE__);
if (sii8240->hdmi_sink == false) {
#ifdef <API key>
sii8240->regs.intr_masks.intr_tpi_mask_value =
<API key><API key> |
<API key> |
<API key> |
<API key> |
<API key>;
ret = mhl_write_byte_reg(tpi, 0x3C,
sii8240->regs.intr_masks.intr_tpi_mask_value);
#endif
ret = set_hdmi_mode(sii8240, false);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s():%d failed\n",
__func__, __LINE__);
goto exit;
}
ret = tmds_control(sii8240, true);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s():%d failed !\n",
__func__, __LINE__);
goto exit;
}
}
break;
case CEA_NEW_AVI:
pr_info("***sii8240: CEA_NEW_AVI\n");
/*HDMI does not read EDID yet*/
pr_info("sii8240: %s():%d CEA_NEW_AVI MHL RX Ver.2.x\n",
__func__, __LINE__);
#ifdef <API key>
sii8240->regs.intr_masks.intr_tpi_mask_value =
<API key><API key> |
<API key> |
<API key> |
<API key> |
<API key>;
ret = mhl_write_byte_reg(tpi, 0x3C,
sii8240->regs.intr_masks.intr_tpi_mask_value);
#endif
/*hdmi sink but avi => hdmi mode*/
ret = set_hdmi_mode(sii8240, true);
if (unlikely(ret < 0)) {
pr_debug("sii8240: %s():%d failed!\n",
__func__, __LINE__);
goto exit;
}
if (((sii8240->regs.peer_devcap[<API key>] & 0xF0)
>= 0x20) &&
(sii8240->regs.peer_devcap[<API key>] &
<API key>) &&
(sii8240->regs.peer_devcap[<API key>] &
<API key>)) {
ret = <API key>(sii8240);
} else
ret = <API key>(sii8240);
ret = tmds_control(sii8240, true);
break;
default:
pr_info("default cmd\n");
break;
}
sii8240->avi_work = false;
}
sii8240->avi_cmd = AVI_CMD_NONE;
exit:
mutex_unlock(&sii8240->lock);
}
static void <API key>(struct work_struct *work)
{
struct sii8240_data *sii8240 = container_of(work, struct sii8240_data,
redetect_work);
mutex_lock(&sii8240->lock);
pr_info("sii8240: detection restarted\n");
if (sii8240->state == STATE_DISCONNECTED) {
pr_err("sii8240 : already powered off\n");
goto err_exit;
}
sii8240->state = STATE_DISCONNECTED;
sii8240->rgnd = RGND_UNKNOWN;
mhl_hpd_control_low(sii8240);
sii8240->pdata->hw_reset();
if (sii8240_init_regs(sii8240) < 0) {
pr_err("sii8240: redetection failed\n");
goto err_exit;
}
if (<API key>(sii8240) < 0) {
pr_err("sii8240: set mhl timing failed\n");
goto err_exit;
}
if (switch_to_d3(sii8240) < 0)
pr_info("sii8240: switch to d3 error\n");
err_exit:
mutex_unlock(&sii8240->lock);
}
static void <API key>(struct sii8240_data *sii8240)
{
pr_info("power_down_process");
sii8240_power_down(sii8240);
if (sii8240->mhl_connected == true) {
pr_info("still mhl cable connected!!");
sii8240->state = STATE_MHL_CONNECTED;
sii8240->pdata->power(1);
sii8240->cbus_abort = false;
sii8240->hdmi_sink = false;
queue_work(sii8240->cbus_cmd_wqs,
&sii8240->redetect_work);
}
}
static int <API key>(struct notifier_block *this,
unsigned long event, void *ptr)
{
int ret;
struct sii8240_data *sii8240 = container_of(this, struct sii8240_data,
mhl_nb);
int handled = MHL_CON_UNHANDLED;
if (event == sii8240->muic_state) {
pr_info("sii8240 : Same muic event, Ignored!\n");
return MHL_CON_UNHANDLED;
}
if (event) {
pr_info("sii8240:detection started\n");
sii8240->mhl_connected = true;
} else {
pr_info("sii8240:disconnection\n");
if (sii8240->pdata->vbus_present)
sii8240->pdata->vbus_present(false, -1);
sii8240->mhl_connected = false;
mutex_lock(&sii8240->lock);
goto power_down;
}
pr_info("lock M--->%d\n", __LINE__);
mutex_lock(&sii8240->lock);
/* Reset flags,state of mhl */
sii8240->state = STATE_DISCONNECTED;
sii8240->rgnd = RGND_UNKNOWN;
sii8240->muic_state = MHL_ATTACHED;
sii8240->cbus_abort = false;
/* Set the board configuration so the SiI8240 has access to the
* external connector
*/
sii8240->pdata->power(1);
msleep(20);
sii8240->pdata->hw_reset();
ret = sii8240_init_regs(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() - sii8240_init_regs error\n",
__func__);
goto unhandled;
}
sii8240->hdmi_sink = false;
<API key>(sii8240);
ret = switch_to_d3(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR]sii8240: switch_to_d3 !\n");
goto unhandled;
}
mutex_unlock(&sii8240->lock);
ret = wait_event_timeout(sii8240->wq, (sii8240->rgnd != RGND_UNKNOWN),
msecs_to_jiffies(<API key>));
mutex_lock(&sii8240->lock);
if (ret == 0) {
pr_err("[ERROR] no RGND interrupt\n");
goto unhandled;
}
if (sii8240->rgnd == RGND_UNKNOWN) {
pr_err("[ERROR] RGND is UNKNOWN\n");
goto unhandled;
}
mutex_unlock(&sii8240->lock);
pr_info("sii8240: waiting for connection to be established\n");
ret = wait_event_timeout(sii8240->wq,
(sii8240->state == <API key> ||
sii8240->state == <API key> ||
sii8240->state == <API key>),
msecs_to_jiffies(<API key>));
mutex_lock(&sii8240->lock);
if (sii8240->state == STATE_DISCONNECTED)
goto unhandled;
if (sii8240->state == <API key>)
pr_info("sii8240: connection established\n");
mutex_unlock(&sii8240->lock);
pr_err("sii8240: detection_callback return !\n");
return MHL_CON_HANDLED;
unhandled:
pr_info("sii8240: Detection failed and additional information about sii8240");
if (sii8240->state == STATE_DISCONNECTED)
pr_cont(" (timeout)");
else if (sii8240->state == STATE_CBUS_UNSTABLE)
pr_cont(" (cbus unstable)");
else if (sii8240->state == <API key>)
pr_cont(" (Non-MHL device(USB?))");
pr_cont("\n");
power_down:
mutex_unlock(&sii8240->lock);
if (sii8240->mhl_event_switch.state == 1) {
pr_info("sii8240:MHL switch event sent : 0\n");
switch_set_state(&sii8240->mhl_event_switch, 0);
}
<API key>(sii8240);
return handled;
}
static int <API key>(struct sii8240_data *sii8240, u8 intr)
{
u8 rgnd;
int ret = 0;
struct i2c_client *disc = sii8240->pdata->disc_client;
pr_info("<API key> : 0x%X\n", intr);
if (intr & RGND_RDY_INT) {
ret = mhl_read_byte_reg(disc, DISC_RGND_REG, &rgnd);
if (unlikely(ret < 0)) {
pr_err("sii8240: RGND read error: %d\n", ret);
return ret;
}
pr_err("DISC_RGND_REG = 0x%x\n", rgnd);
switch (rgnd & RGND_INTP_MASK) {
case RGND_INTP_OPEN:
pr_info("sii8240: RGND Open\n");
sii8240->rgnd = RGND_OPEN;
sii8240->state = <API key>;
break;
case RGND_INTP_1K:
pr_info("sii8240: RGND 1K\n");
sii8240->rgnd = RGND_1K;
sii8240->state = STATE_MHL_CONNECTED;
break;
case RGND_INTP_2K:
pr_info("sii8240: RGND 2K\n");
sii8240->rgnd = RGND_2K;
break;
case RGND_INTP_SHORT:
pr_info("sii8240: RGND Short\n");
break;
};
} else if (intr & CBUS_UNSTABLE_INT) {
pr_err("sii8240: CBUS unstable\n");
sii8240->state = STATE_CBUS_UNSTABLE;
}
return ret;
}
static int <API key>(struct sii8240_data *sii8240, u8 intr)
{
int ret = 0;
u8 hpd;
u8 temp;
u8 cbus_intr[4], cbus_status[4];
struct i2c_client *cbus = sii8240->pdata->cbus_client;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct cbus_data *data;
ret = mhl_read_block_reg(cbus, <API key>, 4,
cbus_status);
if (unlikely(ret < 0))
goto err_exit;
ret = mhl_read_block_reg(cbus, CBUS_MHL_INTR_REG_0, 4, cbus_intr);
if (unlikely(ret < 0))
goto err_exit;
if (intr & MSC_CMD_DONE) {
pr_info("sii8240: MSC Command done.ACK Received\n");
complete(&sii8240->cbus_complete);
}
if (intr & MSC_HPD_RCVD) {
pr_debug("sii8240: Downstream HPD Changed\n");
ret = mhl_read_byte_reg(cbus, <API key>, &hpd);
if (unlikely(ret < 0))
goto err_exit;
ret = mhl_read_byte_reg(tmds, UPSTRM_HPD_CTRL_REG, &temp);
if (unlikely(ret < 0))
goto err_exit;
if (DOWNSTREAM_HPD_MASK & hpd) {
pr_info("sii8240: SET_HPD received\n");
if (temp & HPD_OVERRIDE_EN) {
/* TODO:If HPD is overriden,//enable HPD_OUT bit
in upstream register */
sii8240->hpd_status = true;
sii8240->avi_cmd = HPD_HIGH_EVENT;
sii8240->avi_work = true;
queue_work(sii8240->avi_cmd_wqs,
&sii8240->avi_control_work);
/*Initiate sii8240's information variables*/
memset(&sii8240-><API key>,
0x00, INFO_BUFFER);
memset(&sii8240->output_avi_data,
0x00, SIZE_AVI_INFOFRAME);
memset(&sii8240-><API key>,
0x00, INFO_BUFFER);
}
} else {
pr_debug("sii8240: CLR_HPD received\n");
if (temp & HPD_OVERRIDE_EN) {
/* TODO:If HPD is overriden,clear HPD_OUT bit
upstream register */
sii8240->hpd_status = false;
mhl_modify_reg(tmds, UPSTRM_HPD_CTRL_REG,
<API key>|
<API key>,
<API key>|
<API key>);
/*Disable interrupt*/
sii8240->regs.intr_masks.intr7_mask_value = 0;
sii8240->regs.intr_masks.intr8_mask_value = 0;
mhl_write_byte_reg(tmds, 0x7D,
sii8240->regs.intr_masks.intr7_mask_value);
mhl_write_byte_reg(tmds, 0x7E,
sii8240->regs.intr_masks.intr8_mask_value);
set_mute_mode(sii8240, true);
tmds_control(sii8240, false);
}
if (sii8240->mhl_event_switch.state == 1) {
pr_info("sii8240: MHL switch event sent :0\n");
switch_set_state(&sii8240->mhl_event_switch, 0);
}
}
}
if (intr & MSC_WRITE_STAT_RCVD) {
bool path_en_changed = false;
pr_info("sii8240: WRITE_STAT received\n");
sii8240->cbus_ready = cbus_status[0] & <API key>;
if (!(sii8240->regs.link_mode & <API key>) &&
(<API key> & cbus_status[1])) {
/* PATH_EN{SOURCE} = 0 and PATH_EN{SINK}= 1 */
sii8240->regs.link_mode |= <API key>;
path_en_changed = true;
if (unlikely(ret < 0))
return ret;
} else if ((sii8240->regs.link_mode & <API key>)
&& !(<API key> & cbus_status[1])) {
/* PATH_EN{SOURCE} = 1 and PATH_EN{SINK}= 0 */
sii8240->regs.link_mode &= ~<API key>;
path_en_changed = true;
ret = tmds_control(sii8240, false);
if (unlikely(ret < 0))
return ret;
}
if (sii8240->cbus_ready) {
pr_info("sii8240: device capability cbus_ready\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: MHL_VERSION read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: MHL_ADOPTER_ID_H read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: MHL_ADOPTER_ID_L read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
MHL_DEVCAP_RESERVED, 0) < 0)
pr_info("sii8240: MHL_RESERVED read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
MHL_DEVCAP_DEV_CAT, 0) < 0)
pr_info("sii8240: DEV_CAT read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: FEATURE_FLAG read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: VID_LINK_MODE read fail\n");
}
if (path_en_changed)
<API key>(sii8240, WRITE_STAT,
<API key>,
sii8240->regs.link_mode);
}
if (intr & MSC_MSG_RCVD) {
pr_debug("sii8240: MSC_MSG received\n");
data = kzalloc(sizeof(struct cbus_data), GFP_KERNEL);
if (!data) {
pr_err("sii8240: failed to allocate cbus data\n");
ret = -ENOMEM;
goto err_exit;
}
data->cmd = MSC_MSG;
mhl_read_byte_reg(cbus, <API key>, &data->offset);
mhl_read_byte_reg(cbus, <API key>, &data->data);
list_add_tail(&data->list, &sii8240->cbus_data_list);
queue_work(sii8240->cbus_cmd_wqs, &sii8240->cbus_work);
}
if (intr & <API key>)
pr_debug("sii8240: WRITE_BURST received\n");
if (intr & MSC_SET_INT_RCVD) {
pr_info("sii8240: SET_INT received\n");
if (cbus_intr[0] & MHL_INT_DCAP_CHG) {
pr_info("sii8240: device capability changed\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: MHL_VERSION read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: MHL_ADOPTER_ID_H read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: MHL_ADOPTER_ID_L read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
MHL_DEVCAP_RESERVED, 0) < 0)
pr_info("sii8240: MHL_RESERVED read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
MHL_DEVCAP_DEV_CAT, 0) < 0)
pr_info("sii8240: DEVCAP_DEV_CAT read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: FEATURE_FLAG read fail\n");
if (<API key>(sii8240, READ_DEVCAP,
<API key>, 0) < 0)
pr_info("sii8240: VID_LINK_MODE read fail\n");
}
if (cbus_intr[0] & MHL_INT_DSCR_CHG) {
pr_debug("sii8240: scratchpad register change done\n");
<API key>(sii8240);
}
if (cbus_intr[0] & MHL_INT_REQ_WRT) {
pr_info("sii8240: request-to-write received\n");
data = kzalloc(sizeof(struct cbus_data), GFP_KERNEL);
if (!data) {
pr_err("sii8240: failed to allocate cbus data\n");
ret = -ENOMEM;
goto err_exit;
}
data->cmd = SET_INT;
data->offset = CBUS_MHL_INTR_REG_0;
data->data = MHL_INT_GRT_WRT;
list_add_tail(&data->list, &sii8240->cbus_data_list);
queue_work(sii8240->cbus_cmd_wqs, &sii8240->cbus_work);
}
if (cbus_intr[0] & MHL_INT_GRT_WRT)
pr_debug("sii8240: grant-to-write received\n");
if (cbus_intr[1] & MHL_INT_EDID_CHG) {
sii8240_toggle_hpd(cbus);
/*Initiate sii8240's information variables*/
sii8240->hpd_status = false;
memset(&sii8240-><API key>,
0x00, INFO_BUFFER);
memset(&sii8240->output_avi_data,
0x00, SIZE_AVI_INFOFRAME);
memset(&sii8240-><API key>,
0x00, INFO_BUFFER);
/*Disable interrupt*/
sii8240->regs.intr_masks.intr7_mask_value = 0;
sii8240->regs.intr_masks.intr8_mask_value = 0;
mhl_write_byte_reg(tmds, 0x7D,
sii8240->regs.intr_masks.intr7_mask_value);
mhl_write_byte_reg(tmds, 0x7E,
sii8240->regs.intr_masks.intr8_mask_value);
set_mute_mode(sii8240, true);
tmds_control(sii8240, false);
/*After HPD toggle, Need to setup again*/
sii8240->hpd_status = true;
sii8240->avi_cmd = HPD_HIGH_EVENT;
sii8240->avi_work = true;
queue_work(sii8240->avi_cmd_wqs,
&sii8240->avi_control_work);
/*Wake up avi control thread*/
}
}
if (intr & MSC_MSG_NACK_RCVD)
pr_debug(KERN_ERR "NACK received\n");
err_exit:
return ret;
}
/*Need to check*/
static int <API key>(struct sii8240_data *sii8240, u8 intr)
{
int ret = 0;
u8 error;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
if (intr == 0)
return ret;
if (intr & SEND_ERROR_INT) {
ret = mhl_read_byte_reg(cbus, MSC_SEND_ERROR_REG, &error);
if (unlikely(ret < 0))
goto err_exit;
if (error & CMD_ABORT) {
pr_warn("sii8240: [sender] Command Aborted\n");
sii8240->cbus_abort = true;
}
if (error & CMD_UNDEF_OPCODE)
pr_warn("sii8240: [sender] Undefined Opcode\n");
if (error & CMD_TIMEOUT)
pr_warn("sii8240: [sender] Timeout\n");
if (error & CMD_RCVD_PROT_ERR)
pr_warn("sii8240: [sender] Protocol Error\n");
if (error & CMD_MAX_FAIL)
pr_warn("sii8240:[sender]Failed MAX retries\n");
}
if (intr & RECD_ERROR_INT) {
ret = mhl_read_byte_reg(cbus, MSC_RECVD_ERROR_REG, &error);
if (unlikely(ret < 0))
goto err_exit;
if (error & CMD_ABORT) {
pr_warn("sii8240: [receiver] Command Aborted\n");
sii8240->cbus_abort = true;
}
if (error & CMD_UNDEF_OPCODE)
pr_warn("sii8240: [receiver] Undefined Opcode\n");
if (error & CMD_TIMEOUT)
pr_warn("sii8240: [reciever] Timeout\n");
if (error & CMD_RCVD_PROT_ERR)
pr_warn("sii8240: [reciever] Protocol Error\n");
if (error & CMD_MAX_FAIL)
pr_warn("sii8240:[reciever]Command Failed After MAX\n");
}
if (intr & RECD_DDC_ABORT_INT) {
/* TODO: We used to terminate connection after
* DDC_ABORT had been received.Need more details on how to
* handle this interrupt with MHL 1.2 specs. */
pr_warn("sii8240: DDC_ABORT received\n");
}
err_exit:
return ret;
}
static int <API key>(struct sii8240_data *sii8240,
u8 int1, u8 cbus_con_st)
{
int ret = 0;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
struct i2c_client *disc = sii8240->pdata->disc_client;
struct cbus_data *cbus_cmd;
sii8240->cbus_connected = (cbus_con_st & 0x01);
if ((int1 & BIT_INTR4_MHL_EST) && (sii8240->cbus_connected)) {
sii8240->state = <API key>;
ret = mhl_hpd_control_low(sii8240);
if (unlikely(ret < 0))
pr_warn("[WARN]sii8240: %s():%d failed !\n",
__func__, __LINE__);
/*Must be set to 1.*/
ret = mhl_write_byte_reg(hdmi, MHLTX_TERM_CTRL_REG,
<API key>);
/*Enable discovery*/
pr_info("sii8240:Enable discovery\n");
ret = mhl_modify_reg(disc, 0x10, 0x01, 0x01);
memset(&sii8240->regs.intr_masks, 0,
sizeof(sii8240->regs.intr_masks));
sii8240->regs.intr_masks.intr1_mask_value =
BIT_INTR1_HPD_CHG;
sii8240->regs.intr_masks.intr4_mask_value =
(<API key> | <API key>);
sii8240->regs.intr_masks.<API key> =
(<API key> |
BIT_CBUS_HPD_RCVD |
<API key> |
<API key> |
<API key> |
<API key> |
<API key>);
sii8240->regs.intr_masks.<API key> =
(BIT_CBUS_DDC_ABRT | BIT_CBUS_CEC_ABRT | BIT_CBUS_CMD_ABORT);
ret = <API key>(sii8240);
/*CBUS command*/
cbus_cmd = kzalloc(sizeof(struct cbus_data), GFP_KERNEL);
if (!cbus_cmd) {
pr_err("sii8240: failed to allocate cbus data\n");
return -ENOMEM;
}
cbus_cmd->cmd = WRITE_STAT;
cbus_cmd->offset = <API key>;
cbus_cmd->data = <API key>;
list_add_tail(&cbus_cmd->list, &sii8240->cbus_data_list);
pr_debug("schedule_work: cbus_work\n");
queue_work(sii8240->cbus_cmd_wqs, &sii8240->cbus_work);
} else if (int1 & <API key>) {
pr_info("sii8240: discovery failed\n");
sii8240->state = <API key>;
} else if (sii8240->cbus_connected) {
sii8240->state = <API key>;
memset(&sii8240->regs.intr_masks, 0,
sizeof(sii8240->regs.intr_masks));
sii8240->regs.intr_masks.intr4_mask_value =
(BIT_INTR4_MHL_EST|<API key>);
sii8240->regs.intr_masks.<API key> =
(BIT_CBUS_DDC_ABRT | BIT_CBUS_CEC_ABRT |
BIT_CBUS_CMD_ABORT);
ret = <API key>(sii8240);
}
return ret;
}
static int sii8240_cbus_irq(struct sii8240_data *sii8240)
{
struct i2c_client *cbus = sii8240->pdata->cbus_client;
int ret;
u8 cbus_con_st = 0, msc_intr = 0,
msc_intr_en = 0, msc_err_intr = 0, msc_err_en = 0;
ret = mhl_read_byte_reg(cbus, <API key>, &cbus_con_st);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s, %d\n", __func__, __LINE__);
return ret;
}
ret = mhl_read_byte_reg(cbus, CBUS_MSC_INTR_REG, &msc_intr);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s, %d\n", __func__, __LINE__);
return ret;
}
ret = mhl_read_byte_reg(cbus, <API key>, &msc_intr_en);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s, %d\n", __func__, __LINE__);
return ret;
}
ret = mhl_read_byte_reg(cbus, <API key>, &msc_err_intr);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s, %d\n", __func__, __LINE__);
return ret;
}
ret = mhl_read_byte_reg(cbus, <API key>,
&msc_err_en);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s, %d\n", __func__, __LINE__);
return ret;
}
if (msc_err_intr)
mhl_write_byte_reg(cbus, <API key>, msc_err_intr);
if (msc_intr)
mhl_write_byte_reg(cbus, CBUS_MSC_INTR_REG, msc_intr);
/*Handling of Cbus error*/
ret = <API key>(sii8240, msc_err_intr);
if (unlikely(ret < 0))
pr_warn("[WARN]sii8240: %s():%d failed !\n",
__func__, __LINE__);
ret = <API key>(sii8240, msc_intr);
if (unlikely(ret < 0))
pr_warn("[WARN]sii8240: %s():%d failed !\n",
__func__, __LINE__);
return ret;
}
#ifdef <API key>
static void <API key>(unsigned long data)
{
struct sii8240_data *sii8240 = (struct sii8240_data *) data;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
int ret = 0;
u8 checksum = 0;
if (((sii8240->aviInfoFrame[0] == 0x82) &&
(sii8240->aviInfoFrame[1] == 0x02) &&
(sii8240->aviInfoFrame[2] == 0x0D)) ||
(sii8240->hdmi_sink == false)) {
pr_info("Sii8240: %s() return AVIF callback\n", __func__);
return;
} else {
pr_info("Sii8240: AVIF getting problem??\n");
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d failed !\n",
__func__, __LINE__);
return;
}
if ((sii8240->aviInfoFrame[0] != 0x82) ||
(sii8240->aviInfoFrame[1] != 0x02) ||
(sii8240->aviInfoFrame[2] != 0x0D)) {
pr_debug("Sii8240: NO AVIF.:%d\n", __LINE__);
ret = mhl_modify_reg(tpi, 0x1A,
<API key>,
<API key>);
if (unlikely(ret < 0)) {
pr_info("sii8240: %s():%d failed !\n",
__func__, __LINE__);
return;
}
ret = mhl_modify_reg(tpi, 0x1A,
<API key>,
<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d Fail to write register\n",
__func__, __LINE__);
return;
}
return;
}
if (<API key>(sii8240)) {
pr_info("sii8240: AVI change! %d\n", __LINE__);
checksum = <API key>
(sii8240, sii8240->aviInfoFrame);
if (checksum) {
pr_err("sii8240: %s():%d checksum error!\n",
__func__, __LINE__);
return;
}
memcpy(&sii8240-><API key>,
&sii8240->aviInfoFrame, INFO_BUFFER);
pr_info("Sii8240: avi change and tmds off\n");
ret = tmds_control(sii8240, false);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d failed !\n",
__func__, __LINE__);
return;
}
sii8240->avi_cmd = CEA_NEW_AVI;
sii8240->avi_work = true;
queue_work(sii8240->avi_cmd_wqs,
&sii8240->avi_control_work);
} else
pr_debug("sii8240: %s():%d NO AVI change!!\n",
__func__, __LINE__);
}
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
if (sii8240->r281 == 0) {
pr_info("Sii8240: %s():%d (r281 == 0)\n", __func__, __LINE__);
ret = mhl_read_byte_reg(hdmi, 0x81, &sii8240->r281);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d failed\n",
__func__, __LINE__);
return ret;
}
}
pr_info("Sii8240: %s():%d r281 data: %02x\n",
__func__, __LINE__, sii8240->r281);
ret = mhl_write_byte_reg(hdmi, 0x81, (sii8240->r281 & (~0x3F)));
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d failed\n",
__func__, __LINE__);
return ret;
}
if (sii8240->r281 & 0x3F) {
/* there is default value...*/
pr_info("Sii8240: there is default value.\n");
} else {
sii8240->r281 = 0xFF;
pr_info("Sii8240: there is non default value.\n");
}
ret = mhl_modify_reg(tmds, 0x80, <API key>,
<API key>);
if (unlikely(ret < 0))
pr_info("sii8240: %s():%d failed !\n", __func__, __LINE__);
return ret;
}
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
if (sii8240->r281 != 0) {
pr_info("Sii8240: r281 == 0x%02x\n", sii8240->r281);
ret = mhl_modify_reg(tmds, 0x80, <API key>, 0x0);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d failed\n",
__func__, __LINE__);
return ret;
}
if (sii8240->r281 == 0xFF)
sii8240->r281 = 0;
ret = mhl_write_byte_reg(hdmi, 0x81, sii8240->r281);
if (unlikely(ret < 0)) {
pr_err("sii8240: %s():%d failed\n",
__func__, __LINE__);
return ret;
}
sii8240->r281 = 0;
}
mod_timer(&sii8240->avi_check_timer, jiffies + msecs_to_jiffies(200));
return ret;
}
#endif
static int <API key>(struct sii8240_data *sii8240)
{
int ret = 0;
u8 upstatus, ceainfo;
u8 checksum = 0;
#ifdef <API key>
u8 value;
struct i2c_client *tpi = sii8240->pdata->tpi_client;
#endif
struct i2c_client *tmds = sii8240->pdata->tmds_client;
pr_info("<API key>\n");
#ifdef <API key>
/*TO do*/
ret = mhl_read_byte_reg(tpi, HDCP_INTR , &value);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed\n",
__func__, __LINE__);
return ret;
}
ret = mhl_write_byte_reg(tpi, HDCP_INTR , value);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed\n",
__func__, __LINE__);
return ret;
}
if (value && sii8240->hpd_status) {
ret = <API key>(sii8240, value);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed\n",
__func__, __LINE__);
return ret;
}
}
#endif
mhl_read_byte_reg(tmds, US_INTR, &upstatus);
mhl_read_byte_reg(tmds, 0x7C, &ceainfo);
if (upstatus)
mhl_write_byte_reg(tmds, US_INTR, upstatus);
if (ceainfo)
mhl_write_byte_reg(tmds, 0x7C, ceainfo);
if ((sii8240->regs.intr_masks.intr7_mask_value & <API key>)
&& (upstatus & <API key>))
pr_info("sii8240: NO_AVI_INFORMATION\n");
if (upstatus & <API key>) {
pr_info("sii8240: <API key>\n");
#ifdef MHL_2X_3D
sii8240->input_3d_format = NON_3D_VIDEO;
mhl_modify_reg(tmds, 0x51, <API key>,
<API key>);
#endif
}
if (upstatus & BIT_INTR7_CP_NEW_CP)
pr_info("sii8240: BIT_INTR7_CP_NEW_CP\n");
if (upstatus & <API key>) {
pr_info("sii8240: <API key>\n");
ret = set_mute_mode(sii8240, true);
if (unlikely(ret < 0))
pr_info("sii8240: get avi info error\n");
}
if (upstatus & <API key>) {
pr_info("sii8240: <API key>\n");
ret = set_mute_mode(sii8240, false);
if (unlikely(ret < 0))
pr_info("sii8240: get avi info error\n");
}
#ifdef MHL_2X_3D
/*VSI 3D*/
if ((ceainfo & <API key>) &&
(sii8240->hpd_status == true)) {
<API key>(sii8240);
ret = <API key>(sii8240,
sii8240-><API key>);
if (ret) {
pr_err("vendor specific checksum failing\n");
return 0;
}
print_hex_dump(KERN_ERR, "vsi = ",
DUMP_PREFIX_NONE, 16, 1,
sii8240-><API key>, 16, false);
if ((sii8240-><API key>[7] & 0xE0) == 0x40) {
if ((sii8240-><API key>[8]
& 0xF0) == 0x00) {
/*frame packing 3D*/
pr_info("sii8240: frame packing 3D\n");
sii8240->input_3d_format = FRAME_PACKING_3D;
ret = mhl_modify_reg(tmds, 0x51,
<API key>,
<API key>);
} else {
/*non frame packing 3D*/
pr_info("sii8240:non frame packing 3D\n");
sii8240->input_3d_format = <API key>;
ret = mhl_modify_reg(tmds, 0x51,
<API key>,
<API key>);
}
}
}
#endif
/*AVI InfoFrame*/
if ((ceainfo & <API key>) &&
(sii8240->hpd_status == true)) {
pr_info("sii8240 : <API key>\n");
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_info("sii8240 : get avi info error\n");
return ret;
}
if (<API key>(sii8240)) {
pr_info("sii8240: %s():%d AVI change!\n",
__func__, __LINE__);
checksum = <API key>
(sii8240, sii8240->aviInfoFrame);
if (checksum) {
pr_info("sii8240: %s():%d checksum error\n",
__func__, __LINE__);
return -EINVAL;
}
memcpy(&sii8240-><API key>,
&sii8240->aviInfoFrame, INFO_BUFFER);
tmds_control(sii8240, false);
sii8240->avi_cmd = CEA_NEW_AVI;
sii8240->avi_work = true;
queue_work(sii8240->avi_cmd_wqs, &sii8240->avi_control_work);
} else
pr_info("sii8240: no AVIF\n");
}
return 0;
}
static irqreturn_t sii8240_irq_thread(int irq, void *data)
{
struct sii8240_data *sii8240 = data;
struct i2c_client *disc = sii8240->pdata->disc_client;
struct i2c_client *cbus = sii8240->pdata->cbus_client;
struct i2c_client *tmds = sii8240->pdata->tmds_client;
struct i2c_client *hdmi = sii8240->pdata->hdmi_client;
u8 intr1 = 0, intr1_en, int1_status, int2_status, cbus_con_st;
u8 value;
u8 cbus1, cbus2, cbus3, cbus4;
int ret = 0;
bool clock_stable = false;
mutex_lock(&sii8240->lock);
if (sii8240->state == STATE_DISCONNECTED) {
pr_info("sii8240: mhl is disconnected, so return irq\n");
mutex_unlock(&sii8240->lock);
return IRQ_HANDLED;
}
ret = mhl_read_byte_reg(disc, DISC_INTR_REG, &intr1);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : DISC_INTR_REG\n", __func__);
goto err_exit2;
}
ret = mhl_read_byte_reg(disc, <API key>, &intr1_en);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : <API key>\n", __func__);
goto err_exit2;
}
ret = mhl_read_byte_reg(cbus, <API key>, &cbus_con_st);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : <API key>\n", __func__);
goto err_exit2;
}
ret = mhl_read_byte_reg(tmds, 0x71, &int1_status);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : 0x71\n", __func__);
goto err_exit2;
}
ret = mhl_read_byte_reg(tmds, 0x74, &int2_status);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : 0x74\n", __func__);
goto err_exit2;
}
/*Cbus link interrupt*/
ret = mhl_read_byte_reg(cbus, 0x20, &cbus1);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : 0x20\n", __func__);
goto err_exit2;
}
ret = mhl_read_byte_reg(cbus, 0x21, &cbus2);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : 0x21\n", __func__);
goto err_exit2;
}
ret = mhl_read_byte_reg(cbus, 0x22, &cbus3);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : 0x22\n", __func__);
goto err_exit2;
}
ret = mhl_read_byte_reg(cbus, 0x23, &cbus4);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_read_byte_reg : 0x23\n", __func__);
goto err_exit2;
}
switch (sii8240->state) {
case <API key>:
pr_info(KERN_INFO "sii8240:<API key>\n");
/* interrupts related to discovery & connection */
if (intr1) {
pr_info("sii8240: discovery irq %02x/%02x\n",
intr1, intr1_en);
ret = <API key>(sii8240, intr1);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() <API key>\n", __func__);
goto err_exit;
}
}
if (sii8240->state == STATE_MHL_CONNECTED) {
if (sii8240->pdata->vbus_present)
sii8240->pdata->vbus_present(true, 0x03);
ret = sii8240_init_regs(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() sii8240_init_regs\n", __func__);
goto err_exit;
}
memset(&sii8240->regs.intr_masks,
0x0, sizeof(sii8240->regs.intr_masks));
sii8240->regs.intr_masks.intr4_mask_value =
(BIT_INTR4_MHL_EST|<API key>);
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() <API key>\n", __func__);
goto err_exit;
}
} else if (intr1 & (RGND_RDY_INT | CBUS_UNSTABLE_INT)) {
pr_info("sii8240: rgnd 1k not detected\n");
if (sii8240->irq_enabled) {
disable_irq_nosync(sii8240->irq);
sii8240->irq_enabled = false;
pr_info("sii8240: interrupt disabled\n");
}
/* If there is VBUS, charging start */
if(check_vbus_present()){
if (sii8240->pdata->vbus_present)
sii8240->pdata->vbus_present(false, 0x03);
}
if (sii8240->mhl_connected == true)
queue_work(sii8240->cbus_cmd_wqs,
&sii8240->redetect_work);
}
break;
case STATE_MHL_CONNECTED:
pr_info("sii8240:MHL_RX_CONNECTED\n");
ret = <API key>(sii8240, intr1, cbus_con_st);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() <API key>\n", __func__);
goto err_exit;
}
if (sii8240->state == <API key>) {
/*changing of status information*/
if (sii8240->irq_enabled) {
disable_irq_nosync(sii8240->irq);
sii8240->irq_enabled = false;
pr_info("sii8240: interrupt disabled\n");
}
if (sii8240->mhl_connected == true)
queue_work(sii8240->cbus_cmd_wqs,
&sii8240->redetect_work);
}
break;
case <API key>:
pr_info(KERN_INFO "sii8240:<API key>\n");
/*checking of cbus locking out*/
if (intr1 & <API key>) {
<API key>(sii8240);
<API key>(sii8240);
break;
}
/*checking of cbus disconnection*/
if (intr1 & <API key>) {
pr_info("sii8240 : cbus_disconnected\n");
/* CTS 3.3.22.3 */
/* If cbus disconnected, OTG should also be stoped */
otg_control(false);
mhl_write_byte_reg(hdmi, 0x80, 0xD0);
pr_info("sii8240: CBUS DISCONNECTED !!\n");
if (sii8240->irq_enabled) {
disable_irq_nosync(sii8240->irq);
sii8240->irq_enabled = false;
pr_info("sii8240: interrupt disabled\n");
}
if (sii8240->mhl_connected == true)
queue_work(sii8240->cbus_cmd_wqs,
&sii8240->redetect_work);
break;
}
if (int2_status == 0x00) {
sii8240->regs.intr_masks.intr1_mask_value =
(BIT_INTR1_HPD_CHG);
mhl_write_byte_reg(tmds, 0x75,
sii8240->regs.intr_masks.intr1_mask_value);
}
/*checking HPD event high/low*/
if (int1_status & BIT_INTR1_HPD_CHG) {
ret = mhl_read_byte_reg
(tmds, MHL_TX_SYSSTAT_REG, &value);
memset(&sii8240-><API key>,
0x00, INFO_BUFFER);
memset(&sii8240->output_avi_data,
0x00, SIZE_AVI_INFOFRAME);
#ifdef MHL_2X_3D
memset(&sii8240-><API key>,
0x00, INFO_BUFFER);
sii8240->input_3d_format = NON_3D_VIDEO;
ret = mhl_modify_reg(tmds, 0x51,
<API key>,
<API key>);
#endif
if (value & 0x02) {
pr_info("HPD event high\n");
if (sii8240->hpd_status == false) {
sii8240->hpd_status = true;
sii8240->avi_cmd = HPD_HIGH_EVENT;
sii8240->avi_work = true;
queue_work(sii8240->avi_cmd_wqs,
&sii8240->avi_control_work);
}
} else {
pr_info("Sii8240:HPD event low\n");
if (sii8240->hpd_status) {
sii8240->hpd_status = false;
tmds_control(sii8240, false);
ret = mhl_modify_reg(tmds,
UPSTRM_HPD_CTRL_REG,
<API key> |
<API key>,
<API key> |
<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed\n",
__func__, __LINE__);
goto err_exit;
}
sii8240->regs.intr_masks.intr5_mask_value = 0x00;
ret = mhl_write_byte_reg(tmds, 0x78, 0x00);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed\n",
__func__, __LINE__);
goto err_exit;
}
ret = mhl_modify_reg(hdmi, 0xA1,
<API key>,
<API key>);
if (unlikely(ret < 0)) {
pr_err("[ERROR] sii8240: %s():%d failed\n",
__func__, __LINE__);
goto err_exit;
}
}
}
}
/*Upstream TMDS interrupt register*/
if (int2_status & <API key>) {
pr_info("sii8240: CKDT:"\
"Upstream TMDS interrupt register\n");
#ifdef <API key>
if (sii8240->hdmi_sink)
<API key>(sii8240);
#endif
mhl_read_byte_reg(hdmi, 0xA0, &value);
if (value & <API key>)
pr_info("sii8240: CKDT: stable\n");
else
pr_info("sii8240: CKDT: not stable\n");
clock_stable = true;
}
if (int2_status & <API key>) {
pr_info("sii8240: <API key>\n");
mhl_read_byte_reg(hdmi, 0xA0, &value);
if (<API key> & value) {
pr_info("<API key>\n");
memset(&sii8240->aviInfoFrame,
0x00, INFO_BUFFER);
#ifdef <API key>
if (sii8240->hdmi_sink)
<API key>(sii8240);
#endif
} else
pr_info("disable_encryption\n");
}
if (int2_status & <API key>) {
pr_info("sii8240: <API key>\n");
mhl_read_byte_reg(tmds, 0x81, &value);
if (value & <API key>)
pr_info("sii8240: <API key>\n");
}
ret = sii8240_cbus_irq(sii8240);
if (unlikely(ret < 0)) {
pr_err("sii8240_cbus_irq failed\n");
goto err_exit;
}
ret = <API key>(sii8240);
if (unlikely(ret < 0)) {
pr_err("<API key> failed\n");
goto err_exit;
}
break;
default:
break;
}
err_exit:
/* Clear interrupts */
ret = mhl_write_byte_reg(disc, DISC_INTR_REG, intr1);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_write_byte_reg : DISC_INTR_REG\n", __func__);
goto err_exit2;
}
ret = mhl_write_byte_reg(tmds, 0x71, int1_status);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_write_byte_reg : 0x71\n", __func__);
goto err_exit2;
}
ret = mhl_write_byte_reg(tmds, 0x74, int2_status);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_write_byte_reg : 0x74\n", __func__);
goto err_exit2;
}
ret = mhl_write_byte_reg(cbus, 0x20, cbus1);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_write_byte_reg : 0x20\n", __func__);
goto err_exit2;
}
ret = mhl_write_byte_reg(cbus, 0x21, cbus2);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_write_byte_reg : 0x21\n", __func__);
goto err_exit2;
}
ret = mhl_write_byte_reg(cbus, 0x22, cbus3);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_write_byte_reg : 0x22\n", __func__);
goto err_exit2;
}
ret = mhl_write_byte_reg(cbus, 0x23, cbus4);
if (unlikely(ret < 0)) {
pr_err("[ERROR] %s() mhl_write_byte_reg : 0x23\n", __func__);
goto err_exit2;
}
err_exit2:
mutex_unlock(&sii8240->lock);
wake_up(&sii8240->wq);
pr_info("sii8240: IRQ_HANDLED\n");
return IRQ_HANDLED;
}
static int <API key>(struct device *dev)
{
struct sii8240_data *sii8240 = dev_get_drvdata(dev);
/*set config_gpio for mhl*/
if (sii8240->pdata->gpio_cfg)
sii8240->pdata->gpio_cfg(0);
return 0;
}
static int <API key>(struct device *dev)
{
struct sii8240_data *sii8240 = dev_get_drvdata(dev);
/*set config_gpio for mhl*/
if (sii8240->pdata->gpio_cfg)
sii8240->pdata->gpio_cfg(1);
return 0;
}
static const struct dev_pm_ops sii8240_pm_ops = {
.suspend = <API key>,
.resume = <API key>,
};
static int __devinit <API key>(struct i2c_client *client,
const struct i2c_device_id *id)
{
int ret;
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
struct sii8240_data *sii8240;
if (!<API key>(adapter, <API key>))
return -EIO;
/* going to use block read/write, so check for this too */
if (!<API key>(adapter, <API key>))
return -EIO;
sii8240 = kzalloc(sizeof(struct sii8240_data), GFP_KERNEL);
if (!sii8240) {
dev_err(&client->dev, "failed to allocate driver data\n");
return -ENOMEM;
}
sii8240->pdata = client->dev.platform_data;
if (!sii8240->pdata) {
dev_err(&client->dev, "failed to find platform data\n");
ret = -EINVAL;
goto err_exit0;
}
sii8240->pdata->tmds_client = client;
i2c_set_clientdata(client, sii8240);
mutex_init(&sii8240->lock);
mutex_init(&sii8240->msc_lock);
mutex_init(&sii8240->cbus_lock);
mutex_init(&sii8240->input_lock);
init_waitqueue_head(&sii8240->wq);
sii8240->cbus_cmd_wqs = create_workqueue("sii8240-cmdwq");
if (sii8240->cbus_cmd_wqs == NULL)
ret = -ENXIO;
sii8240->avi_cmd_wqs = create_workqueue("sii8240-aviwq");
if (sii8240->avi_cmd_wqs == NULL)
ret = -ENXIO;
/*workqueue for CBUS*/
INIT_WORK(&sii8240->cbus_work, sii8240_msc_event);
INIT_LIST_HEAD(&sii8240->cbus_data_list);
INIT_WORK(&sii8240->redetect_work, <API key>);
INIT_WORK(&sii8240->avi_control_work, <API key>);
#ifdef <API key>
INIT_WORK(&sii8240-><API key>, <API key>);
setup_timer(&sii8240->mhl_timer, <API key>, (unsigned long)sii8240);
#endif
client->irq = sii8240->pdata->get_irq();
sii8240->irq = client->irq;
ret = <API key>(client->irq, NULL, sii8240_irq_thread,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
"sii8240", sii8240);
if (unlikely(ret < 0)) {
printk(KERN_ERR "[MHL]request irq Q failing\n");
goto err_exit0;
}
disable_irq(client->irq);
sii8240->irq_enabled = false;
sii8240->mhl_nb.notifier_call = <API key>;
<API key>(&sii8240->mhl_nb);
<API key>(sii8240);
sii8240_mhldev = &client->dev;
g_sii8240 = sii8240;
#ifdef <API key>
setup_timer(&sii8240->avi_check_timer, <API key>,
(unsigned long)sii8240);
#endif
/* mhl_event_switch is for home theater*/
sii8240->mhl_event_switch.name = "mhl_event_switch";
switch_dev_register(&sii8240->mhl_event_switch);
return 0;
err_exit0:
kfree(sii8240);
return ret;
}
static int __devinit <API key>(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct <API key> *pdata = client->dev.platform_data;
pdata->hdmi_client = client;
return 0;
}
static int __devinit <API key>(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct <API key> *pdata = client->dev.platform_data;
pdata->disc_client = client;
return 0;
}
static int __devinit <API key>(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct <API key> *pdata = client->dev.platform_data;
pdata->tpi_client = client;
return 0;
}
static int __devinit <API key>(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct <API key> *pdata = client->dev.platform_data;
pdata->cbus_client = client;
return 0;
}
static int __devexit sii8240_tmds_remove(struct i2c_client *client)
{
return 0;
}
static int __devexit sii8240_hdmi_remove(struct i2c_client *client)
{
return 0;
}
static int __devexit sii8240_disc_remove(struct i2c_client *client)
{
return 0;
}
static int __devexit sii8240_tpi_remove(struct i2c_client *client)
{
return 0;
}
static int __devexit sii8240_cbus_remove(struct i2c_client *client)
{
return 0;
}
static const struct i2c_device_id sii8240_tmds_id[] = {
{"sii8240_tmds", 0},
{}
};
static const struct i2c_device_id sii8240_hdmi_id[] = {
{"sii8240_hdmi", 0},
{}
};
static const struct i2c_device_id sii8240_disc_id[] = {
{"sii8240_disc", 0},
{}
};
static const struct i2c_device_id sii8240_tpi_id[] = {
{"sii8240_tpi", 0},
{}
};
static const struct i2c_device_id sii8240_cbus_id[] = {
{"sii8240_cbus", 0},
{}
};
MODULE_DEVICE_TABLE(i2c, sii8240_tmds_id);
MODULE_DEVICE_TABLE(i2c, sii8240_hdmi_id);
MODULE_DEVICE_TABLE(i2c, sii8240_disc_id);
MODULE_DEVICE_TABLE(i2c, sii8240_tpi_id);
MODULE_DEVICE_TABLE(i2c, sii8240_cbus_id);
static struct i2c_driver <API key> = {
.driver = {
.owner = THIS_MODULE,
.name = "sii8240_tmds",
.pm = &sii8240_pm_ops,
},
.id_table = sii8240_tmds_id,
.probe = <API key>,
.remove = __devexit_p(sii8240_tmds_remove),
};
static struct i2c_driver <API key> = {
.driver = {
.owner = THIS_MODULE,
.name = "sii8240_hdmi",
},
.id_table = sii8240_hdmi_id,
.probe = <API key>,
.remove = __devexit_p(sii8240_hdmi_remove),
};
static struct i2c_driver <API key> = {
.driver = {
.owner = THIS_MODULE,
.name = "sii8240_disc",
},
.id_table = sii8240_disc_id,
.probe = <API key>,
.remove = __devexit_p(sii8240_disc_remove),
};
static struct i2c_driver <API key> = {
.driver = {
.owner = THIS_MODULE,
.name = "sii8240_tpi",
},
.id_table = sii8240_tpi_id,
.probe = <API key>,
.remove = __devexit_p(sii8240_tpi_remove),
};
static struct i2c_driver <API key> = {
.driver = {
.owner = THIS_MODULE,
.name = "sii8240_cbus",
},
.id_table = sii8240_cbus_id,
.probe = <API key>,
.remove = __devexit_p(sii8240_cbus_remove),
};
#ifdef <API key>
static ssize_t <API key>(struct class *dev,
struct class_attribute *attr, char *buf)
{
struct sii8240_data *sii8240 = dev_get_drvdata(sii8240_mhldev);
uint32 clk = (sii8240->pdata->swing_level >> 3) & 0x07;
uint32 data = sii8240->pdata->swing_level & 0x07;
return sprintf(buf, "SII8240,0x%X,0x%X,0x%X\n", clk, data,
sii8240->pdata->swing_level);
}
static ssize_t <API key>(struct class *dev,
struct class_attribute *attr,
const char *buf, size_t size)
{
struct sii8240_data *sii8240 = dev_get_drvdata(sii8240_mhldev);
if (buf[0] >= '0' && buf[0] <= '7' &&
buf[1] >= '0' && buf[1] <= '7')
sii8240->pdata->swing_level = ((buf[0] - '0') << 3) |
(buf[1] - '0');
else
sii8240->pdata->swing_level = 0x34; /*Clk=6 and Data=4*/
return size;
}
static CLASS_ATTR(swing, 0664,
<API key>, <API key>);
extern int <API key>;
static ssize_t <API key>(struct class *dev,
struct class_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", <API key>);
}
static ssize_t <API key>(struct class *dev,
struct class_attribute *attr,
const char *buf, size_t size)
{
int timing, ret;
ret = kstrtouint(buf, 10, &timing);
if (unlikely(ret < 0))
return size;
if (timing >= 0 && timing <= 44)
<API key> = timing;
else
<API key> = -1;
return size;
}
static CLASS_ATTR(timing, 0664,
<API key>, <API key>);
#endif
/* for factory test process */
#ifdef CONFIG_SS_FACTORY
#define SII_ID 0x82
static ssize_t sii8240_test_show(struct class *dev,
struct class_attribute *attr,
char *buf)
{
struct sii8240_data *sii8240 = dev_get_drvdata(sii8240_mhldev);
struct i2c_client *tmds = sii8240->pdata->tmds_client;
int size;
u8 sii_id = 0;
sii8240->pdata->power(1);
msleep(20);
sii8240->pdata->hw_reset();
mhl_read_byte_reg(tmds, 0x03, &sii_id);
pr_info("sii8240: check mhl : %X\n", sii_id);
sii8240->pdata->power(0);
size = snprintf(buf, 10, "%d\n", sii_id == SII_ID ? 1 : 0);
return size;
}
static CLASS_ATTR(test_result, 0664, sii8240_test_show, NULL);
#endif
static int __init sii8240_init(void)
{
int ret;
struct device *mhl_dev;
struct kobject *uevent_mhl;
ret = i2c_add_driver(&<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: tmds i2c driver init failed");
return ret;
}
ret = i2c_add_driver(&<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: hdmi i2c driver init failed");
goto err_hdmi;
}
ret = i2c_add_driver(&<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: disc i2c driver init failed");
goto err_disc;
}
ret = i2c_add_driver(&<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: tpi i2c driver init failed");
goto err_tpi;
}
ret = i2c_add_driver(&<API key>);
if (unlikely(ret < 0)) {
pr_err("sii8240: cbus i2c driver init failed");
goto err_cbus;
}
sec_mhl = class_create(THIS_MODULE, "mhl");
if (IS_ERR(sec_mhl))
pr_err("Failed to create class(mhl)!\n");
mhl_dev = device_create(sec_mhl, NULL, MKDEV(MHL_MAJOR, 0),
NULL, "mhl_dev");
if (IS_ERR(mhl_dev))
pr_err("Failed to create device(mhl_dev)!\n");
#ifdef CONFIG_SS_FACTORY
ret = class_create_file(sec_mhl, &<API key>);
if (ret)
pr_err("Failed to create device file in sysfs entries!\n");
#endif
#ifdef <API key>
ret = class_create_file(sec_mhl, &class_attr_swing);
if (ret)
pr_err("failed to create swing sysfs file\n");
ret = class_create_file(sec_mhl, &class_attr_timing);
if (ret)
pr_err("failed to create timing sysfs file\n");
#endif
uevent_mhl = &(mhl_dev->kobj);
return 0;
err_cbus:
i2c_del_driver(&<API key>);
err_tpi:
i2c_del_driver(&<API key>);
err_disc:
i2c_del_driver(&<API key>);
err_hdmi:
i2c_del_driver(&<API key>);
return ret;
}
static void __exit sii8240_exit(void)
{
i2c_del_driver(&<API key>);
i2c_del_driver(&<API key>);
i2c_del_driver(&<API key>);
i2c_del_driver(&<API key>);
i2c_del_driver(&<API key>);
}
module_init(sii8240_init);
module_exit(sii8240_exit);
MODULE_DESCRIPTION("Silicon Image MHL-8240 Transmitter driver");
MODULE_AUTHOR("Sangmi Park <sm0327.park@samsung.com>");
MODULE_LICENSE("GPL"); |
#if !defined(<API key>) && !defined(WEBKIT2_COMPILATION)
#error "Only <webkit2/webkit2.h> can be included directly."
#endif
#ifndef <API key>
#define <API key>
#include <gio/gio.h>
#include <glib-object.h>
#include <webkit2/WebKitDefines.h>
G_BEGIN_DECLS
#define <API key> (<API key>())
#define <API key>(obj) (<API key>((obj), <API key>, WebKitCookieManager))
#define <API key>(obj) (<API key>((obj), <API key>))
#define <API key>(klass) (<API key>((klass), <API key>, <API key>))
#define <API key>(klass) (<API key>((klass), <API key>))
#define <API key>(obj) (<API key>((obj), <API key>, <API key>))
typedef struct <API key> WebKitCookieManager;
typedef struct <API key> <API key>;
typedef struct <API key> <API key>;
/**
* <API key>:
* @<API key>: Cookies are stored in a text
* file in the Mozilla "cookies.txt" format.
* @<API key>: Cookies are stored in a SQLite
* file in the current Mozilla format.
*
* Enum values used to denote the cookie persistent storage types.
*/
typedef enum {
<API key>,
<API key>
} <API key>;
/**
* <API key>:
* @<API key>: Accept all cookies unconditionally.
* @<API key>: Reject all cookies unconditionally.
* @<API key>: Accept only cookies set by the main document loaded.
*
* Enum values used to denote the cookie acceptance policies.
*/
typedef enum {
<API key>,
<API key>,
<API key>
} <API key>;
struct <API key> {
GObject parent;
<API key> *priv;
};
struct <API key> {
GObjectClass parent_class;
void (*_webkit_reserved0) (void);
void (*_webkit_reserved1) (void);
void (*_webkit_reserved2) (void);
void (*_webkit_reserved3) (void);
};
WEBKIT_API GType
<API key> (void);
WEBKIT_API void
<API key> (WebKitCookieManager *cookie_manager,
const gchar *filename,
<API key> storage);
WEBKIT_API void
<API key> (WebKitCookieManager *cookie_manager,
<API key> policy);
WEBKIT_API void
<API key> (WebKitCookieManager *cookie_manager,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API <API key>
<API key> (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
WEBKIT_API void
<API key> (WebKitCookieManager *cookie_manager,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
WEBKIT_API gchar **
<API key> (WebKitCookieManager *cookie_manager,
GAsyncResult *result,
GError **error);
WEBKIT_API void
<API key> (WebKitCookieManager *cookie_manager,
const gchar *domain);
WEBKIT_API void
<API key> (WebKitCookieManager *cookie_manager);
G_END_DECLS
#endif |
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Sande",
"Orwokubanza",
"Orwakabiri",
"Orwakashatu",
"Orwakana",
"Orwakataano",
"Orwamukaaga"
],
"ERANAMES": [
"Kurisito Atakaijire",
"Kurisito Yaijire"
],
"ERAS": [
"BC",
"AD"
],
"MONTH": [
"Okwokubanza",
"Okwakabiri",
"Okwakashatu",
"Okwakana",
"Okwakataana",
"Okwamukaaga",
"Okwamushanju",
"Okwamunaana",
"Okwamwenda",
"Okwaikumi",
"Okwaikumi na kumwe",
"Okwaikumi na ibiri"
],
"SHORTDAY": [
"SAN",
"ORK",
"OKB",
"OKS",
"OKN",
"OKT",
"OMK"
],
"SHORTMONTH": [
"KBZ",
"KBR",
"KST",
"KKN",
"KTN",
"KMK",
"KMS",
"KMN",
"KMW",
"KKM",
"KNK",
"KNB"
],
"fullDate": "EEEE, d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y h:mm:ss a",
"mediumDate": "d MMM y",
"mediumTime": "h:mm:ss a",
"short": "dd/MM/y h:mm a",
"shortDate": "dd/MM/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "UGX",
"DECIMAL_SEP": ".",
"GROUP_SEP": ",",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "\u00a4-",
"negSuf": "",
"posPre": "\u00a4",
"posSuf": ""
}
]
},
"id": "cgg-ug",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]); |
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include "jsm.h"
MODULE_AUTHOR("Digi International, http:
MODULE_DESCRIPTION("Driver for the Digi International "
"Neo PCI based product line");
MODULE_LICENSE("GPL");
<API key>("jsm");
#define JSM_DRIVER_NAME "jsm"
#define NR_PORTS 32
#define JSM_MINOR_START 0
struct uart_driver jsm_uart_driver = {
.owner = THIS_MODULE,
.driver_name = JSM_DRIVER_NAME,
.dev_name = "ttyn",
.major = 0,
.minor = JSM_MINOR_START,
.nr = NR_PORTS,
};
static pci_ers_result_t <API key>(struct pci_dev *pdev,
pci_channel_state_t state);
static pci_ers_result_t jsm_io_slot_reset(struct pci_dev *pdev);
static void jsm_io_resume(struct pci_dev *pdev);
static struct pci_error_handlers jsm_err_handler = {
.error_detected = <API key>,
.slot_reset = jsm_io_slot_reset,
.resume = jsm_io_resume,
};
int jsm_debug;
module_param(jsm_debug, int, 0);
MODULE_PARM_DESC(jsm_debug, "Driver debugging level");
static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
int rc = 0;
struct jsm_board *brd;
static int adapter_count = 0;
rc = pci_enable_device(pdev);
if (rc) {
dev_err(&pdev->dev, "Device enable FAILED\n");
goto out;
}
rc = pci_request_regions(pdev, "jsm");
if (rc) {
dev_err(&pdev->dev, "pci_request_region FAILED\n");
goto out_disable_device;
}
brd = kzalloc(sizeof(struct jsm_board), GFP_KERNEL);
if (!brd) {
dev_err(&pdev->dev,
"memory allocation for board structure failed\n");
rc = -ENOMEM;
goto out_release_regions;
}
/* store the info for the board we've found */
brd->boardnum = adapter_count++;
brd->pci_dev = pdev;
if (pdev->device == <API key>)
brd->maxports = 4;
else if (pdev->device == <API key>)
brd->maxports = 8;
else
brd->maxports = 2;
spin_lock_init(&brd->bd_intr_lock);
/* store which revision we have */
brd->rev = pdev->revision;
brd->irq = pdev->irq;
jsm_printk(INIT, INFO, &brd->pci_dev,
"jsm_found_board - NEO adapter\n");
/* get the PCI Base Address Registers */
brd->membase = pci_resource_start(pdev, 0);
brd->membase_end = pci_resource_end(pdev, 0);
if (brd->membase & 1)
brd->membase &= ~3;
else
brd->membase &= ~15;
/* Assign the board_ops struct */
brd->bd_ops = &jsm_neo_ops;
brd->bd_uart_offset = 0x200;
brd->bd_dividend = 921600;
brd->re_map_membase = ioremap(brd->membase, pci_resource_len(pdev, 0));
if (!brd->re_map_membase) {
dev_err(&pdev->dev,
"card has no PCI Memory resources, "
"failing board.\n");
rc = -ENOMEM;
goto out_kfree_brd;
}
rc = request_irq(brd->irq, brd->bd_ops->intr,
IRQF_SHARED, "JSM", brd);
if (rc) {
printk(KERN_WARNING "Failed to hook IRQ %d\n",brd->irq);
goto out_iounmap;
}
rc = jsm_tty_init(brd);
if (rc < 0) {
dev_err(&pdev->dev, "Can't init tty devices (%d)\n", rc);
rc = -ENXIO;
goto out_free_irq;
}
rc = jsm_uart_port_init(brd);
if (rc < 0) {
/* XXX: leaking all resources from jsm_tty_init here! */
dev_err(&pdev->dev, "Can't init uart port (%d)\n", rc);
rc = -ENXIO;
goto out_free_irq;
}
/* Log the information about the board */
dev_info(&pdev->dev, "board %d: Digi Neo (rev %d), irq %d\n",
adapter_count, brd->rev, brd->irq);
/*
* allocate flip buffer for board.
*
* Okay to malloc with GFP_KERNEL, we are not at interrupt
* context, and there are no locks held.
*/
brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
if (!brd->flipbuf) {
/* XXX: leaking all resources from jsm_tty_init and
jsm_uart_port_init here! */
dev_err(&pdev->dev, "memory allocation for flipbuf failed\n");
rc = -ENOMEM;
goto out_free_uart;
}
pci_set_drvdata(pdev, brd);
pci_save_state(pdev);
return 0;
out_free_uart:
<API key>(brd);
out_free_irq:
<API key>(brd);
free_irq(brd->irq, brd);
out_iounmap:
iounmap(brd->re_map_membase);
out_kfree_brd:
kfree(brd);
out_release_regions:
pci_release_regions(pdev);
out_disable_device:
pci_disable_device(pdev);
out:
return rc;
}
static void __devexit jsm_remove_one(struct pci_dev *pdev)
{
struct jsm_board *brd = pci_get_drvdata(pdev);
int i = 0;
<API key>(brd);
free_irq(brd->irq, brd);
iounmap(brd->re_map_membase);
/* Free all allocated channels structs */
for (i = 0; i < brd->maxports; i++) {
if (brd->channels[i]) {
kfree(brd->channels[i]->ch_rqueue);
kfree(brd->channels[i]->ch_equeue);
kfree(brd->channels[i]);
}
}
pci_release_regions(pdev);
pci_disable_device(pdev);
kfree(brd->flipbuf);
kfree(brd);
}
static struct pci_device_id jsm_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, <API key>), 0, 0, 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, <API key>), 0, 0, 1 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, <API key>), 0, 0, 2 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, <API key>), 0, 0, 3 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, <API key>), 0, 0, 4 },
{ PCI_DEVICE(PCI_VENDOR_ID_DIGI, <API key>), 0, 0, 5 },
{ 0, }
};
MODULE_DEVICE_TABLE(pci, jsm_pci_tbl);
static struct pci_driver jsm_driver = {
.name = "jsm",
.id_table = jsm_pci_tbl,
.probe = jsm_probe_one,
.remove = __devexit_p(jsm_remove_one),
.err_handler = &jsm_err_handler,
};
static pci_ers_result_t <API key>(struct pci_dev *pdev,
pci_channel_state_t state)
{
struct jsm_board *brd = pci_get_drvdata(pdev);
<API key>(brd);
return <API key>;
}
static pci_ers_result_t jsm_io_slot_reset(struct pci_dev *pdev)
{
int rc;
rc = pci_enable_device(pdev);
if (rc)
return <API key>;
pci_set_master(pdev);
return <API key>;
}
static void jsm_io_resume(struct pci_dev *pdev)
{
struct jsm_board *brd = pci_get_drvdata(pdev);
pci_restore_state(pdev);
pci_save_state(pdev);
jsm_uart_port_init(brd);
}
static int __init jsm_init_module(void)
{
int rc;
rc = <API key>(&jsm_uart_driver);
if (!rc) {
rc = pci_register_driver(&jsm_driver);
if (rc)
<API key>(&jsm_uart_driver);
}
return rc;
}
static void __exit jsm_exit_module(void)
{
<API key>(&jsm_driver);
<API key>(&jsm_uart_driver);
}
module_init(jsm_init_module);
module_exit(jsm_exit_module); |
package pvm
import (
"fmt"
"github.com/mitchellh/multistep"
parallelscommon "github.com/mitchellh/packer/builder/parallels/common"
"github.com/mitchellh/packer/packer"
)
// This step imports an PVM VM into Parallels.
type StepImport struct {
Name string
SourcePath string
vmName string
}
func (s *StepImport) Run(state multistep.StateBag) multistep.StepAction {
driver := state.Get("driver").(parallelscommon.Driver)
ui := state.Get("ui").(packer.Ui)
config := state.Get("config").(*Config)
ui.Say(fmt.Sprintf("Importing VM: %s", s.SourcePath))
if err := driver.Import(s.Name, s.SourcePath, config.OutputDir, config.ReassignMac); err != nil {
err := fmt.Errorf("Error importing VM: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
s.vmName = s.Name
state.Put("vmName", s.Name)
return multistep.ActionContinue
}
func (s *StepImport) Cleanup(state multistep.StateBag) {
if s.vmName == "" {
return
}
driver := state.Get("driver").(parallelscommon.Driver)
ui := state.Get("ui").(packer.Ui)
ui.Say("Unregistering virtual machine...")
if err := driver.Prlctl("unregister", s.vmName); err != nil {
ui.Error(fmt.Sprintf("Error unregistering virtual machine: %s", err))
}
} |
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="viewport" content="width=device-width">
<meta name="description" content="{{ site.description }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="stylesheet" href="{{ "/style.css" | prepend: site.baseurl }}">
<!-- Custom Fonts -->
<link rel="stylesheet" href="{{ "/css/font-awesome/css/font-awesome.min.css" | prepend: site.baseurl }}">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]
</head> |
<!DOCTYPE html>
<html xmlns="http:
<head>
<title>background on body when propagated to the viewport should be anchored at the root element</title>
<style>
html { background-color:transparent; background-image:none; margin:50px; border:thin solid; min-width:150px; min-height:150px; }
body { background-image:url(resources/yellow.png); background-repeat:no-repeat; margin:50px; border:thin solid; min-width:50px; min-height:50px; color:navy; }
</style>
</head>
<body>
<p>There should be a yellow square in the top-left corner, <em>between</em> the borders.</p>
</body>
</html> |
(function($) {
/*global jQuery*/
"use strict";
var compareWeights = function(a, b)
{
return a - b;
};
// Converts hex to an RGB array
var toRGB = function(code) {
if (code.length === 4) {
code = code.replace(/(\w)(\w)(\w)/gi, "\$1\$1\$2\$2\$3\$3");
}
var hex = /(\w{2})(\w{2})(\w{2})/.exec(code);
return [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)];
};
// Converts an RGB array to hex
var toHex = function(ary) {
return "#" + jQuery.map(ary, function(i) {
var hex = i.toString(16);
hex = (hex.length === 1) ? "0" + hex : hex;
return hex;
}).join("");
};
var colorIncrement = function(color, range) {
return jQuery.map(toRGB(color.end), function(n, i) {
return (n - toRGB(color.start)[i])/range;
});
};
var tagColor = function(color, increment, weighting) {
var rgb = jQuery.map(toRGB(color.start), function(n, i) {
var ref = Math.round(n + (increment[i] * weighting));
if (ref > 255) {
ref = 255;
} else {
if (ref < 0) {
ref = 0;
}
}
return ref;
});
return toHex(rgb);
};
$.fn.tagcloud = function(options) {
var opts = $.extend({}, $.fn.tagcloud.defaults, options);
var tagWeights = this.map(function(){
return $(this).attr("rel");
});
tagWeights = jQuery.makeArray(tagWeights).sort(compareWeights);
var lowest = tagWeights[0];
var highest = tagWeights.pop();
var range = highest - lowest;
if(range === 0) {range = 1;}
// Sizes
var fontIncr, colorIncr;
if (opts.size) {
fontIncr = (opts.size.end - opts.size.start)/range;
}
// Colors
if (opts.color) {
colorIncr = colorIncrement (opts.color, range);
}
return this.each(function() {
var weighting = $(this).attr("rel") - lowest;
if (opts.size) {
$(this).css({"font-size": opts.size.start + (weighting * fontIncr) + opts.size.unit});
}
if (opts.color) {
$(this).css({"color": tagColor(opts.color, colorIncr, weighting)});
}
});
};
$.fn.tagcloud.defaults = {
size: {start: 14, end: 18, unit: "pt"}
};
})(jQuery); |
.<API key> {
cursor: pointer;
}
.<API key>{
visibility:hidden;
}
.dijit_a11y .<API key> {
opacity:0.8 !important;
}
.dijit_a11y .dojoxGridBorderDIV {
border:2px solid #000 !important;
}
.dijit_a11y .<API key> {
height:100% !important;
}
.dijit_a11y .<API key>{
font-size:larger !important;
visibility:visible;
}
.dijit_a11y .dijitCheckBox .<API key>{
font-weight:bolder !important;
font-size:x-large !important;
}
.dijit_a11y .<API key> .<API key>{
font-size:small !important;
} |
<!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL <API key> Conformance Tests</title>
<link rel="stylesheet" href="../../resources/js-test-style.css"/>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="../../resources/js-test-pre.js"></script>
<script src="../resources/webgl-test-utils.js"></script>
<script id="vs" type="x-shader/x-vertex">
attribute vec4 vPosition;
attribute vec4 vColor;
varying vec4 color;
void main() {
gl_Position = vPosition;
color = vColor;
}
</script>
<script id="fs" type="x-shader/x-fragment">
precision mediump float;
varying vec4 color;
void main() {
gl_FragColor = color;
}
</script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
"use strict";
description("This test verifies the functionality of the <API key> extension, if it is available.");
debug("");
var wtu = WebGLTestUtils;
var gl = null;
var ext = null;
var canvas = null;
// Test both STATIC_DRAW and DYNAMIC_DRAW as a regression test
// for a bug in ANGLE which has since been fixed.
for (var ii = 0; ii < 2; ++ii) {
canvas = document.createElement("canvas");
canvas.width = 50;
canvas.height = 50;
gl = wtu.create3DContext(canvas);
if (!gl) {
testFailed("WebGL context does not exist");
} else {
testPassed("WebGL context exists");
var drawType = (ii == 0) ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW;
debug("Testing " + ((ii == 0) ? "STATIC_DRAW" : "DYNAMIC_DRAW"));
// Query the extension and store globally so shouldBe can access it
ext = gl.getExtension("<API key>");
if (!ext) {
testPassed("No <API key> support
runSupportedTest(false);
} else {
testPassed("Successfully enabled <API key> extension");
runSupportedTest(true);
runDrawTests(drawType);
// These tests are tweaked duplicates of the buffers/index-validation* tests
// using unsigned int indices to ensure that behavior remains consistent
<API key>(drawType);
<API key>(drawType);
<API key>(drawType);
<API key>(drawType);
<API key>(drawType);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
}
}
}
function runSupportedTest(extensionEnabled) {
var supported = gl.<API key>();
if (supported.indexOf("<API key>") >= 0) {
if (extensionEnabled) {
testPassed("<API key> listed as supported and getExtension succeeded");
} else {
testFailed("<API key> listed as supported but getExtension failed");
}
} else {
if (extensionEnabled) {
testFailed("<API key> not listed as supported but getExtension succeeded");
} else {
testPassed("<API key> not listed as supported and getExtension failed
}
}
}
function runDrawTests(drawType) {
debug("Test that draws with unsigned integer indices produce the expected results");
canvas.width = 50; canvas.height = 50;
gl.viewport(0, 0, canvas.width, canvas.height);
var program = wtu.<API key>(gl);
function setupDraw(s) {
// Create a vertex buffer that cannot be fully indexed via shorts
var quadArrayLen = 65537 * 3;
var quadArray = new Float32Array(quadArrayLen);
// Leave all but the last 4 values zero-ed out
var idx = quadArrayLen - 12;
// Initialized the last 4 values to a quad
quadArray[idx++] = 1.0 * s;
quadArray[idx++] = 1.0 * s;
quadArray[idx++] = 0.0;
quadArray[idx++] = -1.0 * s;
quadArray[idx++] = 1.0 * s;
quadArray[idx++] = 0.0;
quadArray[idx++] = -1.0 * s;
quadArray[idx++] = -1.0 * s;
quadArray[idx++] = 0.0;
quadArray[idx++] = 1.0 * s;
quadArray[idx++] = -1.0 * s;
quadArray[idx++] = 0.0;
var vertexObject = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
gl.bufferData(gl.ARRAY_BUFFER, quadArray, drawType);
// Create an unsigned int index buffer that indexes the last 4 vertices
var baseIndex = (quadArrayLen / 3) - 4;
var indexObject = gl.createBuffer();
gl.bindBuffer(gl.<API key>, indexObject);
gl.bufferData(gl.<API key>, new Uint32Array([
baseIndex + 0,
baseIndex + 1,
baseIndex + 2,
baseIndex + 2,
baseIndex + 3,
baseIndex + 0]), drawType);
var <API key> = 0;
gl.<API key>(<API key>);
gl.vertexAttribPointer(<API key>, 3, gl.FLOAT, false, 0, 0);
};
function testPixel(blackList, whiteList) {
function testList(list, expected) {
for (var n = 0; n < list.length; n++) {
var l = list[n];
var x = -Math.floor(l * canvas.width / 2) + canvas.width / 2;
var y = -Math.floor(l * canvas.height / 2) + canvas.height / 2;
wtu.checkCanvasRect(gl, x, y, 1, 1, [expected, expected, expected],
"Draw should pass", 2);
}
}
testList(blackList, 0);
testList(whiteList, 255);
};
function verifyDraw(s) {
gl.clearColor(1.0, 1.0, 1.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_INT, 0);
var blackList = [];
var whiteList = [];
var points = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0];
for (var n = 0; n < points.length; n++) {
if (points[n] <= s) {
blackList.push(points[n]);
} else {
whiteList.push(points[n]);
}
}
testPixel(blackList, whiteList);
};
setupDraw(0.5);
verifyDraw(0.5);
}
function <API key>(drawType) {
description("Tests that index validation verifies the correct number of indices");
function sizeInBytes(type) {
switch (type) {
case gl.BYTE:
case gl.UNSIGNED_BYTE:
return 1;
case gl.SHORT:
case gl.UNSIGNED_SHORT:
return 2;
case gl.INT:
case gl.UNSIGNED_INT:
case gl.FLOAT:
return 4;
default:
throw "unknown type";
}
}
var program = wtu.loadStandardProgram(gl);
// 3 vertices => 1 triangle, interleaved data
var dataComplete = new Float32Array([0, 0, 0, 1,
0, 0, 1,
1, 0, 0, 1,
0, 0, 1,
1, 1, 1, 1,
0, 0, 1]);
var dataIncomplete = new Float32Array([0, 0, 0, 1,
0, 0, 1,
1, 0, 0, 1,
0, 0, 1,
1, 1, 1, 1]);
var indices = new Uint32Array([0, 1, 2]);
debug("Testing with valid indices");
var bufferComplete = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, bufferComplete);
gl.bufferData(gl.ARRAY_BUFFER, dataComplete, drawType);
var elements = gl.createBuffer();
gl.bindBuffer(gl.<API key>, elements);
gl.bufferData(gl.<API key>, indices, drawType);
gl.useProgram(program);
var vertexLoc = gl.getAttribLocation(program, "a_vertex");
var normalLoc = gl.getAttribLocation(program, "a_normal");
gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
gl.<API key>(vertexLoc);
gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
gl.<API key>(normalLoc);
shouldBe('gl.<API key>(gl.FRAMEBUFFER)', 'gl.<API key>');
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
debug("Testing with out-of-range indices");
var bufferIncomplete = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, bufferIncomplete);
gl.bufferData(gl.ARRAY_BUFFER, dataIncomplete, drawType);
gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
gl.<API key>(vertexLoc);
gl.<API key>(normalLoc);
debug("Enable vertices, valid");
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
debug("Enable normals, out-of-range");
gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
gl.<API key>(normalLoc);
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
debug("Test with enabled attribute that does not belong to current program");
gl.<API key>(normalLoc);
var extraLoc = Math.max(vertexLoc, normalLoc) + 1;
gl.<API key>(extraLoc);
debug("Enable an extra attribute with null");
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
debug("Enable an extra attribute with insufficient data buffer");
gl.vertexAttribPointer(extraLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
wtu.glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
debug("Pass large negative index to vertexAttribPointer");
gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), -2000000000 * sizeInBytes(gl.FLOAT));
wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
}
function <API key>(drawType) {
debug("Test that client data is always copied during bufferData and bufferSubData calls");
var program = wtu.loadStandardProgram(gl);
gl.useProgram(program);
var vertexObject = gl.createBuffer();
gl.<API key>(0);
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
// 4 vertices -> 2 triangles
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), drawType);
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
var indexObject = gl.createBuffer();
gl.bindBuffer(gl.<API key>, indexObject);
var indices = new Uint32Array([ 10000, 0, 1, 2, 3, 10000 ]);
gl.bufferData(gl.<API key>, indices, drawType);
wtu.<API key>(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
wtu.<API key>(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
wtu.<API key>(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
indices[0] = 2;
indices[5] = 1;
wtu.<API key>(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
wtu.<API key>(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
wtu.<API key>(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
}
function <API key>(drawType) {
debug("Test that updating the size of a vertex buffer is properly noticed by the WebGL implementation.");
var program = wtu.setupProgram(gl, ["vs", "fs"], ["vPosition", "vColor"]);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after initialization");
var vertexObject = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
[-1,1,0, 1,1,0, -1,-1,0,
-1,-1,0, 1,1,0, 1,-1,0]), drawType);
gl.<API key>(0);
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after vertex setup");
var texCoordObject = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordObject);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
[0,0, 1,0, 0,1,
0,1, 1,0, 1,1]), drawType);
gl.<API key>(1);
gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after texture coord setup");
// Now resize these buffers because we want to change what we're drawing.
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
-1,1,0, 1,1,0, -1,-1,0, 1,-1,0,
-1,1,0, 1,1,0, -1,-1,0, 1,-1,0]), drawType);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after vertex redefinition");
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordObject);
gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array([
255, 0, 0, 255,
255, 0, 0, 255,
255, 0, 0, 255,
255, 0, 0, 255,
0, 255, 0, 255,
0, 255, 0, 255,
0, 255, 0, 255,
0, 255, 0, 255]), drawType);
gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, false, 0, 0);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after texture coordinate / color redefinition");
var numQuads = 2;
var indices = new Uint32Array(numQuads * 6);
for (var ii = 0; ii < numQuads; ++ii) {
var offset = ii * 6;
var quad = (ii == (numQuads - 1)) ? 4 : 0;
indices[offset + 0] = quad + 0;
indices[offset + 1] = quad + 1;
indices[offset + 2] = quad + 2;
indices[offset + 3] = quad + 2;
indices[offset + 4] = quad + 1;
indices[offset + 5] = quad + 3;
}
var indexObject = gl.createBuffer();
gl.bindBuffer(gl.<API key>, indexObject);
gl.bufferData(gl.<API key>, indices, drawType);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after setting up indices");
gl.drawElements(gl.TRIANGLES, numQuads * 6, gl.UNSIGNED_INT, 0);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after drawing");
}
function <API key>(drawType) {
description("Tests that index validation for drawElements does not examine too many indices");
var program = wtu.loadStandardProgram(gl);
gl.useProgram(program);
var vertexObject = gl.createBuffer();
gl.<API key>(0);
gl.<API key>(1);
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
// 4 vertices -> 2 triangles
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), drawType);
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
var indexObject = gl.createBuffer();
debug("Test out of range indices")
gl.bindBuffer(gl.<API key>, indexObject);
gl.bufferData(gl.<API key>, new Uint32Array([ 10000, 0, 1, 2, 3, 10000 ]), drawType);
wtu.<API key>(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
wtu.<API key>(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
wtu.<API key>(gl, gl.INVALID_OPERATION, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
}
function <API key>(drawType) {
debug('Verifies that the index validation code which is within bufferSubData does not crash.')
var elementBuffer = gl.createBuffer();
gl.bindBuffer(gl.<API key>, elementBuffer);
gl.bufferData(gl.<API key>, 256, drawType);
var data = new Uint32Array(127);
gl.bufferSubData(gl.<API key>, 64, data);
wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "after attempting to update a buffer outside of the allocated bounds");
testPassed("bufferSubData, when buffer object was initialized with null, did not crash");
}
debug("");
var successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html> |
script_was_loaded = true; |
<?php
namespace Symfony\Component\Validator\Constraints;
/**
* Annotation to define a group sequence provider.
*
* @Annotation
* @Target({"CLASS", "ANNOTATION"})
*/
class <API key>
{
} |
#ifndef <API key>
#define <API key>
/**
* @addtogroup <API key>
* @{
*/
/**
* @hideinitializer
* Defined with value of 1 if toolchain is Microsoft Visual Studio, 0
* otherwise.
*/
#define CSTD_TOOLCHAIN_MSVC 0
/**
* @hideinitializer
* Defined with value of 1 if toolchain is the GNU Compiler Collection, 0
* otherwise.
*/
#define CSTD_TOOLCHAIN_GCC 0
/**
* @hideinitializer
* Defined with value of 1 if toolchain is ARM RealView Compiler Tools, 0
* otherwise. Note - if running RVCT in GCC mode this define will be set to 0;
* @c CSTD_TOOLCHAIN_GCC and @c <API key> will both be
* defined as 1.
*/
#define CSTD_TOOLCHAIN_RVCT 0
/**
* @hideinitializer
* Defined with value of 1 if toolchain is ARM RealView Compiler Tools running
* in GCC mode, 0 otherwise.
*/
#define <API key> 0
/**
* @hideinitializer
* Defined with value of 1 if processor is an x86 32-bit machine, 0 otherwise.
*/
#define CSTD_CPU_X86_32 0
/**
* @hideinitializer
* Defined with value of 1 if processor is an x86-64 (AMD64) machine, 0
* otherwise.
*/
#define CSTD_CPU_X86_64 0
/**
* @hideinitializer
* Defined with value of 1 if processor is an ARM machine, 0 otherwise.
*/
#define CSTD_CPU_ARM 0
/**
* @hideinitializer
* Defined with value of 1 if processor is a MIPS machine, 0 otherwise.
*/
#define CSTD_CPU_MIPS 0
/**
* @hideinitializer
* Defined with value of 1 if CPU is 32-bit, 0 otherwise.
*/
#define CSTD_CPU_32BIT 0
/**
* @hideinitializer
* Defined with value of 1 if CPU is 64-bit, 0 otherwise.
*/
#define CSTD_CPU_64BIT 0
/**
* @hideinitializer
* Defined with value of 1 if processor configured as big-endian, 0 if it
* is little-endian.
*/
#define CSTD_CPU_BIG_ENDIAN 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a version of Windows, 0 if
* it is not.
*/
#define CSTD_OS_WINDOWS 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 32-bit version of Windows,
* 0 if it is not.
*/
#define CSTD_OS_WIN32 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 64-bit version of Windows,
* 0 if it is not.
*/
#define CSTD_OS_WIN64 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is Linux, 0 if it is not.
*/
#define CSTD_OS_LINUX 0
/**
* @hideinitializer
* Defined with value of 1 if we are compiling Linux kernel code, 0 otherwise.
*/
#define <API key> 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 32-bit version of Linux,
* 0 if it is not.
*/
#define CSTD_OS_LINUX32 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 64-bit version of Linux,
* 0 if it is not.
*/
#define CSTD_OS_LINUX64 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is Android, 0 if it is not.
*/
#define CSTD_OS_ANDROID 0
/**
* @hideinitializer
* Defined with value of 1 if we are compiling Android kernel code, 0 otherwise.
*/
#define <API key> 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 32-bit version of Android,
* 0 if it is not.
*/
#define CSTD_OS_ANDROID32 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 64-bit version of Android,
* 0 if it is not.
*/
#define CSTD_OS_ANDROID64 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a version of Apple OS,
* 0 if it is not.
*/
#define CSTD_OS_APPLEOS 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 32-bit version of Apple OS,
* 0 if it is not.
*/
#define CSTD_OS_APPLEOS32 0
/**
* @hideinitializer
* Defined with value of 1 if operating system is a 64-bit version of Apple OS,
* 0 if it is not.
*/
#define CSTD_OS_APPLEOS64 0
/**
* @def CSTD_OS_SYMBIAN
* @hideinitializer
* Defined with value of 1 if operating system is Symbian, 0 if it is not.
*/
#define CSTD_OS_SYMBIAN 0
/**
* @def CSTD_OS_NONE
* @hideinitializer
* Defined with value of 1 if there is no operating system (bare metal), 0
* otherwise
*/
#define CSTD_OS_NONE 0
#if defined(_MSC_VER)
#undef CSTD_TOOLCHAIN_MSVC
#define CSTD_TOOLCHAIN_MSVC 1
#elif defined(__GNUC__)
#undef CSTD_TOOLCHAIN_GCC
#define CSTD_TOOLCHAIN_GCC 1
/* Detect RVCT pretending to be GCC. */
#if defined(__ARMCC_VERSION)
#undef <API key>
#define <API key> 1
#endif
#elif defined(__ARMCC_VERSION)
#undef CSTD_TOOLCHAIN_RVCT
#define CSTD_TOOLCHAIN_RVCT 1
#else
#warning "Unsupported or unknown toolchain"
#endif
#if 1 == CSTD_TOOLCHAIN_MSVC
#if defined(_M_IX86)
#undef CSTD_CPU_X86_32
#define CSTD_CPU_X86_32 1
#elif defined(_M_X64) || defined(_M_AMD64)
#undef CSTD_CPU_X86_64
#define CSTD_CPU_X86_64 1
#elif defined(_M_ARM)
#undef CSTD_CPU_ARM
#define CSTD_CPU_ARM 1
#elif defined(_M_MIPS)
#undef CSTD_CPU_MIPS
#define CSTD_CPU_MIPS 1
#else
#warning "Unsupported or unknown host CPU for MSVC tools"
#endif
#elif 1 == CSTD_TOOLCHAIN_GCC
#if defined(__amd64__)
#undef CSTD_CPU_X86_64
#define CSTD_CPU_X86_64 1
#elif defined(__i386__)
#undef CSTD_CPU_X86_32
#define CSTD_CPU_X86_32 1
#elif defined(__arm__)
#undef CSTD_CPU_ARM
#define CSTD_CPU_ARM 1
#elif defined(__mips__)
#undef CSTD_CPU_MIPS
#define CSTD_CPU_MIPS 1
#else
#warning "Unsupported or unknown host CPU for GCC tools"
#endif
#elif 1 == CSTD_TOOLCHAIN_RVCT
#undef CSTD_CPU_ARM
#define CSTD_CPU_ARM 1
#else
#warning "Unsupported or unknown toolchain"
#endif
#if ((1 == CSTD_CPU_X86_32) || (1 == CSTD_CPU_X86_64))
/* Note: x86 and x86-64 are always little endian, so leave at default. */
#elif 1 == CSTD_TOOLCHAIN_RVCT
#if defined(__BIG_ENDIAN)
#undef CSTD_ENDIAN_BIG
#define CSTD_ENDIAN_BIG 1
#endif
#elif ((1 == CSTD_TOOLCHAIN_GCC) && (1 == CSTD_CPU_ARM))
#if defined(__ARMEB__)
#undef CSTD_ENDIAN_BIG
#define CSTD_ENDIAN_BIG 1
#endif
#elif ((1 == CSTD_TOOLCHAIN_GCC) && (1 == CSTD_CPU_MIPS))
#if defined(__MIPSEB__)
#undef CSTD_ENDIAN_BIG
#define CSTD_ENDIAN_BIG 1
#endif
#elif 1 == CSTD_TOOLCHAIN_MSVC
/* Note: Microsoft only support little endian, so leave at default. */
#else
#warning "Unsupported or unknown CPU"
#endif
#if 1 == CSTD_TOOLCHAIN_MSVC
#if defined(_WIN32) && !defined(_WIN64)
#undef CSTD_OS_WINDOWS
#define CSTD_OS_WINDOWS 1
#undef CSTD_OS_WIN32
#define CSTD_OS_WIN32 1
#undef CSTD_CPU_32BIT
#define CSTD_CPU_32BIT 1
#elif defined(_WIN32) && defined(_WIN64)
#undef CSTD_OS_WINDOWS
#define CSTD_OS_WINDOWS 1
#undef CSTD_OS_WIN64
#define CSTD_OS_WIN64 1
#undef CSTD_CPU_64BIT
#define CSTD_CPU_64BIT 1
#else
#warning "Unsupported or unknown host OS for MSVC tools"
#endif
#elif 1 == CSTD_TOOLCHAIN_GCC
#if defined(_WIN32) && defined(_WIN64)
#undef CSTD_OS_WINDOWS
#define CSTD_OS_WINDOWS 1
#undef CSTD_OS_WIN64
#define CSTD_OS_WIN64 1
#undef CSTD_CPU_64BIT
#define CSTD_CPU_64BIT 1
#elif defined(_WIN32) && !defined(_WIN64)
#undef CSTD_OS_WINDOWS
#define CSTD_OS_WINDOWS 1
#undef CSTD_OS_WIN32
#define CSTD_OS_WIN32 1
#undef CSTD_CPU_32BIT
#define CSTD_CPU_32BIT 1
#elif defined(ANDROID)
#undef CSTD_OS_ANDROID
#define CSTD_OS_ANDROID 1
#if defined(__KERNEL__)
#undef <API key>
#define <API key> 1
#endif
#if defined(__LP64__) || defined(_LP64)
#undef CSTD_OS_ANDROID64
#define CSTD_OS_ANDROID64 1
#undef CSTD_CPU_64BIT
#define CSTD_CPU_64BIT 1
#else
#undef CSTD_OS_ANDROID32
#define CSTD_OS_ANDROID32 1
#undef CSTD_CPU_32BIT
#define CSTD_CPU_32BIT 1
#endif
#elif defined(__KERNEL__) || defined(__linux)
#undef CSTD_OS_LINUX
#define CSTD_OS_LINUX 1
#if defined(__KERNEL__)
#undef <API key>
#define <API key> 1
#endif
#if defined(__LP64__) || defined(_LP64)
#undef CSTD_OS_LINUX64
#define CSTD_OS_LINUX64 1
#undef CSTD_CPU_64BIT
#define CSTD_CPU_64BIT 1
#else
#undef CSTD_OS_LINUX32
#define CSTD_OS_LINUX32 1
#undef CSTD_CPU_32BIT
#define CSTD_CPU_32BIT 1
#endif
#elif defined(__APPLE__)
#undef CSTD_OS_APPLEOS
#define CSTD_OS_APPLEOS 1
#if defined(__LP64__) || defined(_LP64)
#undef CSTD_OS_APPLEOS64
#define CSTD_OS_APPLEOS64 1
#undef CSTD_CPU_64BIT
#define CSTD_CPU_64BIT 1
#else
#undef CSTD_OS_APPLEOS32
#define CSTD_OS_APPLEOS32 1
#undef CSTD_CPU_32BIT
#define CSTD_CPU_32BIT 1
#endif
#elif defined(__SYMBIAN32__)
#undef CSTD_OS_SYMBIAN
#define CSTD_OS_SYMBIAN 1
#undef CSTD_CPU_32BIT
#define CSTD_CPU_32BIT 1
#else
#undef CSTD_OS_NONE
#define CSTD_OS_NONE 1
#undef CSTD_CPU_32BIT
#define CSTD_CPU_32BIT 1
#endif
#elif 1 == CSTD_TOOLCHAIN_RVCT
#if defined(ANDROID)
#undef CSTD_OS_ANDROID
#undef CSTD_OS_ANDROID32
#define CSTD_OS_ANDROID 1
#define CSTD_OS_ANDROID32 1
#elif defined(__linux)
#undef CSTD_OS_LINUX
#undef CSTD_OS_LINUX32
#define CSTD_OS_LINUX 1
#define CSTD_OS_LINUX32 1
#elif defined(__SYMBIAN32__)
#undef CSTD_OS_SYMBIAN
#define CSTD_OS_SYMBIAN 1
#else
#undef CSTD_OS_NONE
#define CSTD_OS_NONE 1
#endif
#else
#warning "Unsupported or unknown host OS"
#endif
/**
* @defgroup <API key> Linkage Specifiers
* @{
*
* This set of macros contain system-dependent linkage specifiers which
* determine the visibility of symbols across DLL boundaries. A header for a
* particular DLL should define a set of local macros derived from these,
* and should not use these macros to decorate functions directly as there may
* be multiple DLLs being used.
*
* These DLL library local macros should be (with appropriate library prefix)
* <tt>[MY_LIBRARY]_API</tt>, <tt>[MY_LIBRARY]_IMPL</tt>, and
* <tt>[MY_LIBRARY]_LOCAL</tt>.
*
* - <tt>[MY_LIBRARY]_API</tt> should be use to decorate the function
* declarations in the header. It should be defined as either
* @c CSTD_LINK_IMPORT or @c CSTD_LINK_EXPORT, depending whether the
* current situation is a compile of the DLL itself (use export) or a
* compile of an external user of the DLL (use import).
* - <tt>[MY_LIBRARY]_IMPL</tt> should be defined as @c CSTD_LINK_IMPL
* and should be used to decorate the definition of functions in the C
* file.
* - <tt>[MY_LIBRARY]_LOCAL</tt> should be used to decorate function
* declarations which are exported across translation units within the
* DLL, but which are not exported outside of the DLL boundary.
*
* Functions which are @c static in either a C file or in a header file do not
* need any form of linkage decoration, and should therefore have no linkage
* macro applied to them.
*/
/**
* @def CSTD_LINK_IMPORT
* Specifies a function as being imported to a translation unit across a DLL
* boundary.
*/
/**
* @def CSTD_LINK_EXPORT
* Specifies a function as being exported across a DLL boundary by a
* translation unit.
*/
/**
* @def CSTD_LINK_IMPL
* Specifies a function which will be exported across a DLL boundary as
* being implemented by a translation unit.
*/
/**
* @def CSTD_LINK_LOCAL
* Specifies a function which is internal to a DLL, and which should not be
* exported outside of it.
*/
#if 1 == CSTD_OS_LINUX
#define CSTD_LINK_IMPORT __attribute__((visibility("default")))
#define CSTD_LINK_EXPORT __attribute__((visibility("default")))
#define CSTD_LINK_IMPL __attribute__((visibility("default")))
#define CSTD_LINK_LOCAL __attribute__((visibility("hidden")))
#elif 1 == CSTD_OS_WINDOWS
#define CSTD_LINK_IMPORT __declspec(dllimport)
#define CSTD_LINK_EXPORT __declspec(dllexport)
#define CSTD_LINK_IMPL __declspec(dllexport)
#define CSTD_LINK_LOCAL
#elif 1 == CSTD_OS_SYMBIAN
#define CSTD_LINK_IMPORT IMPORT_C
#define CSTD_LINK_EXPORT IMPORT_C
#define CSTD_LINK_IMPL EXPORT_C
#define CSTD_LINK_LOCAL
#elif 1 == CSTD_OS_APPLEOS
#define CSTD_LINK_IMPORT __attribute__((visibility("default")))
#define CSTD_LINK_EXPORT __attribute__((visibility("default")))
#define CSTD_LINK_IMPL __attribute__((visibility("default")))
#define CSTD_LINK_LOCAL __attribute__((visibility("hidden")))
#else /* CSTD_OS_NONE */
#define CSTD_LINK_IMPORT
#define CSTD_LINK_EXPORT
#define CSTD_LINK_IMPL
#define CSTD_LINK_LOCAL
#endif
#endif /* End (<API key>) */ |
var m2_a1 = 10;
var m2_c1 = (function () {
function m2_c1() {
}
return m2_c1;
})();
var m2_instance1 = new m2_c1();
function m2_f1() {
return m2_instance1;
}
//# sourceMappingURL=../../../../../mapFiles/<API key>/m2.js.map |
package com.facebook.react.views.textinput;
public interface ContentSizeWatcher {
public void onLayout();
} |
// This file provides common functions for media actions.
window.__findMediaElements = function(selector) {
// Returns elements matching the selector, otherwise returns the first video
// or audio tag element that can be found.
// If selector == 'all', returns all media elements.
if (selector == 'all') {
return document.querySelectorAll('video, audio');
} else if (selector) {
return document.querySelectorAll(selector);
} else {
var media = document.<API key>('video');
if (media.length > 0) {
return [media[0]];
} else {
media = document.<API key>('audio');
if (media.length > 0) {
return [media[0]];
}
}
}
console.error('Could not find any media elements matching: ' + selector);
return [];
};
window.__hasEventCompleted = function(selector, event_name) {
// Return true if the event_name fired for media satisfying the selector.
var mediaElements = window.__findMediaElements(selector);
for (var i = 0; i < mediaElements.length; i++) {
if (!mediaElements[i][event_name + '_completed'])
return false;
}
return true;
};
window.<API key> = function(element) {
// Listens to HTML5 media errors.
function onError(e) {
window.__error = 'Media error: ' + e.type + ', code:' + e.target.error.code;
throw new Error(window.__error);
}
element.addEventListener('error', onError);
element.addEventListener('abort', onError);
};
window.<API key> = function(element, event_name) {
// Logs |even_name| on element when completed.
var logEventHappened = function(e) {
element[e.type + '_completed'] = true;
element.removeEventListener(event_name, logEventHappened);
}
element.addEventListener(event_name, logEventHappened);
};
window.__error = null; |
#ifndef _avr_functions_h_
#define _avr_functions_h_
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
void eeprom_initialize(void);
uint8_t eeprom_read_byte(const uint8_t *addr) __attribute__ ((pure));
uint16_t eeprom_read_word(const uint16_t *addr) __attribute__ ((pure));
uint32_t eeprom_read_dword(const uint32_t *addr) __attribute__ ((pure));
void eeprom_read_block(void *buf, const void *addr, uint32_t len);
void eeprom_write_byte(uint8_t *addr, uint8_t value);
void eeprom_write_word(uint16_t *addr, uint16_t value);
void eeprom_write_dword(uint32_t *addr, uint32_t value);
void eeprom_write_block(const void *buf, void *addr, uint32_t len);
int eeprom_is_ready(void);
#define eeprom_busy_wait() do {} while (!eeprom_is_ready())
static inline float eeprom_read_float(const float *addr) __attribute__((pure, always_inline, unused));
static inline float eeprom_read_float(const float *addr)
{
union {float f; uint32_t u32;} u;
u.u32 = eeprom_read_dword((const uint32_t *)addr);
return u.f;
}
static inline void eeprom_write_float(float *addr, float value) __attribute__((always_inline, unused));
static inline void eeprom_write_float(float *addr, float value)
{
union {float f; uint32_t u32;} u;
u.f = value;
eeprom_write_dword((uint32_t *)addr, u.u32);
}
static inline void eeprom_update_byte(uint8_t *addr, uint8_t value) __attribute__((always_inline, unused));
static inline void eeprom_update_byte(uint8_t *addr, uint8_t value)
{
eeprom_write_byte(addr, value);
}
static inline void eeprom_update_word(uint16_t *addr, uint16_t value) __attribute__((always_inline, unused));
static inline void eeprom_update_word(uint16_t *addr, uint16_t value)
{
eeprom_write_word(addr, value);
}
static inline void eeprom_update_dword(uint32_t *addr, uint32_t value) __attribute__((always_inline, unused));
static inline void eeprom_update_dword(uint32_t *addr, uint32_t value)
{
eeprom_write_dword(addr, value);
}
static inline void eeprom_update_float(float *addr, float value) __attribute__((always_inline, unused));
static inline void eeprom_update_float(float *addr, float value)
{
union {float f; uint32_t u32;} u;
u.f = value;
eeprom_write_dword((uint32_t *)addr, u.u32);
}
static inline void eeprom_update_block(const void *buf, void *addr, uint32_t len) __attribute__((always_inline, unused));
static inline void eeprom_update_block(const void *buf, void *addr, uint32_t len)
{
eeprom_write_block(buf, addr, len);
}
char * ultoa(unsigned long val, char *buf, int radix);
char * ltoa(long val, char *buf, int radix);
static inline char * utoa(unsigned int val, char *buf, int radix) __attribute__((always_inline, unused));
static inline char * utoa(unsigned int val, char *buf, int radix) { return ultoa(val, buf, radix); }
static inline char * itoa(int val, char *buf, int radix) __attribute__((always_inline, unused));
static inline char * itoa(int val, char *buf, int radix) { return ltoa(val, buf, radix); }
char * dtostrf(float val, int width, unsigned int precision, char *buf);
#ifdef __cplusplus
}
#endif
#endif |
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/power_supply.h>
#include <linux/olpc-ec.h>
#include <linux/acpi.h>
#include <asm/olpc.h>
#define DRV_NAME "olpc-xo15-sci"
#define PFX DRV_NAME ": "
#define XO15_SCI_CLASS DRV_NAME
#define <API key> "OLPC XO-1.5 SCI"
static unsigned long xo15_sci_gpe;
static bool lid_wake_on_close;
/*
* The normal ACPI LID wakeup behavior is wake-on-open, but not
* wake-on-close. This is implemented as standard by the XO-1.5 DSDT.
*
* We provide here a sysfs attribute that will additionally enable
* wake-on-close behavior. This is useful (e.g.) when we oportunistically
* suspend with the display running; if the lid is then closed, we want to
* wake up to turn the display off.
*
* This is controlled through a custom method in the XO-1.5 DSDT.
*/
static int <API key>(bool wake_on_close)
{
acpi_status status;
status = <API key>(NULL, "\\_SB.PCI0.LID.LIDW", wake_on_close);
if (ACPI_FAILURE(status)) {
pr_warning(PFX "failed to set lid behavior\n");
return 1;
}
lid_wake_on_close = wake_on_close;
return 0;
}
static ssize_t
<API key>(struct kobject *s, struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "%u\n", lid_wake_on_close);
}
static ssize_t <API key>(struct kobject *s,
struct kobj_attribute *attr,
const char *buf, size_t n)
{
unsigned int val;
if (sscanf(buf, "%u", &val) != 1)
return -EINVAL;
<API key>(!!val);
return n;
}
static struct kobj_attribute <API key> =
__ATTR(lid_wake_on_close, 0644,
<API key>,
<API key>);
static void <API key>(void)
{
struct power_supply *psy = <API key>("olpc-battery");
if (psy) {
<API key>(psy);
power_supply_put(psy);
}
}
static void ac_status_changed(void)
{
struct power_supply *psy = <API key>("olpc-ac");
if (psy) {
<API key>(psy);
power_supply_put(psy);
}
}
static void process_sci_queue(void)
{
u16 data;
int r;
do {
r = olpc_ec_sci_query(&data);
if (r || !data)
break;
pr_debug(PFX "SCI 0x%x received\n", data);
switch (data) {
case EC_SCI_SRC_BATERR:
case EC_SCI_SRC_BATSOC:
case EC_SCI_SRC_BATTERY:
case EC_SCI_SRC_BATCRIT:
<API key>();
break;
case EC_SCI_SRC_ACPWR:
ac_status_changed();
break;
}
} while (data);
if (r)
pr_err(PFX "Failed to clear SCI queue");
}
static void <API key>(struct work_struct *work)
{
process_sci_queue();
}
static DECLARE_WORK(sci_work, <API key>);
static u32 <API key>(acpi_handle gpe_device, u32 gpe, void *context)
{
schedule_work(&sci_work);
return <API key> | ACPI_REENABLE_GPE;
}
static int xo15_sci_add(struct acpi_device *device)
{
unsigned long long tmp;
acpi_status status;
int r;
if (!device)
return -EINVAL;
strcpy(acpi_device_name(device), <API key>);
strcpy(acpi_device_class(device), XO15_SCI_CLASS);
/* Get GPE bit assignment (EC events). */
status = <API key>(device->handle, "_GPE", NULL, &tmp);
if (ACPI_FAILURE(status))
return -EINVAL;
xo15_sci_gpe = tmp;
status = <API key>(NULL, xo15_sci_gpe,
<API key>,
<API key>, device);
if (ACPI_FAILURE(status))
return -ENODEV;
dev_info(&device->dev, "Initialized, GPE = 0x%lx\n", xo15_sci_gpe);
r = sysfs_create_file(&device->dev.kobj, &<API key>.attr);
if (r)
goto err_sysfs;
/* Flush queue, and enable all SCI events */
process_sci_queue();
olpc_ec_mask_write(EC_SCI_SRC_ALL);
acpi_enable_gpe(NULL, xo15_sci_gpe);
/* Enable wake-on-EC */
if (device->wakeup.flags.valid)
device_init_wakeup(&device->dev, true);
return 0;
err_sysfs:
<API key>(NULL, xo15_sci_gpe, <API key>);
cancel_work_sync(&sci_work);
return r;
}
static int xo15_sci_remove(struct acpi_device *device)
{
acpi_disable_gpe(NULL, xo15_sci_gpe);
<API key>(NULL, xo15_sci_gpe, <API key>);
cancel_work_sync(&sci_work);
sysfs_remove_file(&device->dev.kobj, &<API key>.attr);
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int xo15_sci_resume(struct device *dev)
{
/* Enable all EC events */
olpc_ec_mask_write(EC_SCI_SRC_ALL);
/* Power/battery status might have changed */
<API key>();
ac_status_changed();
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(xo15_sci_pm, NULL, xo15_sci_resume);
static const struct acpi_device_id xo15_sci_device_ids[] = {
{"XO15EC", 0},
{"", 0},
};
static struct acpi_driver xo15_sci_drv = {
.name = DRV_NAME,
.class = XO15_SCI_CLASS,
.ids = xo15_sci_device_ids,
.ops = {
.add = xo15_sci_add,
.remove = xo15_sci_remove,
},
.drv.pm = &xo15_sci_pm,
};
static int __init xo15_sci_init(void)
{
return <API key>(&xo15_sci_drv);
}
device_initcall(xo15_sci_init); |
/* Romanian translation for the jQuery Timepicker Addon */
/* Written by Romeo Adrian Cioaba */
(function($) {
$.timepicker.regional['ro'] = {
timeOnlyTitle: 'Alegeţi o oră',
timeText: 'Timp',
hourText: 'Ore',
minuteText: 'Minute',
secondText: 'Secunde',
millisecText: 'Milisecunde',
timezoneText: 'Fus orar',
currentText: 'Acum',
closeText: 'Închide',
timeFormat: 'hh:mm',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
ampm: false
};
$.timepicker.setDefaults($.timepicker.regional['ro']);
})(jQuery); |
/**
* This class creates a combobox control. Select box that you select a value from or
* type a value into.
*
* @-x-less ComboBox.less
* @class tinymce.ui.ComboBox
* @extends tinymce.ui.Widget
*/
define("tinymce/ui/ComboBox", [
"tinymce/ui/Widget",
"tinymce/ui/Factory",
"tinymce/ui/DomUtils",
"tinymce/dom/DomQuery"
], function(Widget, Factory, DomUtils, $) {
"use strict";
return Widget.extend({
/**
* Constructs a new control instance with the specified settings.
*
* @constructor
* @param {Object} settings Name/value object with settings.
* @setting {String} placeholder Placeholder text to display.
*/
init: function(settings) {
var self = this;
self._super(settings);
settings = self.settings;
self.classes.add('combobox');
self.subinput = true;
self.ariaTarget = 'inp'; // TODO: Figure out a better way
settings.menu = settings.menu || settings.values;
if (settings.menu) {
settings.icon = 'caret';
}
self.on('click', function(e) {
var elm = e.target, root = self.getEl();
if (!$.contains(root, elm) && elm != root) {
return;
}
while (elm && elm != root) {
if (elm.id && elm.id.indexOf('-open') != -1) {
self.fire('action');
if (settings.menu) {
self.showMenu();
if (e.aria) {
self.menu.items()[0].focus();
}
}
}
elm = elm.parentNode;
}
});
// TODO: Rework this
self.on('keydown', function(e) {
if (e.target.nodeName == "INPUT" && e.keyCode == 13) {
self.parents().reverse().each(function(ctrl) {
var stateValue = self.state.get('value'), inputValue = self.getEl('inp').value;
e.preventDefault();
self.state.set('value', inputValue);
if (stateValue != inputValue) {
self.fire('change');
}
if (ctrl.hasEventListeners('submit') && ctrl.toJSON) {
ctrl.fire('submit', {data: ctrl.toJSON()});
return false;
}
});
}
});
self.on('keyup', function(e) {
if (e.target.nodeName == "INPUT") {
self.state.set('value', e.target.value);
}
});
},
showMenu: function() {
var self = this, settings = self.settings, menu;
if (!self.menu) {
menu = settings.menu || [];
// Is menu array then auto constuct menu control
if (menu.length) {
menu = {
type: 'menu',
items: menu
};
} else {
menu.type = menu.type || 'menu';
}
self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm());
self.fire('createmenu');
self.menu.reflow();
self.menu.on('cancel', function(e) {
if (e.control === self.menu) {
self.focus();
}
});
self.menu.on('show hide', function(e) {
e.control.items().each(function(ctrl) {
ctrl.active(ctrl.value() == self.value());
});
}).fire('show');
self.menu.on('select', function(e) {
self.value(e.control.value());
});
self.on('focusin', function(e) {
if (e.target.tagName.toUpperCase() == 'INPUT') {
self.menu.hide();
}
});
self.aria('expanded', true);
}
self.menu.show();
self.menu.layoutRect({w: self.layoutRect().w});
self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']);
},
/**
* Focuses the input area of the control.
*
* @method focus
*/
focus: function() {
this.getEl('inp').focus();
},
/**
* Repaints the control after a layout operation.
*
* @method repaint
*/
repaint: function() {
var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect();
var width, lineHeight;
if (openElm) {
width = rect.w - DomUtils.getSize(openElm).width - 10;
} else {
width = rect.w - 10;
}
// Detect old IE 7+8 add lineHeight to align caret vertically in the middle
var doc = document;
if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
lineHeight = (self.layoutRect().h - 2) + 'px';
}
$(elm.firstChild).css({
width: width,
lineHeight: lineHeight
});
self._super();
return self;
},
/**
* Post render method. Called after the control has been rendered to the target.
*
* @method postRender
* @return {tinymce.ui.ComboBox} Current combobox instance.
*/
postRender: function() {
var self = this;
$(this.getEl('inp')).on('change', function(e) {
self.state.set('value', e.target.value);
self.fire('change', e);
});
return self._super();
},
/**
* Renders the control as a HTML string.
*
* @method renderHtml
* @return {String} HTML representing the control.
*/
renderHtml: function() {
var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
var value = self.state.get('value') || '';
var icon, text, openBtnHtml = '', extraAttrs = '';
if ("spellcheck" in settings) {
extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
}
if (settings.maxLength) {
extraAttrs += ' maxlength="' + settings.maxLength + '"';
}
if (settings.size) {
extraAttrs += ' size="' + settings.size + '"';
}
if (settings.subtype) {
extraAttrs += ' type="' + settings.subtype + '"';
}
if (self.disabled()) {
extraAttrs += ' disabled="disabled"';
}
icon = settings.icon;
if (icon && icon != 'caret') {
icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
}
text = self.state.get('text');
if (icon || text) {
openBtnHtml = (
'<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' +
'<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' +
(icon != 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
(text ? (icon ? ' ' : '') + text : '') +
'</button>' +
'</div>'
);
self.classes.add('has-open');
}
return (
'<div id="' + id + '" class="' + self.classes + '">' +
'<input id="' + id + '-inp" class="' + prefix + 'textbox" value="' +
self.encode(value, false) + '" hidefocus="1"' + extraAttrs + ' placeholder="' +
self.encode(settings.placeholder) + '" />' +
openBtnHtml +
'</div>'
);
},
value: function(value) {
if (arguments.length) {
this.state.set('value', value);
return this;
}
// Make sure the real state is in sync
if (this.state.get('rendered')) {
this.state.set('value', this.getEl('inp').value);
}
return this.state.get('value');
},
bindStates: function() {
var self = this;
self.state.on('change:value', function(e) {
if (self.getEl('inp').value != e.value) {
self.getEl('inp').value = e.value;
}
});
self.state.on('change:disabled', function(e) {
self.getEl('inp').disabled = e.value;
});
return self._super();
},
remove: function() {
$(this.getEl('inp')).off();
this._super();
}
});
}); |
require 'spec_helper'
describe "Zones", type: :feature, js: true do
stub_authorization!
before(:each) do
Spree::Zone.delete_all
visit spree.admin_path
click_link "Configuration"
end
context "show" do
it "should display existing zones" do
create(:zone, :name => "eastern", :description => "zone is eastern")
create(:zone, :name => "western", :description => "cool san fran")
click_link "Zones"
within_row(1) { expect(page).to have_content("eastern") }
within_row(2) { expect(page).to have_content("western") }
click_link "<API key>"
within_row(1) { expect(page).to have_content("western") }
within_row(2) { expect(page).to have_content("eastern") }
end
end
context "create" do
it "should allow an admin to create a new zone" do
click_link "Zones"
click_link "admin_new_zone_link"
expect(page).to have_content("New Zone")
fill_in "zone_name", :with => "japan"
fill_in "zone_description", :with => "japanese time zone"
click_button "Create"
expect(page).to have_content("successfully created!")
end
end
end |
#include <linux/netdevice.h>
#include <net/genetlink.h>
#include <net/netns/generic.h>
#include "datapath.h"
#include "vport-internal_dev.h"
#include "vport-netdev.h"
static void <API key>(struct vport *vport)
{
struct sk_buff *notify;
struct datapath *dp;
dp = vport->dp;
notify = <API key>(vport, 0, 0,
OVS_VPORT_CMD_DEL);
ovs_dp_detach_port(vport);
if (IS_ERR(notify)) {
netlink_set_err(ovs_dp_get_net(dp)->genl_sock, 0,
<API key>.id,
PTR_ERR(notify));
return;
}
<API key>(ovs_dp_get_net(dp), notify, 0,
<API key>.id,
GFP_KERNEL);
}
void ovs_dp_notify_wq(struct work_struct *work)
{
struct ovs_net *ovs_net = container_of(work, struct ovs_net, dp_notify_work);
struct datapath *dp;
ovs_lock();
list_for_each_entry(dp, &ovs_net->dps, list_node) {
int i;
for (i = 0; i < <API key>; i++) {
struct vport *vport;
struct hlist_node *n;
<API key>(vport, n, &dp->ports[i], dp_hash_node) {
struct netdev_vport *netdev_vport;
if (vport->ops->type != <API key>)
continue;
netdev_vport = netdev_vport_priv(vport);
if (netdev_vport->dev->reg_state == NETREG_UNREGISTERED ||
netdev_vport->dev->reg_state == <API key>)
<API key>(vport);
}
}
}
ovs_unlock();
}
static int dp_device_event(struct notifier_block *unused, unsigned long event,
void *ptr)
{
struct ovs_net *ovs_net;
struct net_device *dev = <API key>(ptr);
struct vport *vport = NULL;
if (!ovs_is_internal_dev(dev))
vport = <API key>(dev);
if (!vport)
return NOTIFY_DONE;
if (event == NETDEV_UNREGISTER) {
ovs_net = net_generic(dev_net(dev), ovs_net_id);
queue_work(system_wq, &ovs_net->dp_notify_work);
}
return NOTIFY_DONE;
}
struct notifier_block <API key> = {
.notifier_call = dp_device_event
}; |
package com.mogujie.tt.imservice.callback;
/**
* @author : yingmu on 15-1-7.
* @email : yingmu@mogujie.com.
*/
public interface IMListener<T> {
public abstract void onSuccess(T response);
public abstract void onFaild();
public abstract void onTimeout();
} |
<!DOCTYPE html>
<html>
<!
Copyright 2010 The Closure Library Authors. All Rights Reserved.
Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
<head>
<title>goog.silverlight.ClipboardButton</title>
<meta charset="utf-8">
<script src="../base.js"></script>
<script src="../../../third_party/closure/goog/deps.js"></script>
<script>
goog.require('goog.dom');
goog.require('goog.silverlight.CopyButton');
goog.require('goog.silverlight.PasteButton');
</script>
<link rel="stylesheet" href="css/demo.css">
<style>
</style>
</head>
<body>
<h1>goog.silverlight.ClipboardButton</h1>
<div>Click 'Paste' to alert the contents on your clipboard:</div>
<div id='pasteButton'></div>
<p/>
<div>Click 'Copy' to put the contents of
this textarea on your clipboard:</div>
<div id='copyButton'></div>
<textarea id='textarea'>
Content to copy
</textarea>
<script>
var $ = goog.dom.$;
var DIR = '../../../third_party/closure/goog/';
var XAP = DIR + 'silverlight/' +
'clipboardbuttonxap/Bin/Release/<API key>.xap';
if (goog.silverlight.ClipboardButton.hasClipboardAccess()) {
var pasteButton = new goog.silverlight.PasteButton(XAP);
pasteButton.render($('pasteButton'));
goog.events.listen(
pasteButton,
goog.silverlight.ClipboardEventType.PASTE,
function(e) {
alert(e.getData());
});
var copyButton = new goog.silverlight.CopyButton(XAP, 'Copy Textarea');
copyButton.render($('copyButton'));
goog.events.listen(
copyButton,
goog.silverlight.ClipboardEventType.COPY,
function(e) {
e.setData($('textarea').value);
});
} else {
document.write(
'<b>No native clipboard access--demo will not function</b>');
}
</script>
</body>
</html> |
IntlMessageFormat.__addLocaleData({"locale":"om","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
IntlMessageFormat.__addLocaleData({"locale":"om-KE","parentLocale":"om"}); |
IntlMessageFormat.__addLocaleData({"locale":"zu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}}); |
#include "Unmanaged.h"
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
/* No Need to do anything here -- for now */
return TRUE;
}
EXPORT VOID UnmanagedCode( int iGiven )
{
int i;
printf("[unmanaged code] software divide by zero:\n");
RaiseException( <API key>, 0, 0, 0);
printf("[unmanaged code] hardware divide by zero:\n");
i = 5 / iGiven;
printf("[unmanaged code] ... and survived? %i\n",i);
} |
import Redlock = require('redlock');
import { Lock } from 'redlock';
import { RedisClient } from 'redis';
import IoRedisClient = require('ioredis');
import { using } from 'bluebird';
const lock: Lock = <Lock> {};
const client1 = new RedisClient({port: 6379, host: 'redis1.example.com'});
const client2 = new RedisClient({port: 6379, host: 'redis2.example.com'});
const client3 = new IoRedisClient({port: 6379, host: 'redis3.example.com'});
const redlock = new Redlock(
[client1, client2, client3],
{
driftFactor: 0.01,
retryCount: 10,
retryDelay: 200,
retryJitter: 200
}
);
redlock.on('clientError', (err) => {
console.error('A redis error has occurred:', err);
});
redlock.acquire('resource', 30).then((lock: Lock) => {});
redlock.acquire('resource', 30, (err: any, lock: Lock) => {});
redlock.lock('resource', 30).then((lock: Lock) => {});
redlock.lock('resource', 30, (err: any, lock: Lock) => {});
using<Lock, void>(redlock.disposer('locks:account:322456', 1000, err => console.error(err)), (lock) => {
return Promise.resolve();
});
using<Lock, void>(redlock.disposer('locks:account:322456', 1000, err => console.error(err)), (lock) => {
return lock.extend(1000).then((extended: Lock) => {});
});
redlock.release(lock);
redlock.release(lock, (err: any) => {});
redlock.unlock(lock);
redlock.unlock(lock, (err: any) => {});
redlock.extend(lock, 30).then((lock: Lock) => {});
redlock.extend(lock, 30, (err: any, lock: Lock) => {});
lock.unlock();
lock.unlock((err) => {});
lock.extend(30).then((lock: Lock) => {});
lock.extend(30, (err: any, lock: Lock) => {});
redlock.lock('locks:account:322456', 1000).then((lock) => {
return lock
.unlock()
.catch((err) => {
console.error(err);
});
});
redlock.lock('locks:account:322456', 1000).then(lock => {
return lock
.extend(1000)
.then(lock => {
return lock
.unlock()
.catch(err => {
console.error(err);
});
});
});
redlock.lock('locks:account:322456', 1000, (err, lock) => {
if (err || !lock) {
} else {
lock.unlock(err => {
console.error(err);
});
}
});
redlock.lock('locks:account:322456', 1000, (err, lock) => {
if (err || !lock) {
} else {
lock.extend(1000, (err, lock) => {
if (err || !lock) {
} else {
lock.unlock();
}
});
}
});
new Object() instanceof redlock.Lock;
new Error() instanceof redlock.LockError;
redlock.LockError.prototype;
const lockError: Redlock.LockError = new redlock.LockError(); |
#define IN_LIBXML
#include "libxml.h"
#include <stdlib.h>
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/parserInternals.h>
#include <libxml/xmlstring.h>
/**
* xmlStrndup:
* @cur: the input xmlChar *
* @len: the len of @cur
*
* a strndup for array of xmlChar's
*
* Returns a new xmlChar * or NULL
*/
xmlChar *
xmlStrndup(const xmlChar *cur, int len) {
xmlChar *ret;
if ((cur == NULL) || (len < 0)) return(NULL);
ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
if (ret == NULL) {
xmlErrMemory(NULL, NULL);
return(NULL);
}
memcpy(ret, cur, len * sizeof(xmlChar));
ret[len] = 0;
return(ret);
}
/**
* xmlStrdup:
* @cur: the input xmlChar *
*
* a strdup for array of xmlChar's. Since they are supposed to be
* encoded in UTF-8 or an encoding with 8bit based chars, we assume
* a termination mark of '0'.
*
* Returns a new xmlChar * or NULL
*/
xmlChar *
xmlStrdup(const xmlChar *cur) {
const xmlChar *p = cur;
if (cur == NULL) return(NULL);
while (*p != 0) p++; /* non input consuming */
return(xmlStrndup(cur, p - cur));
}
/**
* xmlCharStrndup:
* @cur: the input char *
* @len: the len of @cur
*
* a strndup for char's to xmlChar's
*
* Returns a new xmlChar * or NULL
*/
xmlChar *
xmlCharStrndup(const char *cur, int len) {
int i;
xmlChar *ret;
if ((cur == NULL) || (len < 0)) return(NULL);
ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
if (ret == NULL) {
xmlErrMemory(NULL, NULL);
return(NULL);
}
for (i = 0;i < len;i++) {
ret[i] = (xmlChar) cur[i];
if (ret[i] == 0) return(ret);
}
ret[len] = 0;
return(ret);
}
/**
* xmlCharStrdup:
* @cur: the input char *
*
* a strdup for char's to xmlChar's
*
* Returns a new xmlChar * or NULL
*/
xmlChar *
xmlCharStrdup(const char *cur) {
const char *p = cur;
if (cur == NULL) return(NULL);
while (*p != '\0') p++; /* non input consuming */
return(xmlCharStrndup(cur, p - cur));
}
/**
* xmlStrcmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
*
* a strcmp for xmlChar's
*
* Returns the integer result of the comparison
*/
int
xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
register int tmp;
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
do {
tmp = *str1++ - *str2;
if (tmp != 0) return(tmp);
} while (*str2++ != 0);
return 0;
}
/**
* xmlStrEqual:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
*
* Check if both strings are equal of have same content.
* Should be a bit more readable and faster than xmlStrcmp()
*
* Returns 1 if they are equal, 0 if they are different
*/
int
xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
if (str1 == str2) return(1);
if (str1 == NULL) return(0);
if (str2 == NULL) return(0);
do {
if (*str1++ != *str2) return(0);
} while (*str2++);
return(1);
}
/**
* xmlStrQEqual:
* @pref: the prefix of the QName
* @name: the localname of the QName
* @str: the second xmlChar *
*
* Check if a QName is Equal to a given string
*
* Returns 1 if they are equal, 0 if they are different
*/
int
xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
if (pref == NULL) return(xmlStrEqual(name, str));
if (name == NULL) return(0);
if (str == NULL) return(0);
do {
if (*pref++ != *str) return(0);
} while ((*str++) && (*pref));
if (*str++ != ':') return(0);
do {
if (*name++ != *str) return(0);
} while (*str++);
return(1);
}
/**
* xmlStrncmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
* @len: the max comparison length
*
* a strncmp for xmlChar's
*
* Returns the integer result of the comparison
*/
int
xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
register int tmp;
if (len <= 0) return(0);
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
#ifdef __GNUC__
tmp = strncmp((const char *)str1, (const char *)str2, len);
return tmp;
#else
do {
tmp = *str1++ - *str2;
if (tmp != 0 || --len == 0) return(tmp);
} while (*str2++ != 0);
return 0;
#endif
}
static const xmlChar casemap[256] = {
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,
0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,
0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
0x78,0x79,0x7A,0x7B,0x5C,0x5D,0x5E,0x5F,
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,
0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,
0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,
0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,
0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,
0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,
0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,
0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,
0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
};
/**
* xmlStrcasecmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
*
* a strcasecmp for xmlChar's
*
* Returns the integer result of the comparison
*/
int
xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
register int tmp;
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
do {
tmp = casemap[*str1++] - casemap[*str2];
if (tmp != 0) return(tmp);
} while (*str2++ != 0);
return 0;
}
/**
* xmlStrncasecmp:
* @str1: the first xmlChar *
* @str2: the second xmlChar *
* @len: the max comparison length
*
* a strncasecmp for xmlChar's
*
* Returns the integer result of the comparison
*/
int
xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len) {
register int tmp;
if (len <= 0) return(0);
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
do {
tmp = casemap[*str1++] - casemap[*str2];
if (tmp != 0 || --len == 0) return(tmp);
} while (*str2++ != 0);
return 0;
}
/**
* xmlStrchr:
* @str: the xmlChar * array
* @val: the xmlChar to search
*
* a strchr for xmlChar's
*
* Returns the xmlChar * for the first occurrence or NULL.
*/
const xmlChar *
xmlStrchr(const xmlChar *str, xmlChar val) {
if (str == NULL) return(NULL);
while (*str != 0) { /* non input consuming */
if (*str == val) return((xmlChar *) str);
str++;
}
return(NULL);
}
/**
* xmlStrstr:
* @str: the xmlChar * array (haystack)
* @val: the xmlChar to search (needle)
*
* a strstr for xmlChar's
*
* Returns the xmlChar * for the first occurrence or NULL.
*/
const xmlChar *
xmlStrstr(const xmlChar *str, const xmlChar *val) {
int n;
if (str == NULL) return(NULL);
if (val == NULL) return(NULL);
n = xmlStrlen(val);
if (n == 0) return(str);
while (*str != 0) { /* non input consuming */
if (*str == *val) {
if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
}
str++;
}
return(NULL);
}
/**
* xmlStrcasestr:
* @str: the xmlChar * array (haystack)
* @val: the xmlChar to search (needle)
*
* a case-ignoring strstr for xmlChar's
*
* Returns the xmlChar * for the first occurrence or NULL.
*/
const xmlChar *
xmlStrcasestr(const xmlChar *str, const xmlChar *val) {
int n;
if (str == NULL) return(NULL);
if (val == NULL) return(NULL);
n = xmlStrlen(val);
if (n == 0) return(str);
while (*str != 0) { /* non input consuming */
if (casemap[*str] == casemap[*val])
if (!xmlStrncasecmp(str, val, n)) return(str);
str++;
}
return(NULL);
}
/**
* xmlStrsub:
* @str: the xmlChar * array (haystack)
* @start: the index of the first char (zero based)
* @len: the length of the substring
*
* Extract a substring of a given string
*
* Returns the xmlChar * for the first occurrence or NULL.
*/
xmlChar *
xmlStrsub(const xmlChar *str, int start, int len) {
int i;
if (str == NULL) return(NULL);
if (start < 0) return(NULL);
if (len < 0) return(NULL);
for (i = 0;i < start;i++) {
if (*str == 0) return(NULL);
str++;
}
if (*str == 0) return(NULL);
return(xmlStrndup(str, len));
}
/**
* xmlStrlen:
* @str: the xmlChar * array
*
* length of a xmlChar's string
*
* Returns the number of xmlChar contained in the ARRAY.
*/
int
xmlStrlen(const xmlChar *str) {
int len = 0;
if (str == NULL) return(0);
while (*str != 0) { /* non input consuming */
str++;
len++;
}
return(len);
}
/**
* xmlStrncat:
* @cur: the original xmlChar * array
* @add: the xmlChar * array added
* @len: the length of @add
*
* a strncat for array of xmlChar's, it will extend @cur with the len
* first bytes of @add. Note that if @len < 0 then this is an API error
* and NULL will be returned.
*
* Returns a new xmlChar *, the original @cur is reallocated if needed
* and should not be freed
*/
xmlChar *
xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
int size;
xmlChar *ret;
if ((add == NULL) || (len == 0))
return(cur);
if (len < 0)
return(NULL);
if (cur == NULL)
return(xmlStrndup(add, len));
size = xmlStrlen(cur);
ret = (xmlChar *) xmlRealloc(cur, (size + len + 1) * sizeof(xmlChar));
if (ret == NULL) {
xmlErrMemory(NULL, NULL);
return(cur);
}
memcpy(&ret[size], add, len * sizeof(xmlChar));
ret[size + len] = 0;
return(ret);
}
/**
* xmlStrncatNew:
* @str1: first xmlChar string
* @str2: second xmlChar string
* @len: the len of @str2 or < 0
*
* same as xmlStrncat, but creates a new string. The original
* two strings are not freed. If @len is < 0 then the length
* will be calculated automatically.
*
* Returns a new xmlChar * or NULL
*/
xmlChar *
xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
int size;
xmlChar *ret;
if (len < 0)
len = xmlStrlen(str2);
if ((str2 == NULL) || (len == 0))
return(xmlStrdup(str1));
if (str1 == NULL)
return(xmlStrndup(str2, len));
size = xmlStrlen(str1);
ret = (xmlChar *) xmlMalloc((size + len + 1) * sizeof(xmlChar));
if (ret == NULL) {
xmlErrMemory(NULL, NULL);
return(xmlStrndup(str1, size));
}
memcpy(ret, str1, size * sizeof(xmlChar));
memcpy(&ret[size], str2, len * sizeof(xmlChar));
ret[size + len] = 0;
return(ret);
}
/**
* xmlStrcat:
* @cur: the original xmlChar * array
* @add: the xmlChar * array added
*
* a strcat for array of xmlChar's. Since they are supposed to be
* encoded in UTF-8 or an encoding with 8bit based chars, we assume
* a termination mark of '0'.
*
* Returns a new xmlChar * containing the concatenated string.
*/
xmlChar *
xmlStrcat(xmlChar *cur, const xmlChar *add) {
const xmlChar *p = add;
if (add == NULL) return(cur);
if (cur == NULL)
return(xmlStrdup(add));
while (*p != 0) p++; /* non input consuming */
return(xmlStrncat(cur, add, p - add));
}
/**
* xmlStrPrintf:
* @buf: the result buffer.
* @len: the result buffer length.
* @msg: the message with printf formatting.
* @...: extra parameters for the message.
*
* Formats @msg and places result into @buf.
*
* Returns the number of characters written to @buf or -1 if an error occurs.
*/
int XMLCDECL
xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) {
va_list args;
int ret;
if((buf == NULL) || (msg == NULL)) {
return(-1);
}
va_start(args, msg);
ret = vsnprintf((char *) buf, len, (const char *) msg, args);
va_end(args);
buf[len - 1] = 0; /* be safe ! */
return(ret);
}
/**
* xmlStrVPrintf:
* @buf: the result buffer.
* @len: the result buffer length.
* @msg: the message with printf formatting.
* @ap: extra parameters for the message.
*
* Formats @msg and places result into @buf.
*
* Returns the number of characters written to @buf or -1 if an error occurs.
*/
int
xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) {
int ret;
if((buf == NULL) || (msg == NULL)) {
return(-1);
}
ret = vsnprintf((char *) buf, len, (const char *) msg, ap);
buf[len - 1] = 0; /* be safe ! */
return(ret);
}
/**
* xmlUTF8Size:
* @utf: pointer to the UTF8 character
*
* calculates the internal size of a UTF8 character
*
* returns the numbers of bytes in the character, -1 on format error
*/
int
xmlUTF8Size(const xmlChar *utf) {
xmlChar mask;
int len;
if (utf == NULL)
return -1;
if (*utf < 0x80)
return 1;
/* check valid UTF8 character */
if (!(*utf & 0x40))
return -1;
/* determine number of bytes in char */
len = 2;
for (mask=0x20; mask != 0; mask>>=1) {
if (!(*utf & mask))
return len;
len++;
}
return -1;
}
/**
* xmlUTF8Charcmp:
* @utf1: pointer to first UTF8 char
* @utf2: pointer to second UTF8 char
*
* compares the two UCS4 values
*
* returns result of the compare as with xmlStrncmp
*/
int
xmlUTF8Charcmp(const xmlChar *utf1, const xmlChar *utf2) {
if (utf1 == NULL ) {
if (utf2 == NULL)
return 0;
return -1;
}
return xmlStrncmp(utf1, utf2, xmlUTF8Size(utf1));
}
/**
* xmlUTF8Strlen:
* @utf: a sequence of UTF-8 encoded bytes
*
* compute the length of an UTF8 string, it doesn't do a full UTF8
* checking of the content of the string.
*
* Returns the number of characters in the string or -1 in case of error
*/
int
xmlUTF8Strlen(const xmlChar *utf) {
int ret = 0;
if (utf == NULL)
return(-1);
while (*utf != 0) {
if (utf[0] & 0x80) {
if ((utf[1] & 0xc0) != 0x80)
return(-1);
if ((utf[0] & 0xe0) == 0xe0) {
if ((utf[2] & 0xc0) != 0x80)
return(-1);
if ((utf[0] & 0xf0) == 0xf0) {
if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
return(-1);
utf += 4;
} else {
utf += 3;
}
} else {
utf += 2;
}
} else {
utf++;
}
ret++;
}
return(ret);
}
/**
* xmlGetUTF8Char:
* @utf: a sequence of UTF-8 encoded bytes
* @len: a pointer to the minimum number of bytes present in
* the sequence. This is used to assure the next character
* is completely contained within the sequence.
*
* Read the first UTF8 character from @utf
*
* Returns the char value or -1 in case of error, and sets *len to
* the actual number of bytes consumed (0 in case of error)
*/
int
xmlGetUTF8Char(const unsigned char *utf, int *len) {
unsigned int c;
if (utf == NULL)
goto error;
if (len == NULL)
goto error;
if (*len < 1)
goto error;
c = utf[0];
if (c & 0x80) {
if (*len < 2)
goto error;
if ((utf[1] & 0xc0) != 0x80)
goto error;
if ((c & 0xe0) == 0xe0) {
if (*len < 3)
goto error;
if ((utf[2] & 0xc0) != 0x80)
goto error;
if ((c & 0xf0) == 0xf0) {
if (*len < 4)
goto error;
if ((c & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
goto error;
*len = 4;
/* 4-byte code */
c = (utf[0] & 0x7) << 18;
c |= (utf[1] & 0x3f) << 12;
c |= (utf[2] & 0x3f) << 6;
c |= utf[3] & 0x3f;
} else {
/* 3-byte code */
*len = 3;
c = (utf[0] & 0xf) << 12;
c |= (utf[1] & 0x3f) << 6;
c |= utf[2] & 0x3f;
}
} else {
/* 2-byte code */
*len = 2;
c = (utf[0] & 0x1f) << 6;
c |= utf[1] & 0x3f;
}
} else {
/* 1-byte code */
*len = 1;
}
return(c);
error:
if (len != NULL)
*len = 0;
return(-1);
}
/**
* xmlCheckUTF8:
* @utf: Pointer to putative UTF-8 encoded string.
*
* Checks @utf for being valid UTF-8. @utf is assumed to be
* null-terminated. This function is not super-strict, as it will
* allow longer UTF-8 sequences than necessary. Note that Java is
* capable of producing these sequences if provoked. Also note, this
* routine checks for the 4-byte maximum size, but does not check for
* 0x10ffff maximum value.
*
* Return value: true if @utf is valid.
**/
int
xmlCheckUTF8(const unsigned char *utf)
{
int ix;
unsigned char c;
if (utf == NULL)
return(0);
/*
* utf is a string of 1, 2, 3 or 4 bytes. The valid strings
* are as follows (in "bit format"):
* 0xxxxxxx valid 1-byte
* 110xxxxx 10xxxxxx valid 2-byte
* 1110xxxx 10xxxxxx 10xxxxxx valid 3-byte
* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx valid 4-byte
*/
for (ix = 0; (c = utf[ix]);) { /* string is 0-terminated */
if ((c & 0x80) == 0x00) { /* 1-byte code, starts with 10 */
ix++;
} else if ((c & 0xe0) == 0xc0) {/* 2-byte code, starts with 110 */
if ((utf[ix+1] & 0xc0 ) != 0x80)
return 0;
ix += 2;
} else if ((c & 0xf0) == 0xe0) {/* 3-byte code, starts with 1110 */
if (((utf[ix+1] & 0xc0) != 0x80) ||
((utf[ix+2] & 0xc0) != 0x80))
return 0;
ix += 3;
} else if ((c & 0xf8) == 0xf0) {/* 4-byte code, starts with 11110 */
if (((utf[ix+1] & 0xc0) != 0x80) ||
((utf[ix+2] & 0xc0) != 0x80) ||
((utf[ix+3] & 0xc0) != 0x80))
return 0;
ix += 4;
} else /* unknown encoding */
return 0;
}
return(1);
}
/**
* xmlUTF8Strsize:
* @utf: a sequence of UTF-8 encoded bytes
* @len: the number of characters in the array
*
* storage size of an UTF8 string
* the behaviour is not garanteed if the input string is not UTF-8
*
* Returns the storage size of
* the first 'len' characters of ARRAY
*/
int
xmlUTF8Strsize(const xmlChar *utf, int len) {
const xmlChar *ptr=utf;
xmlChar ch;
if (utf == NULL)
return(0);
if (len <= 0)
return(0);
while ( len
if ( !*ptr )
break;
if ( (ch = *ptr++) & 0x80)
while ((ch<<=1) & 0x80 ) {
ptr++;
if (*ptr == 0) break;
}
}
return (ptr - utf);
}
/**
* xmlUTF8Strndup:
* @utf: the input UTF8 *
* @len: the len of @utf (in chars)
*
* a strndup for array of UTF8's
*
* Returns a new UTF8 * or NULL
*/
xmlChar *
xmlUTF8Strndup(const xmlChar *utf, int len) {
xmlChar *ret;
int i;
if ((utf == NULL) || (len < 0)) return(NULL);
i = xmlUTF8Strsize(utf, len);
ret = (xmlChar *) xmlMallocAtomic((i + 1) * sizeof(xmlChar));
if (ret == NULL) {
xmlGenericError(<API key>,
"malloc of %ld byte failed\n",
(len + 1) * (long)sizeof(xmlChar));
return(NULL);
}
memcpy(ret, utf, i * sizeof(xmlChar));
ret[i] = 0;
return(ret);
}
/**
* xmlUTF8Strpos:
* @utf: the input UTF8 *
* @pos: the position of the desired UTF8 char (in chars)
*
* a function to provide the equivalent of fetching a
* character from a string array
*
* Returns a pointer to the UTF8 character or NULL
*/
const xmlChar *
xmlUTF8Strpos(const xmlChar *utf, int pos) {
xmlChar ch;
if (utf == NULL) return(NULL);
if (pos < 0)
return(NULL);
while (pos
if ((ch=*utf++) == 0) return(NULL);
if ( ch & 0x80 ) {
/* if not simple ascii, verify proper format */
if ( (ch & 0xc0) != 0xc0 )
return(NULL);
/* then skip over remaining bytes for this char */
while ( (ch <<= 1) & 0x80 )
if ( (*utf++ & 0xc0) != 0x80 )
return(NULL);
}
}
return((xmlChar *)utf);
}
/**
* xmlUTF8Strloc:
* @utf: the input UTF8 *
* @utfchar: the UTF8 character to be found
*
* a function to provide the relative location of a UTF8 char
*
* Returns the relative character position of the desired char
* or -1 if not found
*/
int
xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
int i, size;
xmlChar ch;
if (utf==NULL || utfchar==NULL) return -1;
size = xmlUTF8Strsize(utfchar, 1);
for(i=0; (ch=*utf) != 0; i++) {
if (xmlStrncmp(utf, utfchar, size)==0)
return(i);
utf++;
if ( ch & 0x80 ) {
/* if not simple ascii, verify proper format */
if ( (ch & 0xc0) != 0xc0 )
return(-1);
/* then skip over remaining bytes for this char */
while ( (ch <<= 1) & 0x80 )
if ( (*utf++ & 0xc0) != 0x80 )
return(-1);
}
}
return(-1);
}
/**
* xmlUTF8Strsub:
* @utf: a sequence of UTF-8 encoded bytes
* @start: relative pos of first char
* @len: total number to copy
*
* Create a substring from a given UTF-8 string
* Note: positions are given in units of UTF-8 chars
*
* Returns a pointer to a newly created string
* or NULL if any problem
*/
xmlChar *
xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
int i;
xmlChar ch;
if (utf == NULL) return(NULL);
if (start < 0) return(NULL);
if (len < 0) return(NULL);
/*
* Skip over any leading chars
*/
for (i = 0;i < start;i++) {
if ((ch=*utf++) == 0) return(NULL);
if ( ch & 0x80 ) {
/* if not simple ascii, verify proper format */
if ( (ch & 0xc0) != 0xc0 )
return(NULL);
/* then skip over remaining bytes for this char */
while ( (ch <<= 1) & 0x80 )
if ( (*utf++ & 0xc0) != 0x80 )
return(NULL);
}
}
return(xmlUTF8Strndup(utf, len));
}
#define bottom_xmlstring
#include "elfgcchack.h" |
import { reduceRight } from "lodash";
export default reduceRight; |
#include <linux/linux_logo.h>
#include <linux/stddef.h>
#include <linux/module.h>
#ifdef CONFIG_M68K
#include <asm/setup.h>
#endif
static bool nologo;
module_param(nologo, bool, 0);
MODULE_PARM_DESC(nologo, "Disables startup logo");
/*
* Logos are located in the initdata, and will be freed in kernel_init.
* Use late_init to mark the logos as freed to prevent any further use.
*/
static bool logos_freed;
static int __init fb_logo_late_init(void)
{
logos_freed = true;
return 0;
}
late_initcall_sync(fb_logo_late_init);
/* logo's are marked __initdata. Use __ref to tell
* modpost that it is intended that this function uses data
* marked __initdata.
*/
const struct linux_logo * __ref fb_find_logo(int depth)
{
const struct linux_logo *logo = NULL;
if (nologo || logos_freed)
return NULL;
if (depth >= 1) {
#ifdef <API key>
/* Generic Linux logo */
logo = &logo_linux_mono;
#endif
#ifdef <API key>
/* SuperH Linux logo */
logo = &logo_superh_mono;
#endif
}
if (depth >= 4) {
#ifdef <API key>
/* Generic Linux logo */
logo = &logo_linux_vga16;
#endif
#ifdef <API key>
/* Blackfin processor logo */
logo = &logo_blackfin_vga16;
#endif
#ifdef <API key>
/* SuperH Linux logo */
logo = &logo_superh_vga16;
#endif
}
if (depth >= 8) {
#ifdef <API key>
/* Generic Linux logo */
logo = &logo_linux_clut224;
#endif
#ifdef <API key>
/* Blackfin Linux logo */
logo = &<API key>;
#endif
#ifdef <API key>
/* DEC Linux logo on MIPS/MIPS64 or ALPHA */
logo = &logo_dec_clut224;
#endif
#ifdef <API key>
/* Macintosh Linux logo on m68k */
if (MACH_IS_MAC)
logo = &logo_mac_clut224;
#endif
#ifdef <API key>
/* PA-RISC Linux logo */
logo = &logo_parisc_clut224;
#endif
#ifdef <API key>
/* SGI Linux logo on MIPS/MIPS64 */
logo = &logo_sgi_clut224;
#endif
#ifdef <API key>
/* Sun Linux logo */
logo = &logo_sun_clut224;
#endif
#ifdef <API key>
/* SuperH Linux logo */
logo = &logo_superh_clut224;
#endif
#ifdef <API key>
/* M32R Linux logo */
logo = &logo_m32r_clut224;
#endif
}
return logo;
}
EXPORT_SYMBOL_GPL(fb_find_logo); |
#if !defined(<API key>) || defined(<API key>)
#define <API key>
#include <linux/tracepoint.h>
#include <linux/trace_seq.h>
#include "hfi.h"
#undef TRACE_SYSTEM
#define TRACE_SYSTEM hfi1_ctxts
#define UCTXT_FMT \
"cred:%u, credaddr:0x%llx, piobase:0x%p, rcvhdr_cnt:%u, " \
"rcvbase:0x%llx, rcvegrc:%u, rcvegrb:0x%llx, subctxt_cnt:%u"
TRACE_EVENT(hfi1_uctxtdata,
TP_PROTO(struct hfi1_devdata *dd, struct hfi1_ctxtdata *uctxt,
unsigned int subctxt),
TP_ARGS(dd, uctxt, subctxt),
TP_STRUCT__entry(DD_DEV_ENTRY(dd)
__field(unsigned int, ctxt)
__field(unsigned int, subctxt)
__field(u32, credits)
__field(u64, hw_free)
__field(void __iomem *, piobase)
__field(u16, rcvhdrq_cnt)
__field(u64, rcvhdrq_dma)
__field(u32, eager_cnt)
__field(u64, rcvegr_dma)
__field(unsigned int, subctxt_cnt)
),
TP_fast_assign(DD_DEV_ASSIGN(dd);
__entry->ctxt = uctxt->ctxt;
__entry->subctxt = subctxt;
__entry->credits = uctxt->sc->credits;
__entry->hw_free = le64_to_cpu(*uctxt->sc->hw_free);
__entry->piobase = uctxt->sc->base_addr;
__entry->rcvhdrq_cnt = uctxt->rcvhdrq_cnt;
__entry->rcvhdrq_dma = uctxt->rcvhdrq_dma;
__entry->eager_cnt = uctxt->egrbufs.alloced;
__entry->rcvegr_dma = uctxt->egrbufs.rcvtids[0].dma;
__entry->subctxt_cnt = uctxt->subctxt_cnt;
),
TP_printk("[%s] ctxt %u:%u " UCTXT_FMT,
__get_str(dev),
__entry->ctxt,
__entry->subctxt,
__entry->credits,
__entry->hw_free,
__entry->piobase,
__entry->rcvhdrq_cnt,
__entry->rcvhdrq_dma,
__entry->eager_cnt,
__entry->rcvegr_dma,
__entry->subctxt_cnt
)
);
#define CINFO_FMT \
"egrtids:%u, egr_size:%u, hdrq_cnt:%u, hdrq_size:%u, sdma_ring_size:%u"
TRACE_EVENT(hfi1_ctxt_info,
TP_PROTO(struct hfi1_devdata *dd, unsigned int ctxt,
unsigned int subctxt,
struct hfi1_ctxt_info cinfo),
TP_ARGS(dd, ctxt, subctxt, cinfo),
TP_STRUCT__entry(DD_DEV_ENTRY(dd)
__field(unsigned int, ctxt)
__field(unsigned int, subctxt)
__field(u16, egrtids)
__field(u16, rcvhdrq_cnt)
__field(u16, rcvhdrq_size)
__field(u16, sdma_ring_size)
__field(u32, rcvegr_size)
),
TP_fast_assign(DD_DEV_ASSIGN(dd);
__entry->ctxt = ctxt;
__entry->subctxt = subctxt;
__entry->egrtids = cinfo.egrtids;
__entry->rcvhdrq_cnt = cinfo.rcvhdrq_cnt;
__entry->rcvhdrq_size = cinfo.rcvhdrq_entsize;
__entry->sdma_ring_size = cinfo.sdma_ring_size;
__entry->rcvegr_size = cinfo.rcvegr_size;
),
TP_printk("[%s] ctxt %u:%u " CINFO_FMT,
__get_str(dev),
__entry->ctxt,
__entry->subctxt,
__entry->egrtids,
__entry->rcvegr_size,
__entry->rcvhdrq_cnt,
__entry->rcvhdrq_size,
__entry->sdma_ring_size
)
);
#endif /* <API key> */
#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_FILE trace_ctxts
#include <trace/define_trace.h> |
// toObject with fallback for non-array-like ES3 strings
var IndexedObject = require('../internals/indexed-object');
var <API key> = require('../internals/<API key>');
module.exports = function (it) {
return IndexedObject(<API key>(it));
}; |
#include <linux/platform_device.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/sched.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/omap-dma.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/mtd/nand_bch.h>
#include <linux/platform_data/elm.h>
#include <linux/platform_data/mtd-nand-omap2.h>
#define DRIVER_NAME "omap2-nand"
#define <API key> 5000
#define NAND_Ecc_P1e (1 << 0)
#define NAND_Ecc_P2e (1 << 1)
#define NAND_Ecc_P4e (1 << 2)
#define NAND_Ecc_P8e (1 << 3)
#define NAND_Ecc_P16e (1 << 4)
#define NAND_Ecc_P32e (1 << 5)
#define NAND_Ecc_P64e (1 << 6)
#define NAND_Ecc_P128e (1 << 7)
#define NAND_Ecc_P256e (1 << 8)
#define NAND_Ecc_P512e (1 << 9)
#define NAND_Ecc_P1024e (1 << 10)
#define NAND_Ecc_P2048e (1 << 11)
#define NAND_Ecc_P1o (1 << 16)
#define NAND_Ecc_P2o (1 << 17)
#define NAND_Ecc_P4o (1 << 18)
#define NAND_Ecc_P8o (1 << 19)
#define NAND_Ecc_P16o (1 << 20)
#define NAND_Ecc_P32o (1 << 21)
#define NAND_Ecc_P64o (1 << 22)
#define NAND_Ecc_P128o (1 << 23)
#define NAND_Ecc_P256o (1 << 24)
#define NAND_Ecc_P512o (1 << 25)
#define NAND_Ecc_P1024o (1 << 26)
#define NAND_Ecc_P2048o (1 << 27)
#define TF(value) (value ? 1 : 0)
#define P2048e(a) (TF(a & NAND_Ecc_P2048e) << 0)
#define P2048o(a) (TF(a & NAND_Ecc_P2048o) << 1)
#define P1e(a) (TF(a & NAND_Ecc_P1e) << 2)
#define P1o(a) (TF(a & NAND_Ecc_P1o) << 3)
#define P2e(a) (TF(a & NAND_Ecc_P2e) << 4)
#define P2o(a) (TF(a & NAND_Ecc_P2o) << 5)
#define P4e(a) (TF(a & NAND_Ecc_P4e) << 6)
#define P4o(a) (TF(a & NAND_Ecc_P4o) << 7)
#define P8e(a) (TF(a & NAND_Ecc_P8e) << 0)
#define P8o(a) (TF(a & NAND_Ecc_P8o) << 1)
#define P16e(a) (TF(a & NAND_Ecc_P16e) << 2)
#define P16o(a) (TF(a & NAND_Ecc_P16o) << 3)
#define P32e(a) (TF(a & NAND_Ecc_P32e) << 4)
#define P32o(a) (TF(a & NAND_Ecc_P32o) << 5)
#define P64e(a) (TF(a & NAND_Ecc_P64e) << 6)
#define P64o(a) (TF(a & NAND_Ecc_P64o) << 7)
#define P128e(a) (TF(a & NAND_Ecc_P128e) << 0)
#define P128o(a) (TF(a & NAND_Ecc_P128o) << 1)
#define P256e(a) (TF(a & NAND_Ecc_P256e) << 2)
#define P256o(a) (TF(a & NAND_Ecc_P256o) << 3)
#define P512e(a) (TF(a & NAND_Ecc_P512e) << 4)
#define P512o(a) (TF(a & NAND_Ecc_P512o) << 5)
#define P1024e(a) (TF(a & NAND_Ecc_P1024e) << 6)
#define P1024o(a) (TF(a & NAND_Ecc_P1024o) << 7)
#define P8e_s(a) (TF(a & NAND_Ecc_P8e) << 0)
#define P8o_s(a) (TF(a & NAND_Ecc_P8o) << 1)
#define P16e_s(a) (TF(a & NAND_Ecc_P16e) << 2)
#define P16o_s(a) (TF(a & NAND_Ecc_P16o) << 3)
#define P1e_s(a) (TF(a & NAND_Ecc_P1e) << 4)
#define P1o_s(a) (TF(a & NAND_Ecc_P1o) << 5)
#define P2e_s(a) (TF(a & NAND_Ecc_P2e) << 6)
#define P2o_s(a) (TF(a & NAND_Ecc_P2o) << 7)
#define P4e_s(a) (TF(a & NAND_Ecc_P4e) << 0)
#define P4o_s(a) (TF(a & NAND_Ecc_P4o) << 1)
#define <API key> 24
#define ECC_CONFIG_CS_SHIFT 1
#define CS_MASK 0x7
#define ENABLE_PREFETCH (0x1 << 7)
#define DMA_MPU_MODE_SHIFT 2
#define ECCSIZE0_SHIFT 12
#define ECCSIZE1_SHIFT 22
#define ECC1RESULTSIZE 0x1
#define ECCCLEAR 0x100
#define ECC1 0x1
#define <API key> 0x40
#define <API key>(val) ((val) << 8)
#define <API key>(val) (val & 0x00003fff)
#define <API key>(val) ((val >> 24) & 0x7F)
#define STATUS_BUFF_EMPTY 0x00000001
#define OMAP24XX_DMA_GPMC 4
#define SECTOR_BYTES 512
/* 4 bit padding to make byte aligned, 56 = 52 + 4 */
#define BCH4_BIT_PAD 4
/* GPMC ecc engine settings for read */
#define BCH_WRAPMODE_1 1 /* BCH wrap mode 1 */
#define BCH8R_ECC_SIZE0 0x1a /* ecc_size0 = 26 */
#define BCH8R_ECC_SIZE1 0x2 /* ecc_size1 = 2 */
#define BCH4R_ECC_SIZE0 0xd /* ecc_size0 = 13 */
#define BCH4R_ECC_SIZE1 0x3 /* ecc_size1 = 3 */
/* GPMC ecc engine settings for write */
#define BCH_WRAPMODE_6 6 /* BCH wrap mode 6 */
#define BCH_ECC_SIZE0 0x0 /* ecc_size0 = 0, no oob protection */
#define BCH_ECC_SIZE1 0x20 /* ecc_size1 = 32 */
#define <API key> 2
static u_char bch16_vector[] = {0xf5, 0x24, 0x1c, 0xd0, 0x61, 0xb3, 0xf1, 0x55,
0x2e, 0x2c, 0x86, 0xa3, 0xed, 0x36, 0x1b, 0x78,
0x48, 0x76, 0xa9, 0x3b, 0x97, 0xd1, 0x7a, 0x93,
0x07, 0x0e};
static u_char bch8_vector[] = {0xf3, 0xdb, 0x14, 0x16, 0x8b, 0xd2, 0xbe, 0xcc,
0xac, 0x6b, 0xff, 0x99, 0x7b};
static u_char bch4_vector[] = {0x00, 0x6b, 0x31, 0xdd, 0x41, 0xbc, 0x10};
/* Shared among all NAND instances to synchronize access to the ECC Engine */
static struct nand_hw_control <API key> = {
.lock = <API key>(<API key>.lock),
.wq = <API key>(<API key>.wq),
};
struct omap_nand_info {
struct <API key> *pdata;
struct mtd_info mtd;
struct nand_chip nand;
struct platform_device *pdev;
int gpmc_cs;
unsigned long phys_base;
enum omap_ecc ecc_opt;
struct completion comp;
struct dma_chan *dma;
int gpmc_irq_fifo;
int gpmc_irq_count;
enum {
OMAP_NAND_IO_READ = 0, /* read */
OMAP_NAND_IO_WRITE, /* write */
} iomode;
u_char *buf;
int buf_len;
struct gpmc_nand_regs reg;
/* generated at runtime depending on ECC algorithm and layout selected */
struct nand_ecclayout oobinfo;
/* fields specific for BCHx_HW ECC scheme */
struct device *elm_dev;
struct device_node *of_node;
};
/**
* <API key> - configures and starts prefetch transfer
* @cs: cs (chip select) number
* @fifo_th: fifo threshold to be used for read/ write
* @dma_mode: dma mode enable (1) or disable (0)
* @u32_count: number of bytes to be transferred
* @is_write: prefetch read(0) or write post(1) mode
*/
static int <API key>(int cs, int fifo_th, int dma_mode,
unsigned int u32_count, int is_write, struct omap_nand_info *info)
{
u32 val;
if (fifo_th > <API key>)
return -1;
if (readl(info->reg.<API key>))
return -EBUSY;
/* Set the amount of bytes to be prefetched */
writel(u32_count, info->reg.<API key>);
/* Set dma/mpu mode, the prefetch read / post write and
* enable the engine. Set which cs is has requested for.
*/
val = ((cs << <API key>) |
<API key>(fifo_th) | ENABLE_PREFETCH |
(dma_mode << DMA_MPU_MODE_SHIFT) | (0x1 & is_write));
writel(val, info->reg.<API key>);
/* Start the prefetch engine */
writel(0x1, info->reg.<API key>);
return 0;
}
/**
* omap_prefetch_reset - disables and stops the prefetch engine
*/
static int omap_prefetch_reset(int cs, struct omap_nand_info *info)
{
u32 config1;
/* check if the same module/cs is trying to reset */
config1 = readl(info->reg.<API key>);
if (((config1 >> <API key>) & CS_MASK) != cs)
return -EINVAL;
/* Stop the PFPW engine */
writel(0x0, info->reg.<API key>);
/* Reset/disable the PFPW engine */
writel(0x0, info->reg.<API key>);
return 0;
}
/**
* omap_hwcontrol - hardware specific access to control-lines
* @mtd: MTD device structure
* @cmd: command to device
* @ctrl:
* NAND_NCE: bit 0 -> don't care
* NAND_CLE: bit 1 -> Command Latch
* NAND_ALE: bit 2 -> Address Latch
*
* NOTE: boards may use different bits for these!!
*/
static void omap_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
if (cmd != NAND_CMD_NONE) {
if (ctrl & NAND_CLE)
writeb(cmd, info->reg.gpmc_nand_command);
else if (ctrl & NAND_ALE)
writeb(cmd, info->reg.gpmc_nand_address);
else /* NAND_NCE */
writeb(cmd, info->reg.gpmc_nand_data);
}
}
/**
* omap_read_buf8 - read data from NAND controller into buffer
* @mtd: MTD device structure
* @buf: buffer to store date
* @len: number of bytes to read
*/
static void omap_read_buf8(struct mtd_info *mtd, u_char *buf, int len)
{
struct nand_chip *nand = mtd->priv;
ioread8_rep(nand->IO_ADDR_R, buf, len);
}
/**
* omap_write_buf8 - write buffer to NAND controller
* @mtd: MTD device structure
* @buf: data buffer
* @len: number of bytes to write
*/
static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
u_char *p = (u_char *)buf;
u32 status = 0;
while (len
iowrite8(*p++, info->nand.IO_ADDR_W);
/* wait until buffer is available for write */
do {
status = readl(info->reg.gpmc_status) &
STATUS_BUFF_EMPTY;
} while (!status);
}
}
/**
* omap_read_buf16 - read data from NAND controller into buffer
* @mtd: MTD device structure
* @buf: buffer to store date
* @len: number of bytes to read
*/
static void omap_read_buf16(struct mtd_info *mtd, u_char *buf, int len)
{
struct nand_chip *nand = mtd->priv;
ioread16_rep(nand->IO_ADDR_R, buf, len / 2);
}
/**
* omap_write_buf16 - write buffer to NAND controller
* @mtd: MTD device structure
* @buf: data buffer
* @len: number of bytes to write
*/
static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
u16 *p = (u16 *) buf;
u32 status = 0;
/* FIXME try bursts of writesw() or DMA ... */
len >>= 1;
while (len
iowrite16(*p++, info->nand.IO_ADDR_W);
/* wait until buffer is available for write */
do {
status = readl(info->reg.gpmc_status) &
STATUS_BUFF_EMPTY;
} while (!status);
}
}
/**
* omap_read_buf_pref - read data from NAND controller into buffer
* @mtd: MTD device structure
* @buf: buffer to store date
* @len: number of bytes to read
*/
static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
uint32_t r_count = 0;
int ret = 0;
u32 *p = (u32 *)buf;
/* take care of subpage reads */
if (len % 4) {
if (info->nand.options & NAND_BUSWIDTH_16)
omap_read_buf16(mtd, buf, len % 4);
else
omap_read_buf8(mtd, buf, len % 4);
p = (u32 *) (buf + len % 4);
len -= len % 4;
}
/* configure and start prefetch transfer */
ret = <API key>(info->gpmc_cs,
<API key>, 0x0, len, 0x0, info);
if (ret) {
/* PFPW engine is busy, use cpu copy method */
if (info->nand.options & NAND_BUSWIDTH_16)
omap_read_buf16(mtd, (u_char *)p, len);
else
omap_read_buf8(mtd, (u_char *)p, len);
} else {
do {
r_count = readl(info->reg.<API key>);
r_count = <API key>(r_count);
r_count = r_count >> 2;
ioread32_rep(info->nand.IO_ADDR_R, p, r_count);
p += r_count;
len -= r_count << 2;
} while (len);
/* disable and stop the PFPW engine */
omap_prefetch_reset(info->gpmc_cs, info);
}
}
/**
* omap_write_buf_pref - write buffer to NAND controller
* @mtd: MTD device structure
* @buf: data buffer
* @len: number of bytes to write
*/
static void omap_write_buf_pref(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
uint32_t w_count = 0;
int i = 0, ret = 0;
u16 *p = (u16 *)buf;
unsigned long tim, limit;
u32 val;
/* take care of subpage writes */
if (len % 2 != 0) {
writeb(*buf, info->nand.IO_ADDR_W);
p = (u16 *)(buf + 1);
len
}
/* configure and start prefetch transfer */
ret = <API key>(info->gpmc_cs,
<API key>, 0x0, len, 0x1, info);
if (ret) {
/* PFPW engine is busy, use cpu copy method */
if (info->nand.options & NAND_BUSWIDTH_16)
omap_write_buf16(mtd, (u_char *)p, len);
else
omap_write_buf8(mtd, (u_char *)p, len);
} else {
while (len) {
w_count = readl(info->reg.<API key>);
w_count = <API key>(w_count);
w_count = w_count >> 1;
for (i = 0; (i < w_count) && len; i++, len -= 2)
iowrite16(*p++, info->nand.IO_ADDR_W);
}
/* wait for data to flushed-out before reset the prefetch */
tim = 0;
limit = (loops_per_jiffy *
msecs_to_jiffies(<API key>));
do {
cpu_relax();
val = readl(info->reg.<API key>);
val = <API key>(val);
} while (val && (tim++ < limit));
/* disable and stop the PFPW engine */
omap_prefetch_reset(info->gpmc_cs, info);
}
}
/*
* <API key>: callback on the completion of dma transfer
* @data: pointer to completion data structure
*/
static void <API key>(void *data)
{
complete((struct completion *) data);
}
/*
* <API key>: configure and start dma transfer
* @mtd: MTD device structure
* @addr: virtual address in RAM of source/destination
* @len: number of data bytes to be transferred
* @is_write: flag for read/write operation
*/
static inline int <API key>(struct mtd_info *mtd, void *addr,
unsigned int len, int is_write)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
struct <API key> *tx;
enum dma_data_direction dir = is_write ? DMA_TO_DEVICE :
DMA_FROM_DEVICE;
struct scatterlist sg;
unsigned long tim, limit;
unsigned n;
int ret;
u32 val;
if (addr >= high_memory) {
struct page *p1;
if (((size_t)addr & PAGE_MASK) !=
((size_t)(addr + len - 1) & PAGE_MASK))
goto out_copy;
p1 = vmalloc_to_page(addr);
if (!p1)
goto out_copy;
addr = page_address(p1) + ((size_t)addr & ~PAGE_MASK);
}
sg_init_one(&sg, addr, len);
n = dma_map_sg(info->dma->device->dev, &sg, 1, dir);
if (n == 0) {
dev_err(&info->pdev->dev,
"Couldn't DMA map a %d byte buffer\n", len);
goto out_copy;
}
tx = <API key>(info->dma, &sg, n,
is_write ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!tx)
goto out_copy_unmap;
tx->callback = <API key>;
tx->callback_param = &info->comp;
dmaengine_submit(tx);
/* configure and start prefetch transfer */
ret = <API key>(info->gpmc_cs,
<API key>, 0x1, len, is_write, info);
if (ret)
/* PFPW engine is busy, use cpu copy method */
goto out_copy_unmap;
init_completion(&info->comp);
<API key>(info->dma);
/* setup and start DMA using dma_addr */
wait_for_completion(&info->comp);
tim = 0;
limit = (loops_per_jiffy * msecs_to_jiffies(<API key>));
do {
cpu_relax();
val = readl(info->reg.<API key>);
val = <API key>(val);
} while (val && (tim++ < limit));
/* disable and stop the PFPW engine */
omap_prefetch_reset(info->gpmc_cs, info);
dma_unmap_sg(info->dma->device->dev, &sg, 1, dir);
return 0;
out_copy_unmap:
dma_unmap_sg(info->dma->device->dev, &sg, 1, dir);
out_copy:
if (info->nand.options & NAND_BUSWIDTH_16)
is_write == 0 ? omap_read_buf16(mtd, (u_char *) addr, len)
: omap_write_buf16(mtd, (u_char *) addr, len);
else
is_write == 0 ? omap_read_buf8(mtd, (u_char *) addr, len)
: omap_write_buf8(mtd, (u_char *) addr, len);
return 0;
}
/**
* <API key> - read data from NAND controller into buffer
* @mtd: MTD device structure
* @buf: buffer to store date
* @len: number of bytes to read
*/
static void <API key>(struct mtd_info *mtd, u_char *buf, int len)
{
if (len <= mtd->oobsize)
omap_read_buf_pref(mtd, buf, len);
else
/* start transfer in DMA mode */
<API key>(mtd, buf, len, 0x0);
}
/**
* <API key> - write buffer to NAND controller
* @mtd: MTD device structure
* @buf: data buffer
* @len: number of bytes to write
*/
static void <API key>(struct mtd_info *mtd,
const u_char *buf, int len)
{
if (len <= mtd->oobsize)
omap_write_buf_pref(mtd, buf, len);
else
/* start transfer in DMA mode */
<API key>(mtd, (u_char *) buf, len, 0x1);
}
/*
* omap_nand_irq - GPMC irq handler
* @this_irq: gpmc irq number
* @dev: omap_nand_info structure pointer is passed here
*/
static irqreturn_t omap_nand_irq(int this_irq, void *dev)
{
struct omap_nand_info *info = (struct omap_nand_info *) dev;
u32 bytes;
bytes = readl(info->reg.<API key>);
bytes = <API key>(bytes);
bytes = bytes & 0xFFFC; /* io in multiple of 4 bytes */
if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
if (this_irq == info->gpmc_irq_count)
goto done;
if (info->buf_len && (info->buf_len < bytes))
bytes = info->buf_len;
else if (!info->buf_len)
bytes = 0;
iowrite32_rep(info->nand.IO_ADDR_W,
(u32 *)info->buf, bytes >> 2);
info->buf = info->buf + bytes;
info->buf_len -= bytes;
} else {
ioread32_rep(info->nand.IO_ADDR_R,
(u32 *)info->buf, bytes >> 2);
info->buf = info->buf + bytes;
if (this_irq == info->gpmc_irq_count)
goto done;
}
return IRQ_HANDLED;
done:
complete(&info->comp);
disable_irq_nosync(info->gpmc_irq_fifo);
disable_irq_nosync(info->gpmc_irq_count);
return IRQ_HANDLED;
}
/*
* <API key> - read data from NAND controller into buffer
* @mtd: MTD device structure
* @buf: buffer to store date
* @len: number of bytes to read
*/
static void <API key>(struct mtd_info *mtd, u_char *buf, int len)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
int ret = 0;
if (len <= mtd->oobsize) {
omap_read_buf_pref(mtd, buf, len);
return;
}
info->iomode = OMAP_NAND_IO_READ;
info->buf = buf;
init_completion(&info->comp);
/* configure and start prefetch transfer */
ret = <API key>(info->gpmc_cs,
<API key>/2, 0x0, len, 0x0, info);
if (ret)
/* PFPW engine is busy, use cpu copy method */
goto out_copy;
info->buf_len = len;
enable_irq(info->gpmc_irq_count);
enable_irq(info->gpmc_irq_fifo);
/* waiting for read to complete */
wait_for_completion(&info->comp);
/* disable and stop the PFPW engine */
omap_prefetch_reset(info->gpmc_cs, info);
return;
out_copy:
if (info->nand.options & NAND_BUSWIDTH_16)
omap_read_buf16(mtd, buf, len);
else
omap_read_buf8(mtd, buf, len);
}
/*
* <API key> - write buffer to NAND controller
* @mtd: MTD device structure
* @buf: data buffer
* @len: number of bytes to write
*/
static void <API key>(struct mtd_info *mtd,
const u_char *buf, int len)
{
struct omap_nand_info *info = container_of(mtd,
struct omap_nand_info, mtd);
int ret = 0;
unsigned long tim, limit;
u32 val;
if (len <= mtd->oobsize) {
omap_write_buf_pref(mtd, buf, len);
return;
}
info->iomode = OMAP_NAND_IO_WRITE;
info->buf = (u_char *) buf;
init_completion(&info->comp);
/* configure and start prefetch transfer : size=24 */
ret = <API key>(info->gpmc_cs,
(<API key> * 3) / 8, 0x0, len, 0x1, info);
if (ret)
/* PFPW engine is busy, use cpu copy method */
goto out_copy;
info->buf_len = len;
enable_irq(info->gpmc_irq_count);
enable_irq(info->gpmc_irq_fifo);
/* waiting for write to complete */
wait_for_completion(&info->comp);
/* wait for data to flushed-out before reset the prefetch */
tim = 0;
limit = (loops_per_jiffy * msecs_to_jiffies(<API key>));
do {
val = readl(info->reg.<API key>);
val = <API key>(val);
cpu_relax();
} while (val && (tim++ < limit));
/* disable and stop the PFPW engine */
omap_prefetch_reset(info->gpmc_cs, info);
return;
out_copy:
if (info->nand.options & NAND_BUSWIDTH_16)
omap_write_buf16(mtd, buf, len);
else
omap_write_buf8(mtd, buf, len);
}
/**
* gen_true_ecc - This function will generate true ECC value
* @ecc_buf: buffer to store ecc code
*
* This generated true ECC value can be used when correcting
* data read from NAND flash memory core
*/
static void gen_true_ecc(u8 *ecc_buf)
{
u32 tmp = ecc_buf[0] | (ecc_buf[1] << 16) |
((ecc_buf[2] & 0xF0) << 20) | ((ecc_buf[2] & 0x0F) << 8);
ecc_buf[0] = ~(P64o(tmp) | P64e(tmp) | P32o(tmp) | P32e(tmp) |
P16o(tmp) | P16e(tmp) | P8o(tmp) | P8e(tmp));
ecc_buf[1] = ~(P1024o(tmp) | P1024e(tmp) | P512o(tmp) | P512e(tmp) |
P256o(tmp) | P256e(tmp) | P128o(tmp) | P128e(tmp));
ecc_buf[2] = ~(P4o(tmp) | P4e(tmp) | P2o(tmp) | P2e(tmp) | P1o(tmp) |
P1e(tmp) | P2048o(tmp) | P2048e(tmp));
}
/**
* omap_compare_ecc - Detect (2 bits) and correct (1 bit) error in data
* @ecc_data1: ecc code from nand spare area
* @ecc_data2: ecc code from hardware register obtained from hardware ecc
* @page_data: page data
*
* This function compares two ECC's and indicates if there is an error.
* If the error can be corrected it will be corrected to the buffer.
* If there is no error, %0 is returned. If there is an error but it
* was corrected, %1 is returned. Otherwise, %-1 is returned.
*/
static int omap_compare_ecc(u8 *ecc_data1, /* read from NAND memory */
u8 *ecc_data2, /* read from register */
u8 *page_data)
{
uint i;
u8 tmp0_bit[8], tmp1_bit[8], tmp2_bit[8];
u8 comp0_bit[8], comp1_bit[8], comp2_bit[8];
u8 ecc_bit[24];
u8 ecc_sum = 0;
u8 find_bit = 0;
uint find_byte = 0;
int isEccFF;
isEccFF = ((*(u32 *)ecc_data1 & 0xFFFFFF) == 0xFFFFFF);
gen_true_ecc(ecc_data1);
gen_true_ecc(ecc_data2);
for (i = 0; i <= 2; i++) {
*(ecc_data1 + i) = ~(*(ecc_data1 + i));
*(ecc_data2 + i) = ~(*(ecc_data2 + i));
}
for (i = 0; i < 8; i++) {
tmp0_bit[i] = *ecc_data1 % 2;
*ecc_data1 = *ecc_data1 / 2;
}
for (i = 0; i < 8; i++) {
tmp1_bit[i] = *(ecc_data1 + 1) % 2;
*(ecc_data1 + 1) = *(ecc_data1 + 1) / 2;
}
for (i = 0; i < 8; i++) {
tmp2_bit[i] = *(ecc_data1 + 2) % 2;
*(ecc_data1 + 2) = *(ecc_data1 + 2) / 2;
}
for (i = 0; i < 8; i++) {
comp0_bit[i] = *ecc_data2 % 2;
*ecc_data2 = *ecc_data2 / 2;
}
for (i = 0; i < 8; i++) {
comp1_bit[i] = *(ecc_data2 + 1) % 2;
*(ecc_data2 + 1) = *(ecc_data2 + 1) / 2;
}
for (i = 0; i < 8; i++) {
comp2_bit[i] = *(ecc_data2 + 2) % 2;
*(ecc_data2 + 2) = *(ecc_data2 + 2) / 2;
}
for (i = 0; i < 6; i++)
ecc_bit[i] = tmp2_bit[i + 2] ^ comp2_bit[i + 2];
for (i = 0; i < 8; i++)
ecc_bit[i + 6] = tmp0_bit[i] ^ comp0_bit[i];
for (i = 0; i < 8; i++)
ecc_bit[i + 14] = tmp1_bit[i] ^ comp1_bit[i];
ecc_bit[22] = tmp2_bit[0] ^ comp2_bit[0];
ecc_bit[23] = tmp2_bit[1] ^ comp2_bit[1];
for (i = 0; i < 24; i++)
ecc_sum += ecc_bit[i];
switch (ecc_sum) {
case 0:
/* Not reached because this function is not called if
* ECC values are equal
*/
return 0;
case 1:
/* Uncorrectable error */
pr_debug("ECC UNCORRECTED_ERROR 1\n");
return -1;
case 11:
/* UN-Correctable error */
pr_debug("ECC UNCORRECTED_ERROR B\n");
return -1;
case 12:
/* Correctable error */
find_byte = (ecc_bit[23] << 8) +
(ecc_bit[21] << 7) +
(ecc_bit[19] << 6) +
(ecc_bit[17] << 5) +
(ecc_bit[15] << 4) +
(ecc_bit[13] << 3) +
(ecc_bit[11] << 2) +
(ecc_bit[9] << 1) +
ecc_bit[7];
find_bit = (ecc_bit[5] << 2) + (ecc_bit[3] << 1) + ecc_bit[1];
pr_debug("Correcting single bit ECC error at offset: "
"%d, bit: %d\n", find_byte, find_bit);
page_data[find_byte] ^= (1 << find_bit);
return 1;
default:
if (isEccFF) {
if (ecc_data2[0] == 0 &&
ecc_data2[1] == 0 &&
ecc_data2[2] == 0)
return 0;
}
pr_debug("UNCORRECTED_ERROR default\n");
return -1;
}
}
/**
* omap_correct_data - Compares the ECC read with HW generated ECC
* @mtd: MTD device structure
* @dat: page data
* @read_ecc: ecc read from nand flash
* @calc_ecc: ecc read from HW ECC registers
*
* Compares the ecc read from nand spare area with ECC registers values
* and if ECC's mismatched, it will call 'omap_compare_ecc' for error
* detection and correction. If there are no errors, %0 is returned. If
* there were errors and all of the errors were corrected, the number of
* corrected errors is returned. If uncorrectable errors exist, %-1 is
* returned.
*/
static int omap_correct_data(struct mtd_info *mtd, u_char *dat,
u_char *read_ecc, u_char *calc_ecc)
{
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
int blockCnt = 0, i = 0, ret = 0;
int stat = 0;
/* Ex NAND_ECC_HW12_2048 */
if ((info->nand.ecc.mode == NAND_ECC_HW) &&
(info->nand.ecc.size == 2048))
blockCnt = 4;
else
blockCnt = 1;
for (i = 0; i < blockCnt; i++) {
if (memcmp(read_ecc, calc_ecc, 3) != 0) {
ret = omap_compare_ecc(read_ecc, calc_ecc, dat);
if (ret < 0)
return ret;
/* keep track of the number of corrected errors */
stat += ret;
}
read_ecc += 3;
calc_ecc += 3;
dat += 512;
}
return stat;
}
/**
* omap_calcuate_ecc - Generate non-inverted ECC bytes.
* @mtd: MTD device structure
* @dat: The pointer to data on which ecc is computed
* @ecc_code: The ecc_code buffer
*
* Using noninverted ECC can be considered ugly since writing a blank
* page ie. padding will clear the ECC bytes. This is no problem as long
* nobody is trying to write data on the seemingly unused page. Reading
* an erased page will produce an ECC mismatch between generated and read
* ECC bytes that has to be dealt with separately.
*/
static int omap_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
u_char *ecc_code)
{
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
u32 val;
val = readl(info->reg.gpmc_ecc_config);
if (((val >> ECC_CONFIG_CS_SHIFT) & CS_MASK) != info->gpmc_cs)
return -EINVAL;
/* read ecc result */
val = readl(info->reg.gpmc_ecc1_result);
*ecc_code++ = val; /* P128e, ..., P1e */
*ecc_code++ = val >> 16; /* P128o, ..., P1o */
/* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */
*ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0);
return 0;
}
/**
* omap_enable_hwecc - This function enables the hardware ecc functionality
* @mtd: MTD device structure
* @mode: Read/Write mode
*/
static void omap_enable_hwecc(struct mtd_info *mtd, int mode)
{
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
struct nand_chip *chip = mtd->priv;
unsigned int dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0;
u32 val;
/* clear ecc and enable bits */
val = ECCCLEAR | ECC1;
writel(val, info->reg.gpmc_ecc_control);
/* program ecc and result sizes */
val = ((((info->nand.ecc.size >> 1) - 1) << ECCSIZE1_SHIFT) |
ECC1RESULTSIZE);
writel(val, info->reg.<API key>);
switch (mode) {
case NAND_ECC_READ:
case NAND_ECC_WRITE:
writel(ECCCLEAR | ECC1, info->reg.gpmc_ecc_control);
break;
case NAND_ECC_READSYN:
writel(ECCCLEAR, info->reg.gpmc_ecc_control);
break;
default:
dev_info(&info->pdev->dev,
"error: unrecognized Mode[%d]!\n", mode);
break;
}
/* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */
val = (dev_width << 7) | (info->gpmc_cs << 1) | (0x1);
writel(val, info->reg.gpmc_ecc_config);
}
/**
* omap_wait - wait until the command is done
* @mtd: MTD device structure
* @chip: NAND Chip structure
*
* Wait function is called during Program and erase operations and
* the way it is called from MTD layer, we should wait till the NAND
* chip is ready after the programming/erase operation has completed.
*
* Erase can take up to 400ms and program up to 20ms according to
* general NAND and SmartMedia specs
*/
static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip)
{
struct nand_chip *this = mtd->priv;
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
unsigned long timeo = jiffies;
int status, state = this->state;
if (state == FL_ERASING)
timeo += msecs_to_jiffies(400);
else
timeo += msecs_to_jiffies(20);
writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command);
while (time_before(jiffies, timeo)) {
status = readb(info->reg.gpmc_nand_data);
if (status & NAND_STATUS_READY)
break;
cond_resched();
}
status = readb(info->reg.gpmc_nand_data);
return status;
}
/**
* omap_dev_ready - calls the platform specific dev_ready function
* @mtd: MTD device structure
*/
static int omap_dev_ready(struct mtd_info *mtd)
{
unsigned int val = 0;
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
val = readl(info->reg.gpmc_status);
if ((val & 0x100) == 0x100) {
return 1;
} else {
return 0;
}
}
/**
* <API key> - Program GPMC to perform BCH ECC calculation
* @mtd: MTD device structure
* @mode: Read/Write mode
*
* When using BCH with SW correction (i.e. no ELM), sector size is set
* to 512 bytes and we use BCH_WRAPMODE_6 wrapping mode
* for both reading and writing with:
* eccsize0 = 0 (no additional protected byte in spare area)
* eccsize1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
*/
static void __maybe_unused <API key>(struct mtd_info *mtd, int mode)
{
unsigned int bch_type;
unsigned int dev_width, nsectors;
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
enum omap_ecc ecc_opt = info->ecc_opt;
struct nand_chip *chip = mtd->priv;
u32 val, wr_mode;
unsigned int ecc_size1, ecc_size0;
/* GPMC configurations for calculating ECC */
switch (ecc_opt) {
case <API key>:
bch_type = 0;
nsectors = 1;
wr_mode = BCH_WRAPMODE_6;
ecc_size0 = BCH_ECC_SIZE0;
ecc_size1 = BCH_ECC_SIZE1;
break;
case <API key>:
bch_type = 0;
nsectors = chip->ecc.steps;
if (mode == NAND_ECC_READ) {
wr_mode = BCH_WRAPMODE_1;
ecc_size0 = BCH4R_ECC_SIZE0;
ecc_size1 = BCH4R_ECC_SIZE1;
} else {
wr_mode = BCH_WRAPMODE_6;
ecc_size0 = BCH_ECC_SIZE0;
ecc_size1 = BCH_ECC_SIZE1;
}
break;
case <API key>:
bch_type = 1;
nsectors = 1;
wr_mode = BCH_WRAPMODE_6;
ecc_size0 = BCH_ECC_SIZE0;
ecc_size1 = BCH_ECC_SIZE1;
break;
case <API key>:
bch_type = 1;
nsectors = chip->ecc.steps;
if (mode == NAND_ECC_READ) {
wr_mode = BCH_WRAPMODE_1;
ecc_size0 = BCH8R_ECC_SIZE0;
ecc_size1 = BCH8R_ECC_SIZE1;
} else {
wr_mode = BCH_WRAPMODE_6;
ecc_size0 = BCH_ECC_SIZE0;
ecc_size1 = BCH_ECC_SIZE1;
}
break;
case <API key>:
bch_type = 0x2;
nsectors = chip->ecc.steps;
if (mode == NAND_ECC_READ) {
wr_mode = 0x01;
ecc_size0 = 52; /* ECC bits in nibbles per sector */
ecc_size1 = 0; /* non-ECC bits in nibbles per sector */
} else {
wr_mode = 0x01;
ecc_size0 = 0; /* extra bits in nibbles per sector */
ecc_size1 = 52; /* OOB bits in nibbles per sector */
}
break;
default:
return;
}
writel(ECC1, info->reg.gpmc_ecc_control);
/* Configure ecc size for BCH */
val = (ecc_size1 << ECCSIZE1_SHIFT) | (ecc_size0 << ECCSIZE0_SHIFT);
writel(val, info->reg.<API key>);
dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0;
/* BCH configuration */
val = ((1 << 16) | /* enable BCH */
(bch_type << 12) | /* BCH4/BCH8/BCH16 */
(wr_mode << 8) | /* wrap mode */
(dev_width << 7) | /* bus width */
(((nsectors-1) & 0x7) << 4) | /* number of sectors */
(info->gpmc_cs << 1) | /* ECC CS */
(0x1)); /* enable ECC */
writel(val, info->reg.gpmc_ecc_config);
/* Clear ecc and enable bits */
writel(ECCCLEAR | ECC1, info->reg.gpmc_ecc_control);
}
static u8 bch4_polynomial[] = {0x28, 0x13, 0xcc, 0x39, 0x96, 0xac, 0x7f};
static u8 bch8_polynomial[] = {0xef, 0x51, 0x2e, 0x09, 0xed, 0x93, 0x9a, 0xc2,
0x97, 0x79, 0xe5, 0x24, 0xb5};
/**
* <API key> - Generate bytes of ECC bytes
* @mtd: MTD device structure
* @dat: The pointer to data on which ecc is computed
* @ecc_code: The ecc_code buffer
*
* Support calculating of BCH4/8 ecc vectors for the page
*/
static int __maybe_unused <API key>(struct mtd_info *mtd,
const u_char *dat, u_char *ecc_calc)
{
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
int eccbytes = info->nand.ecc.bytes;
struct gpmc_nand_regs *gpmc_regs = &info->reg;
u8 *ecc_code;
unsigned long nsectors, bch_val1, bch_val2, bch_val3, bch_val4;
u32 val;
int i, j;
nsectors = ((readl(info->reg.gpmc_ecc_config) >> 4) & 0x7) + 1;
for (i = 0; i < nsectors; i++) {
ecc_code = ecc_calc;
switch (info->ecc_opt) {
case <API key>:
case <API key>:
bch_val1 = readl(gpmc_regs->gpmc_bch_result0[i]);
bch_val2 = readl(gpmc_regs->gpmc_bch_result1[i]);
bch_val3 = readl(gpmc_regs->gpmc_bch_result2[i]);
bch_val4 = readl(gpmc_regs->gpmc_bch_result3[i]);
*ecc_code++ = (bch_val4 & 0xFF);
*ecc_code++ = ((bch_val3 >> 24) & 0xFF);
*ecc_code++ = ((bch_val3 >> 16) & 0xFF);
*ecc_code++ = ((bch_val3 >> 8) & 0xFF);
*ecc_code++ = (bch_val3 & 0xFF);
*ecc_code++ = ((bch_val2 >> 24) & 0xFF);
*ecc_code++ = ((bch_val2 >> 16) & 0xFF);
*ecc_code++ = ((bch_val2 >> 8) & 0xFF);
*ecc_code++ = (bch_val2 & 0xFF);
*ecc_code++ = ((bch_val1 >> 24) & 0xFF);
*ecc_code++ = ((bch_val1 >> 16) & 0xFF);
*ecc_code++ = ((bch_val1 >> 8) & 0xFF);
*ecc_code++ = (bch_val1 & 0xFF);
break;
case <API key>:
case <API key>:
bch_val1 = readl(gpmc_regs->gpmc_bch_result0[i]);
bch_val2 = readl(gpmc_regs->gpmc_bch_result1[i]);
*ecc_code++ = ((bch_val2 >> 12) & 0xFF);
*ecc_code++ = ((bch_val2 >> 4) & 0xFF);
*ecc_code++ = ((bch_val2 & 0xF) << 4) |
((bch_val1 >> 28) & 0xF);
*ecc_code++ = ((bch_val1 >> 20) & 0xFF);
*ecc_code++ = ((bch_val1 >> 12) & 0xFF);
*ecc_code++ = ((bch_val1 >> 4) & 0xFF);
*ecc_code++ = ((bch_val1 & 0xF) << 4);
break;
case <API key>:
val = readl(gpmc_regs->gpmc_bch_result6[i]);
ecc_code[0] = ((val >> 8) & 0xFF);
ecc_code[1] = ((val >> 0) & 0xFF);
val = readl(gpmc_regs->gpmc_bch_result5[i]);
ecc_code[2] = ((val >> 24) & 0xFF);
ecc_code[3] = ((val >> 16) & 0xFF);
ecc_code[4] = ((val >> 8) & 0xFF);
ecc_code[5] = ((val >> 0) & 0xFF);
val = readl(gpmc_regs->gpmc_bch_result4[i]);
ecc_code[6] = ((val >> 24) & 0xFF);
ecc_code[7] = ((val >> 16) & 0xFF);
ecc_code[8] = ((val >> 8) & 0xFF);
ecc_code[9] = ((val >> 0) & 0xFF);
val = readl(gpmc_regs->gpmc_bch_result3[i]);
ecc_code[10] = ((val >> 24) & 0xFF);
ecc_code[11] = ((val >> 16) & 0xFF);
ecc_code[12] = ((val >> 8) & 0xFF);
ecc_code[13] = ((val >> 0) & 0xFF);
val = readl(gpmc_regs->gpmc_bch_result2[i]);
ecc_code[14] = ((val >> 24) & 0xFF);
ecc_code[15] = ((val >> 16) & 0xFF);
ecc_code[16] = ((val >> 8) & 0xFF);
ecc_code[17] = ((val >> 0) & 0xFF);
val = readl(gpmc_regs->gpmc_bch_result1[i]);
ecc_code[18] = ((val >> 24) & 0xFF);
ecc_code[19] = ((val >> 16) & 0xFF);
ecc_code[20] = ((val >> 8) & 0xFF);
ecc_code[21] = ((val >> 0) & 0xFF);
val = readl(gpmc_regs->gpmc_bch_result0[i]);
ecc_code[22] = ((val >> 24) & 0xFF);
ecc_code[23] = ((val >> 16) & 0xFF);
ecc_code[24] = ((val >> 8) & 0xFF);
ecc_code[25] = ((val >> 0) & 0xFF);
break;
default:
return -EINVAL;
}
/* ECC scheme specific syndrome customizations */
switch (info->ecc_opt) {
case <API key>:
/* Add constant polynomial to remainder, so that
* ECC of blank pages results in 0x0 on reading back */
for (j = 0; j < eccbytes; j++)
ecc_calc[j] ^= bch4_polynomial[j];
break;
case <API key>:
/* Set 8th ECC byte as 0x0 for ROM compatibility */
ecc_calc[eccbytes - 1] = 0x0;
break;
case <API key>:
/* Add constant polynomial to remainder, so that
* ECC of blank pages results in 0x0 on reading back */
for (j = 0; j < eccbytes; j++)
ecc_calc[j] ^= bch8_polynomial[j];
break;
case <API key>:
/* Set 14th ECC byte as 0x0 for ROM compatibility */
ecc_calc[eccbytes - 1] = 0x0;
break;
case <API key>:
break;
default:
return -EINVAL;
}
ecc_calc += eccbytes;
}
return 0;
}
/**
* <API key> - count bit flips
* @data: data sector buffer
* @oob: oob buffer
* @info: omap_nand_info
*
* Check the bit flips in erased page falls below correctable level.
* If falls below, report the page as erased with correctable bit
* flip, else report as uncorrectable page.
*/
static int <API key>(u_char *data, u_char *oob,
struct omap_nand_info *info)
{
int flip_bits = 0, i;
for (i = 0; i < info->nand.ecc.size; i++) {
flip_bits += hweight8(~data[i]);
if (flip_bits > info->nand.ecc.strength)
return 0;
}
for (i = 0; i < info->nand.ecc.bytes - 1; i++) {
flip_bits += hweight8(~oob[i]);
if (flip_bits > info->nand.ecc.strength)
return 0;
}
/*
* Bit flips falls in correctable level.
* Fill data area with 0xFF
*/
if (flip_bits) {
memset(data, 0xFF, info->nand.ecc.size);
memset(oob, 0xFF, info->nand.ecc.bytes);
}
return flip_bits;
}
/**
* <API key> - corrects page data area in case error reported
* @mtd: MTD device structure
* @data: page data
* @read_ecc: ecc read from nand flash
* @calc_ecc: ecc read from HW ECC registers
*
* Calculated ecc vector reported as zero in case of non-error pages.
* In case of non-zero ecc vector, first filter out erased-pages, and
* then process data via ELM to detect bit-flips.
*/
static int <API key>(struct mtd_info *mtd, u_char *data,
u_char *read_ecc, u_char *calc_ecc)
{
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
struct nand_ecc_ctrl *ecc = &info->nand.ecc;
int eccsteps = info->nand.ecc.steps;
int i , j, stat = 0;
int eccflag, actual_eccbytes;
struct elm_errorvec err_vec[ERROR_VECTOR_MAX];
u_char *ecc_vec = calc_ecc;
u_char *spare_ecc = read_ecc;
u_char *erased_ecc_vec;
u_char *buf;
int bitflip_count;
bool is_error_reported = false;
u32 bit_pos, byte_pos, error_max, pos;
int err;
switch (info->ecc_opt) {
case <API key>:
/* omit 7th ECC byte reserved for ROM code compatibility */
actual_eccbytes = ecc->bytes - 1;
erased_ecc_vec = bch4_vector;
break;
case <API key>:
/* omit 14th ECC byte reserved for ROM code compatibility */
actual_eccbytes = ecc->bytes - 1;
erased_ecc_vec = bch8_vector;
break;
case <API key>:
actual_eccbytes = ecc->bytes;
erased_ecc_vec = bch16_vector;
break;
default:
dev_err(&info->pdev->dev, "invalid driver configuration\n");
return -EINVAL;
}
/* Initialize elm error vector to zero */
memset(err_vec, 0, sizeof(err_vec));
for (i = 0; i < eccsteps ; i++) {
eccflag = 0; /* initialize eccflag */
/*
* Check any error reported,
* In case of error, non zero ecc reported.
*/
for (j = 0; j < actual_eccbytes; j++) {
if (calc_ecc[j] != 0) {
eccflag = 1; /* non zero ecc, error present */
break;
}
}
if (eccflag == 1) {
if (memcmp(calc_ecc, erased_ecc_vec,
actual_eccbytes) == 0) {
/*
* calc_ecc[] matches pattern for ECC(all 0xff)
* so this is definitely an erased-page
*/
} else {
buf = &data[info->nand.ecc.size * i];
/*
* count number of 0-bits in read_buf.
* This check can be removed once a similar
* check is introduced in generic NAND driver
*/
bitflip_count = <API key>(
buf, read_ecc, info);
if (bitflip_count) {
/*
* number of 0-bits within ECC limits
* So this may be an erased-page
*/
stat += bitflip_count;
} else {
/*
* Too many 0-bits. It may be a
* - programmed-page, OR
* - erased-page with many bit-flips
* So this page requires check by ELM
*/
err_vec[i].error_reported = true;
is_error_reported = true;
}
}
}
/* Update the ecc vector */
calc_ecc += ecc->bytes;
read_ecc += ecc->bytes;
}
/* Check if any error reported */
if (!is_error_reported)
return stat;
/* Decode BCH error using ELM module */
<API key>(info->elm_dev, ecc_vec, err_vec);
err = 0;
for (i = 0; i < eccsteps; i++) {
if (err_vec[i].error_uncorrectable) {
dev_err(&info->pdev->dev,
"uncorrectable bit-flips found\n");
err = -EBADMSG;
} else if (err_vec[i].error_reported) {
for (j = 0; j < err_vec[i].error_count; j++) {
switch (info->ecc_opt) {
case <API key>:
/* Add 4 bits to take care of padding */
pos = err_vec[i].error_loc[j] +
BCH4_BIT_PAD;
break;
case <API key>:
case <API key>:
pos = err_vec[i].error_loc[j];
break;
default:
return -EINVAL;
}
error_max = (ecc->size + actual_eccbytes) * 8;
/* Calculate bit position of error */
bit_pos = pos % 8;
/* Calculate byte position of error */
byte_pos = (error_max - pos - 1) / 8;
if (pos < error_max) {
if (byte_pos < 512) {
pr_debug("bitflip@dat[%d]=%x\n",
byte_pos, data[byte_pos]);
data[byte_pos] ^= 1 << bit_pos;
} else {
pr_debug("bitflip@oob[%d]=%x\n",
(byte_pos - 512),
spare_ecc[byte_pos - 512]);
spare_ecc[byte_pos - 512] ^=
1 << bit_pos;
}
} else {
dev_err(&info->pdev->dev,
"invalid bit-flip @ %d:%d\n",
byte_pos, bit_pos);
err = -EBADMSG;
}
}
}
/* Update number of correctable errors */
stat += err_vec[i].error_count;
/* Update page data with sector size */
data += ecc->size;
spare_ecc += ecc->bytes;
}
return (err) ? err : stat;
}
/**
* omap_write_page_bch - BCH ecc based write page function for entire page
* @mtd: mtd info structure
* @chip: nand chip info structure
* @buf: data buffer
* @oob_required: must write chip->oob_poi to OOB
* @page: page
*
* Custom write page method evolved to support multi sector writing in one shot
*/
static int omap_write_page_bch(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int oob_required, int page)
{
int i;
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint32_t *eccpos = chip->ecc.layout->eccpos;
/* Enable GPMC ecc engine */
chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
/* Write data */
chip->write_buf(mtd, buf, mtd->writesize);
/* Update ecc vector from GPMC result registers */
chip->ecc.calculate(mtd, buf, &ecc_calc[0]);
for (i = 0; i < chip->ecc.total; i++)
chip->oob_poi[eccpos[i]] = ecc_calc[i];
/* Write ecc vector to OOB area */
chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
return 0;
}
/**
* omap_read_page_bch - BCH ecc based page read function for entire page
* @mtd: mtd info structure
* @chip: nand chip info structure
* @buf: buffer to store read data
* @oob_required: caller requires OOB data read to chip->oob_poi
* @page: page number to read
*
* For BCH ecc scheme, GPMC used for syndrome calculation and ELM module
* used for error correction.
* Custom method evolved to support ELM error correction & multi sector
* reading. On reading page data area is read along with OOB data with
* ecc engine enabled. ecc vector updated after read of OOB data.
* For non error pages ecc vector reported as zero.
*/
static int omap_read_page_bch(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint8_t *ecc_code = chip->buffers->ecccode;
uint32_t *eccpos = chip->ecc.layout->eccpos;
uint8_t *oob = &chip->oob_poi[eccpos[0]];
uint32_t oob_pos = mtd->writesize + chip->ecc.layout->eccpos[0];
int stat;
unsigned int max_bitflips = 0;
/* Enable GPMC ecc engine */
chip->ecc.hwctl(mtd, NAND_ECC_READ);
/* Read data */
chip->read_buf(mtd, buf, mtd->writesize);
/* Read oob bytes */
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_pos, -1);
chip->read_buf(mtd, oob, chip->ecc.total);
/* Calculate ecc bytes */
chip->ecc.calculate(mtd, buf, ecc_calc);
memcpy(ecc_code, &chip->oob_poi[eccpos[0]], chip->ecc.total);
stat = chip->ecc.correct(mtd, buf, ecc_code, ecc_calc);
if (stat < 0) {
mtd->ecc_stats.failed++;
} else {
mtd->ecc_stats.corrected += stat;
max_bitflips = max_t(unsigned int, max_bitflips, stat);
}
return max_bitflips;
}
/**
* is_elm_present - checks for presence of ELM module by scanning DT nodes
* @omap_nand_info: NAND device structure containing platform data
*/
static bool is_elm_present(struct omap_nand_info *info,
struct device_node *elm_node)
{
struct platform_device *pdev;
/* check whether elm-id is passed via DT */
if (!elm_node) {
dev_err(&info->pdev->dev, "ELM devicetree node not found\n");
return false;
}
pdev = <API key>(elm_node);
/* check whether ELM device is registered */
if (!pdev) {
dev_err(&info->pdev->dev, "ELM device not found\n");
return false;
}
/* ELM module available, now configure it */
info->elm_dev = &pdev->dev;
return true;
}
static bool <API key>(struct omap_nand_info *info,
struct <API key> *pdata)
{
bool ecc_needs_bch, ecc_needs_omap_bch, ecc_needs_elm;
switch (info->ecc_opt) {
case <API key>:
case <API key>:
ecc_needs_omap_bch = false;
ecc_needs_bch = true;
ecc_needs_elm = false;
break;
case <API key>:
case <API key>:
case <API key>:
ecc_needs_omap_bch = true;
ecc_needs_bch = false;
ecc_needs_elm = true;
break;
default:
ecc_needs_omap_bch = false;
ecc_needs_bch = false;
ecc_needs_elm = false;
break;
}
if (ecc_needs_bch && !IS_ENABLED(<API key>)) {
dev_err(&info->pdev->dev,
"<API key> not enabled\n");
return false;
}
if (ecc_needs_omap_bch && !IS_ENABLED(<API key>)) {
dev_err(&info->pdev->dev,
"<API key> not enabled\n");
return false;
}
if (ecc_needs_elm && !is_elm_present(info, pdata->elm_of_node)) {
dev_err(&info->pdev->dev, "ELM not available\n");
return false;
}
return true;
}
static int omap_nand_probe(struct platform_device *pdev)
{
struct omap_nand_info *info;
struct <API key> *pdata;
struct mtd_info *mtd;
struct nand_chip *nand_chip;
struct nand_ecclayout *ecclayout;
int err;
int i;
dma_cap_mask_t mask;
unsigned sig;
unsigned oob_index;
struct resource *res;
struct <API key> ppdata = {};
pdata = dev_get_platdata(&pdev->dev);
if (pdata == NULL) {
dev_err(&pdev->dev, "platform data missing\n");
return -ENODEV;
}
info = devm_kzalloc(&pdev->dev, sizeof(struct omap_nand_info),
GFP_KERNEL);
if (!info)
return -ENOMEM;
<API key>(pdev, info);
info->pdev = pdev;
info->gpmc_cs = pdata->cs;
info->reg = pdata->reg;
info->of_node = pdata->of_node;
info->ecc_opt = pdata->ecc_opt;
mtd = &info->mtd;
mtd->priv = &info->nand;
mtd->dev.parent = &pdev->dev;
nand_chip = &info->nand;
nand_chip->ecc.priv = NULL;
res = <API key>(pdev, IORESOURCE_MEM, 0);
nand_chip->IO_ADDR_R = <API key>(&pdev->dev, res);
if (IS_ERR(nand_chip->IO_ADDR_R))
return PTR_ERR(nand_chip->IO_ADDR_R);
info->phys_base = res->start;
nand_chip->controller = &<API key>;
nand_chip->IO_ADDR_W = nand_chip->IO_ADDR_R;
nand_chip->cmd_ctrl = omap_hwcontrol;
/*
* If RDY/BSY line is connected to OMAP then use the omap ready
* function and the generic nand_wait function which reads the status
* register after monitoring the RDY/BSY line. Otherwise use a standard
* chip delay which is slightly more than tR (AC Timing) of the NAND
* device and read status register until you get a failure or success
*/
if (pdata->dev_ready) {
nand_chip->dev_ready = omap_dev_ready;
nand_chip->chip_delay = 0;
} else {
nand_chip->waitfunc = omap_wait;
nand_chip->chip_delay = 50;
}
if (pdata->flash_bbt)
nand_chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
else
nand_chip->options |= NAND_SKIP_BBTSCAN;
/* scan NAND device connected to chip controller */
nand_chip->options |= pdata->devsize & NAND_BUSWIDTH_16;
if (nand_scan_ident(mtd, 1, NULL)) {
dev_err(&info->pdev->dev, "scan failed, may be bus-width mismatch\n");
err = -ENXIO;
goto return_error;
}
/* re-populate low-level callbacks based on xfer modes */
switch (pdata->xfer_type) {
case <API key>:
nand_chip->read_buf = omap_read_buf_pref;
nand_chip->write_buf = omap_write_buf_pref;
break;
case NAND_OMAP_POLLED:
/* Use nand_base defaults for {read,write}_buf */
break;
case <API key>:
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
sig = OMAP24XX_DMA_GPMC;
info->dma = dma_request_channel(mask, omap_dma_filter_fn, &sig);
if (!info->dma) {
dev_err(&pdev->dev, "DMA engine request failed\n");
err = -ENXIO;
goto return_error;
} else {
struct dma_slave_config cfg;
memset(&cfg, 0, sizeof(cfg));
cfg.src_addr = info->phys_base;
cfg.dst_addr = info->phys_base;
cfg.src_addr_width = <API key>;
cfg.dst_addr_width = <API key>;
cfg.src_maxburst = 16;
cfg.dst_maxburst = 16;
err = <API key>(info->dma, &cfg);
if (err) {
dev_err(&pdev->dev, "DMA engine slave config failed: %d\n",
err);
goto return_error;
}
nand_chip->read_buf = <API key>;
nand_chip->write_buf = <API key>;
}
break;
case <API key>:
info->gpmc_irq_fifo = platform_get_irq(pdev, 0);
if (info->gpmc_irq_fifo <= 0) {
dev_err(&pdev->dev, "error getting fifo irq\n");
err = -ENODEV;
goto return_error;
}
err = devm_request_irq(&pdev->dev, info->gpmc_irq_fifo,
omap_nand_irq, IRQF_SHARED,
"gpmc-nand-fifo", info);
if (err) {
dev_err(&pdev->dev, "requesting irq(%d) error:%d",
info->gpmc_irq_fifo, err);
info->gpmc_irq_fifo = 0;
goto return_error;
}
info->gpmc_irq_count = platform_get_irq(pdev, 1);
if (info->gpmc_irq_count <= 0) {
dev_err(&pdev->dev, "error getting count irq\n");
err = -ENODEV;
goto return_error;
}
err = devm_request_irq(&pdev->dev, info->gpmc_irq_count,
omap_nand_irq, IRQF_SHARED,
"gpmc-nand-count", info);
if (err) {
dev_err(&pdev->dev, "requesting irq(%d) error:%d",
info->gpmc_irq_count, err);
info->gpmc_irq_count = 0;
goto return_error;
}
nand_chip->read_buf = <API key>;
nand_chip->write_buf = <API key>;
break;
default:
dev_err(&pdev->dev,
"xfer_type(%d) not supported!\n", pdata->xfer_type);
err = -EINVAL;
goto return_error;
}
if (!<API key>(info, pdata)) {
err = -EINVAL;
goto return_error;
}
/* populate MTD interface based on ECC scheme */
ecclayout = &info->oobinfo;
switch (info->ecc_opt) {
case <API key>:
nand_chip->ecc.mode = NAND_ECC_SOFT;
break;
case <API key>:
pr_info("nand: using <API key>\n");
nand_chip->ecc.mode = NAND_ECC_HW;
nand_chip->ecc.bytes = 3;
nand_chip->ecc.size = 512;
nand_chip->ecc.strength = 1;
nand_chip->ecc.calculate = omap_calculate_ecc;
nand_chip->ecc.hwctl = omap_enable_hwecc;
nand_chip->ecc.correct = omap_correct_data;
/* define ECC layout */
ecclayout->eccbytes = nand_chip->ecc.bytes *
(mtd->writesize /
nand_chip->ecc.size);
if (nand_chip->options & NAND_BUSWIDTH_16)
oob_index = <API key>;
else
oob_index = 1;
for (i = 0; i < ecclayout->eccbytes; i++, oob_index++)
ecclayout->eccpos[i] = oob_index;
/* no reserved-marker in ecclayout for this ecc-scheme */
ecclayout->oobfree->offset =
ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;
break;
case <API key>:
pr_info("nand: using <API key>\n");
nand_chip->ecc.mode = NAND_ECC_HW;
nand_chip->ecc.size = 512;
nand_chip->ecc.bytes = 7;
nand_chip->ecc.strength = 4;
nand_chip->ecc.hwctl = <API key>;
nand_chip->ecc.correct = <API key>;
nand_chip->ecc.calculate = <API key>;
/* define ECC layout */
ecclayout->eccbytes = nand_chip->ecc.bytes *
(mtd->writesize /
nand_chip->ecc.size);
oob_index = <API key>;
for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) {
ecclayout->eccpos[i] = oob_index;
if (((i + 1) % nand_chip->ecc.bytes) == 0)
oob_index++;
}
/* include reserved-marker in ecclayout->oobfree calculation */
ecclayout->oobfree->offset = 1 +
ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;
/* software bch library is used for locating errors */
nand_chip->ecc.priv = nand_bch_init(mtd,
nand_chip->ecc.size,
nand_chip->ecc.bytes,
&ecclayout);
if (!nand_chip->ecc.priv) {
dev_err(&info->pdev->dev, "unable to use BCH library\n");
err = -EINVAL;
goto return_error;
}
break;
case <API key>:
pr_info("nand: using <API key> ECC scheme\n");
nand_chip->ecc.mode = NAND_ECC_HW;
nand_chip->ecc.size = 512;
/* 14th bit is kept reserved for ROM-code compatibility */
nand_chip->ecc.bytes = 7 + 1;
nand_chip->ecc.strength = 4;
nand_chip->ecc.hwctl = <API key>;
nand_chip->ecc.correct = <API key>;
nand_chip->ecc.calculate = <API key>;
nand_chip->ecc.read_page = omap_read_page_bch;
nand_chip->ecc.write_page = omap_write_page_bch;
/* define ECC layout */
ecclayout->eccbytes = nand_chip->ecc.bytes *
(mtd->writesize /
nand_chip->ecc.size);
oob_index = <API key>;
for (i = 0; i < ecclayout->eccbytes; i++, oob_index++)
ecclayout->eccpos[i] = oob_index;
/* reserved marker already included in ecclayout->eccbytes */
ecclayout->oobfree->offset =
ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;
err = elm_config(info->elm_dev, BCH4_ECC,
info->mtd.writesize / nand_chip->ecc.size,
nand_chip->ecc.size, nand_chip->ecc.bytes);
if (err < 0)
goto return_error;
break;
case <API key>:
pr_info("nand: using <API key>\n");
nand_chip->ecc.mode = NAND_ECC_HW;
nand_chip->ecc.size = 512;
nand_chip->ecc.bytes = 13;
nand_chip->ecc.strength = 8;
nand_chip->ecc.hwctl = <API key>;
nand_chip->ecc.correct = <API key>;
nand_chip->ecc.calculate = <API key>;
/* define ECC layout */
ecclayout->eccbytes = nand_chip->ecc.bytes *
(mtd->writesize /
nand_chip->ecc.size);
oob_index = <API key>;
for (i = 0; i < ecclayout->eccbytes; i++, oob_index++) {
ecclayout->eccpos[i] = oob_index;
if (((i + 1) % nand_chip->ecc.bytes) == 0)
oob_index++;
}
/* include reserved-marker in ecclayout->oobfree calculation */
ecclayout->oobfree->offset = 1 +
ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;
/* software bch library is used for locating errors */
nand_chip->ecc.priv = nand_bch_init(mtd,
nand_chip->ecc.size,
nand_chip->ecc.bytes,
&ecclayout);
if (!nand_chip->ecc.priv) {
dev_err(&info->pdev->dev, "unable to use BCH library\n");
err = -EINVAL;
goto return_error;
}
break;
case <API key>:
pr_info("nand: using <API key> ECC scheme\n");
nand_chip->ecc.mode = NAND_ECC_HW;
nand_chip->ecc.size = 512;
/* 14th bit is kept reserved for ROM-code compatibility */
nand_chip->ecc.bytes = 13 + 1;
nand_chip->ecc.strength = 8;
nand_chip->ecc.hwctl = <API key>;
nand_chip->ecc.correct = <API key>;
nand_chip->ecc.calculate = <API key>;
nand_chip->ecc.read_page = omap_read_page_bch;
nand_chip->ecc.write_page = omap_write_page_bch;
err = elm_config(info->elm_dev, BCH8_ECC,
info->mtd.writesize / nand_chip->ecc.size,
nand_chip->ecc.size, nand_chip->ecc.bytes);
if (err < 0)
goto return_error;
/* define ECC layout */
ecclayout->eccbytes = nand_chip->ecc.bytes *
(mtd->writesize /
nand_chip->ecc.size);
oob_index = <API key>;
for (i = 0; i < ecclayout->eccbytes; i++, oob_index++)
ecclayout->eccpos[i] = oob_index;
/* reserved marker already included in ecclayout->eccbytes */
ecclayout->oobfree->offset =
ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;
break;
case <API key>:
pr_info("using <API key> ECC scheme\n");
nand_chip->ecc.mode = NAND_ECC_HW;
nand_chip->ecc.size = 512;
nand_chip->ecc.bytes = 26;
nand_chip->ecc.strength = 16;
nand_chip->ecc.hwctl = <API key>;
nand_chip->ecc.correct = <API key>;
nand_chip->ecc.calculate = <API key>;
nand_chip->ecc.read_page = omap_read_page_bch;
nand_chip->ecc.write_page = omap_write_page_bch;
err = elm_config(info->elm_dev, BCH16_ECC,
info->mtd.writesize / nand_chip->ecc.size,
nand_chip->ecc.size, nand_chip->ecc.bytes);
if (err < 0)
goto return_error;
/* define ECC layout */
ecclayout->eccbytes = nand_chip->ecc.bytes *
(mtd->writesize /
nand_chip->ecc.size);
oob_index = <API key>;
for (i = 0; i < ecclayout->eccbytes; i++, oob_index++)
ecclayout->eccpos[i] = oob_index;
/* reserved marker already included in ecclayout->eccbytes */
ecclayout->oobfree->offset =
ecclayout->eccpos[ecclayout->eccbytes - 1] + 1;
break;
default:
dev_err(&info->pdev->dev, "invalid or unsupported ECC scheme\n");
err = -EINVAL;
goto return_error;
}
if (info->ecc_opt == <API key>)
goto scan_tail;
/* all OOB bytes from oobfree->offset till end off OOB are free */
ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset;
/* check if NAND device's OOB is enough to store ECC signatures */
if (mtd->oobsize < (ecclayout->eccbytes + <API key>)) {
dev_err(&info->pdev->dev,
"not enough OOB bytes required = %d, available=%d\n",
ecclayout->eccbytes, mtd->oobsize);
err = -EINVAL;
goto return_error;
}
nand_chip->ecc.layout = ecclayout;
scan_tail:
/* second phase scan */
if (nand_scan_tail(mtd)) {
err = -ENXIO;
goto return_error;
}
ppdata.of_node = pdata->of_node;
<API key>(mtd, NULL, &ppdata, pdata->parts,
pdata->nr_parts);
<API key>(pdev, mtd);
return 0;
return_error:
if (info->dma)
dma_release_channel(info->dma);
if (nand_chip->ecc.priv) {
nand_bch_free(nand_chip->ecc.priv);
nand_chip->ecc.priv = NULL;
}
return err;
}
static int omap_nand_remove(struct platform_device *pdev)
{
struct mtd_info *mtd = <API key>(pdev);
struct nand_chip *nand_chip = mtd->priv;
struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
mtd);
if (nand_chip->ecc.priv) {
nand_bch_free(nand_chip->ecc.priv);
nand_chip->ecc.priv = NULL;
}
if (info->dma)
dma_release_channel(info->dma);
nand_release(mtd);
return 0;
}
static struct platform_driver omap_nand_driver = {
.probe = omap_nand_probe,
.remove = omap_nand_remove,
.driver = {
.name = DRIVER_NAME,
},
};
<API key>(omap_nand_driver);
MODULE_ALIAS("platform:" DRIVER_NAME);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Glue layer for NAND flash on TI OMAP boards"); |
#include "sysdef.h"
#include "wb35reg_f.h"
#include <linux/usb.h>
extern void <API key>(hw_data_t *phw_data, u32 frequency);
// true : read command process successfully
// false : register not support
// RegisterNo : start base
// pRegisterData : data point
// NumberOfData : number of register data
// Flag : AUTO_INCREMENT - RegisterNo will auto increment 4
// NO_INCREMENT - Function will write data into the same register
unsigned char
Wb35Reg_BurstWrite(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterData, u8 NumberOfData, u8 Flag)
{
struct wb35_reg *reg = &pHwData->reg;
struct urb *urb = NULL;
struct wb35_reg_queue *reg_queue = NULL;
u16 UrbSize;
struct usb_ctrlrequest *dr;
u16 i, DataSize = NumberOfData*4;
// Module shutdown
if (pHwData->SurpriseRemove)
return false;
// Trying to use burst write function if use new hardware
UrbSize = sizeof(struct wb35_reg_queue) + DataSize + sizeof(struct usb_ctrlrequest);
reg_queue = kzalloc(UrbSize, GFP_ATOMIC);
urb = usb_alloc_urb(0, GFP_ATOMIC);
if( urb && reg_queue ) {
reg_queue->DIRECT = 2;// burst write register
reg_queue->INDEX = RegisterNo;
reg_queue->pBuffer = (u32 *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
memcpy( reg_queue->pBuffer, pRegisterData, DataSize );
//the function for reversing register data from little endian to big endian
for( i=0; i<NumberOfData ; i++ )
reg_queue->pBuffer[i] = cpu_to_le32( reg_queue->pBuffer[i] );
dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue) + DataSize);
dr->bRequestType = USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE;
dr->bRequest = 0x04; // USB or vendor-defined request code, burst mode
dr->wValue = cpu_to_le16( Flag ); // 0: Register number auto-increment, 1: No auto increment
dr->wIndex = cpu_to_le16( RegisterNo );
dr->wLength = cpu_to_le16( DataSize );
reg_queue->Next = NULL;
reg_queue->pUsbReq = dr;
reg_queue->urb = urb;
spin_lock_irq( ®->EP0VM_spin_lock );
if (reg->reg_first == NULL)
reg->reg_first = reg_queue;
else
reg->reg_last->Next = reg_queue;
reg->reg_last = reg_queue;
spin_unlock_irq( ®->EP0VM_spin_lock );
// Start EP0VM
Wb35Reg_EP0VM_start(pHwData);
return true;
} else {
if (urb)
usb_free_urb(urb);
if (reg_queue)
kfree(reg_queue);
return false;
}
return false;
}
void
Wb35Reg_Update(phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue)
{
struct wb35_reg *reg = &pHwData->reg;
switch (RegisterNo) {
case 0x3b0: reg->U1B0 = RegisterValue; break;
case 0x3bc: reg->U1BC_LEDConfigure = RegisterValue; break;
case 0x400: reg->D00_DmaControl = RegisterValue; break;
case 0x800: reg->M00_MacControl = RegisterValue; break;
case 0x804: reg-><API key> = RegisterValue; break;
case 0x808: reg-><API key> = RegisterValue; break;
case 0x824: reg->M24_MacControl = RegisterValue; break;
case 0x828: reg->M28_MacControl = RegisterValue; break;
case 0x82c: reg->M2C_MacControl = RegisterValue; break;
case 0x838: reg->M38_MacControl = RegisterValue; break;
case 0x840: reg->M40_MacControl = RegisterValue; break;
case 0x844: reg->M44_MacControl = RegisterValue; break;
case 0x848: reg->M48_MacControl = RegisterValue; break;
case 0x84c: reg->M4C_MacStatus = RegisterValue; break;
case 0x860: reg->M60_MacControl = RegisterValue; break;
case 0x868: reg->M68_MacControl = RegisterValue; break;
case 0x870: reg->M70_MacControl = RegisterValue; break;
case 0x874: reg->M74_MacControl = RegisterValue; break;
case 0x878: reg->M78_ERPInformation = RegisterValue; break;
case 0x87C: reg->M7C_MacControl = RegisterValue; break;
case 0x880: reg->M80_MacControl = RegisterValue; break;
case 0x884: reg->M84_MacControl = RegisterValue; break;
case 0x888: reg->M88_MacControl = RegisterValue; break;
case 0x898: reg->M98_MacControl = RegisterValue; break;
case 0x100c: reg->BB0C = RegisterValue; break;
case 0x102c: reg->BB2C = RegisterValue; break;
case 0x1030: reg->BB30 = RegisterValue; break;
case 0x103c: reg->BB3C = RegisterValue; break;
case 0x1048: reg->BB48 = RegisterValue; break;
case 0x104c: reg->BB4C = RegisterValue; break;
case 0x1050: reg->BB50 = RegisterValue; break;
case 0x1054: reg->BB54 = RegisterValue; break;
case 0x1058: reg->BB58 = RegisterValue; break;
case 0x105c: reg->BB5C = RegisterValue; break;
case 0x1060: reg->BB60 = RegisterValue; break;
}
}
// true : read command process successfully
// false : register not support
unsigned char
Wb35Reg_WriteSync( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
{
struct wb35_reg *reg = &pHwData->reg;
int ret = -1;
// Module shutdown
if (pHwData->SurpriseRemove)
return false;
RegisterValue = cpu_to_le32(RegisterValue);
reg->SyncIoPause = 1;
// 20060717.5 Wait until EP0VM stop
while (reg->EP0vm_state != VM_STOP)
msleep(10);
// Sync IoCallDriver
reg->EP0vm_state = VM_RUNNING;
ret = usb_control_msg( pHwData->WbUsb.udev,
usb_sndctrlpipe( pHwData->WbUsb.udev, 0 ),
0x03, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
0x0,RegisterNo, &RegisterValue, 4, HZ*100 );
reg->EP0vm_state = VM_STOP;
reg->SyncIoPause = 0;
Wb35Reg_EP0VM_start(pHwData);
if (ret < 0) {
#ifdef _PE_REG_DUMP_
WBDEBUG(("EP0 Write register usb message sending error\n"));
#endif
pHwData->SurpriseRemove = 1; // 20060704.2
return false;
}
return true;
}
// true : read command process successfully
// false : register not support
unsigned char
Wb35Reg_Write( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue )
{
struct wb35_reg *reg = &pHwData->reg;
struct usb_ctrlrequest *dr;
struct urb *urb = NULL;
struct wb35_reg_queue *reg_queue = NULL;
u16 UrbSize;
// Module shutdown
if (pHwData->SurpriseRemove)
return false;
UrbSize = sizeof(struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
reg_queue = kzalloc(UrbSize, GFP_ATOMIC);
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (urb && reg_queue) {
reg_queue->DIRECT = 1;// burst write register
reg_queue->INDEX = RegisterNo;
reg_queue->VALUE = cpu_to_le32(RegisterValue);
reg_queue->RESERVED_VALID = false;
dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE;
dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode
dr->wValue = cpu_to_le16(0x0);
dr->wIndex = cpu_to_le16(RegisterNo);
dr->wLength = cpu_to_le16(4);
// Enter the sending queue
reg_queue->Next = NULL;
reg_queue->pUsbReq = dr;
reg_queue->urb = urb;
spin_lock_irq(®->EP0VM_spin_lock );
if (reg->reg_first == NULL)
reg->reg_first = reg_queue;
else
reg->reg_last->Next = reg_queue;
reg->reg_last = reg_queue;
spin_unlock_irq( ®->EP0VM_spin_lock );
// Start EP0VM
Wb35Reg_EP0VM_start(pHwData);
return true;
} else {
if (urb)
usb_free_urb(urb);
kfree(reg_queue);
return false;
}
}
//This command will be executed with a user defined value. When it completes,
//this value is useful. For example, <API key> will use it.
// true : read command process successfully
// false : register not support
unsigned char
<API key>( phw_data_t pHwData, u16 RegisterNo, u32 RegisterValue,
s8 *pValue, s8 Len)
{
struct wb35_reg *reg = &pHwData->reg;
struct usb_ctrlrequest *dr;
struct urb *urb = NULL;
struct wb35_reg_queue *reg_queue = NULL;
u16 UrbSize;
// Module shutdown
if (pHwData->SurpriseRemove)
return false;
UrbSize = sizeof(struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
reg_queue = kzalloc(UrbSize, GFP_ATOMIC);
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (urb && reg_queue) {
reg_queue->DIRECT = 1;// burst write register
reg_queue->INDEX = RegisterNo;
reg_queue->VALUE = cpu_to_le32(RegisterValue);
//NOTE : Users must guarantee the size of value will not exceed the buffer size.
memcpy(reg_queue->RESERVED, pValue, Len);
reg_queue->RESERVED_VALID = true;
dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
dr->bRequestType = USB_TYPE_VENDOR|USB_DIR_OUT |USB_RECIP_DEVICE;
dr->bRequest = 0x03; // USB or vendor-defined request code, burst mode
dr->wValue = cpu_to_le16(0x0);
dr->wIndex = cpu_to_le16(RegisterNo);
dr->wLength = cpu_to_le16(4);
// Enter the sending queue
reg_queue->Next = NULL;
reg_queue->pUsbReq = dr;
reg_queue->urb = urb;
spin_lock_irq (®->EP0VM_spin_lock );
if( reg->reg_first == NULL )
reg->reg_first = reg_queue;
else
reg->reg_last->Next = reg_queue;
reg->reg_last = reg_queue;
spin_unlock_irq ( ®->EP0VM_spin_lock );
// Start EP0VM
Wb35Reg_EP0VM_start(pHwData);
return true;
} else {
if (urb)
usb_free_urb(urb);
kfree(reg_queue);
return false;
}
}
// true : read command process successfully
// false : register not support
// pRegisterValue : It must be a resident buffer due to asynchronous read register.
unsigned char
Wb35Reg_ReadSync( phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
{
struct wb35_reg *reg = &pHwData->reg;
u32 * pltmp = pRegisterValue;
int ret = -1;
// Module shutdown
if (pHwData->SurpriseRemove)
return false;
reg->SyncIoPause = 1;
// 20060717.5 Wait until EP0VM stop
while (reg->EP0vm_state != VM_STOP)
msleep(10);
reg->EP0vm_state = VM_RUNNING;
ret = usb_control_msg( pHwData->WbUsb.udev,
usb_rcvctrlpipe(pHwData->WbUsb.udev, 0),
0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
0x0, RegisterNo, pltmp, 4, HZ*100 );
*pRegisterValue = cpu_to_le32(*pltmp);
reg->EP0vm_state = VM_STOP;
Wb35Reg_Update( pHwData, RegisterNo, *pRegisterValue );
reg->SyncIoPause = 0;
Wb35Reg_EP0VM_start( pHwData );
if (ret < 0) {
#ifdef _PE_REG_DUMP_
WBDEBUG(("EP0 Read register usb message sending error\n"));
#endif
pHwData->SurpriseRemove = 1; // 20060704.2
return false;
}
return true;
}
// true : read command process successfully
// false : register not support
// pRegisterValue : It must be a resident buffer due to asynchronous read register.
unsigned char
Wb35Reg_Read(phw_data_t pHwData, u16 RegisterNo, u32 * pRegisterValue )
{
struct wb35_reg *reg = &pHwData->reg;
struct usb_ctrlrequest * dr;
struct urb *urb;
struct wb35_reg_queue *reg_queue;
u16 UrbSize;
// Module shutdown
if (pHwData->SurpriseRemove)
return false;
UrbSize = sizeof(struct wb35_reg_queue) + sizeof(struct usb_ctrlrequest);
reg_queue = kzalloc(UrbSize, GFP_ATOMIC);
urb = usb_alloc_urb(0, GFP_ATOMIC);
if( urb && reg_queue )
{
reg_queue->DIRECT = 0;// read register
reg_queue->INDEX = RegisterNo;
reg_queue->pBuffer = pRegisterValue;
dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
dr->bRequestType = USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN;
dr->bRequest = 0x01; // USB or vendor-defined request code, burst mode
dr->wValue = cpu_to_le16(0x0);
dr->wIndex = cpu_to_le16 (RegisterNo);
dr->wLength = cpu_to_le16 (4);
// Enter the sending queue
reg_queue->Next = NULL;
reg_queue->pUsbReq = dr;
reg_queue->urb = urb;
spin_lock_irq ( ®->EP0VM_spin_lock );
if( reg->reg_first == NULL )
reg->reg_first = reg_queue;
else
reg->reg_last->Next = reg_queue;
reg->reg_last = reg_queue;
spin_unlock_irq( ®->EP0VM_spin_lock );
// Start EP0VM
Wb35Reg_EP0VM_start( pHwData );
return true;
} else {
if (urb)
usb_free_urb( urb );
kfree(reg_queue);
return false;
}
}
void
Wb35Reg_EP0VM_start( phw_data_t pHwData )
{
struct wb35_reg *reg = &pHwData->reg;
if (atomic_inc_return(®->RegFireCount) == 1) {
reg->EP0vm_state = VM_RUNNING;
Wb35Reg_EP0VM(pHwData);
} else
atomic_dec(®->RegFireCount);
}
void
Wb35Reg_EP0VM(phw_data_t pHwData )
{
struct wb35_reg *reg = &pHwData->reg;
struct urb *urb;
struct usb_ctrlrequest *dr;
u32 * pBuffer;
int ret = -1;
struct wb35_reg_queue *reg_queue;
if (reg->SyncIoPause)
goto cleanup;
if (pHwData->SurpriseRemove)
goto cleanup;
// Get the register data and send to USB through Irp
spin_lock_irq( ®->EP0VM_spin_lock );
reg_queue = reg->reg_first;
spin_unlock_irq( ®->EP0VM_spin_lock );
if (!reg_queue)
goto cleanup;
// Get an Urb, send it
urb = (struct urb *)reg_queue->urb;
dr = reg_queue->pUsbReq;
urb = reg_queue->urb;
pBuffer = reg_queue->pBuffer;
if (reg_queue->DIRECT == 1) // output
pBuffer = ®_queue->VALUE;
<API key>( urb, pHwData->WbUsb.udev,
REG_DIRECTION(pHwData->WbUsb.udev,reg_queue),
(u8 *)dr,pBuffer,cpu_to_le16(dr->wLength),
<API key>, (void*)pHwData);
reg->EP0vm_state = VM_RUNNING;
ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret < 0) {
#ifdef _PE_REG_DUMP_
WBDEBUG(("EP0 Irp sending error\n"));
#endif
goto cleanup;
}
return;
cleanup:
reg->EP0vm_state = VM_STOP;
atomic_dec(®->RegFireCount);
}
void
<API key>(struct urb *urb)
{
phw_data_t pHwData = (phw_data_t)urb->context;
struct wb35_reg *reg = &pHwData->reg;
struct wb35_reg_queue *reg_queue;
// Variable setting
reg->EP0vm_state = VM_COMPLETED;
reg->EP0VM_status = urb->status;
if (pHwData->SurpriseRemove) { // Let WbWlanHalt to handle surprise remove
reg->EP0vm_state = VM_STOP;
atomic_dec(®->RegFireCount);
} else {
// Complete to send, remove the URB from the first
spin_lock_irq( ®->EP0VM_spin_lock );
reg_queue = reg->reg_first;
if (reg_queue == reg->reg_last)
reg->reg_last = NULL;
reg->reg_first = reg->reg_first->Next;
spin_unlock_irq( ®->EP0VM_spin_lock );
if (reg->EP0VM_status) {
#ifdef _PE_REG_DUMP_
WBDEBUG(("EP0 IoCompleteRoutine return error\n"));
<API key>( reg->EP0VM_status );
#endif
reg->EP0vm_state = VM_STOP;
pHwData->SurpriseRemove = 1;
} else {
// Success. Update the result
// Start the next send
Wb35Reg_EP0VM(pHwData);
}
kfree(reg_queue);
}
usb_free_urb(urb);
}
void
Wb35Reg_destroy(phw_data_t pHwData)
{
struct wb35_reg *reg = &pHwData->reg;
struct urb *urb;
struct wb35_reg_queue *reg_queue;
<API key>(pHwData);
// Wait for Reg operation completed
do {
msleep(10); // Delay for waiting function enter 940623.1.a
} while (reg->EP0vm_state != VM_STOP);
msleep(10); // Delay for waiting function enter 940623.1.b
// Release all the data in RegQueue
spin_lock_irq( ®->EP0VM_spin_lock );
reg_queue = reg->reg_first;
while (reg_queue) {
if (reg_queue == reg->reg_last)
reg->reg_last = NULL;
reg->reg_first = reg->reg_first->Next;
urb = reg_queue->urb;
spin_unlock_irq( ®->EP0VM_spin_lock );
if (urb) {
usb_free_urb(urb);
kfree(reg_queue);
} else {
#ifdef _PE_REG_DUMP_
WBDEBUG(("EP0 queue release error\n"));
#endif
}
spin_lock_irq( ®->EP0VM_spin_lock );
reg_queue = reg->reg_first;
}
spin_unlock_irq( ®->EP0VM_spin_lock );
}
// The function can be run in passive-level only.
unsigned char Wb35Reg_initial(phw_data_t pHwData)
{
struct wb35_reg *reg=&pHwData->reg;
u32 ltmp;
u32 SoftwareSet, VCO_trim, TxVga, Region_ScanInterval;
// Spin lock is acquired for read and write IRP command
spin_lock_init( ®->EP0VM_spin_lock );
Wb35Reg_WriteSync( pHwData, 0x03b4, 0x080d0000 ); // Start EEPROM access + Read + address(0x0d)
Wb35Reg_ReadSync( pHwData, 0x03b4, <mp );
//Update RF module type and determine the PHY type by inf or EEPROM
reg->EEPROMPhyType = (u8)( ltmp & 0xff );
// 0 V MAX2825, 1 V MAX2827, 2 V MAX2828, 3 V MAX2829
// 16V AL2230, 17 - AL7230, 18 - AL2230S
// 32 Reserved
// 33 - W89RF242(TxVGA 0~19), 34 - W89RF242(TxVGA 0~34)
if (reg->EEPROMPhyType != RF_DECIDE_BY_INF) {
if( (reg->EEPROMPhyType == RF_MAXIM_2825) ||
(reg->EEPROMPhyType == RF_MAXIM_2827) ||
(reg->EEPROMPhyType == RF_MAXIM_2828) ||
(reg->EEPROMPhyType == RF_MAXIM_2829) ||
(reg->EEPROMPhyType == RF_MAXIM_V1) ||
(reg->EEPROMPhyType == RF_AIROHA_2230) ||
(reg->EEPROMPhyType == RF_AIROHA_2230S) ||
(reg->EEPROMPhyType == RF_AIROHA_7230) ||
(reg->EEPROMPhyType == RF_WB_242) ||
(reg->EEPROMPhyType == RF_WB_242_1))
pHwData->phy_type = reg->EEPROMPhyType;
}
// Power On procedure running. The relative parameter will be set according to phy_type
<API key>( pHwData );
// Reading MAC address
<API key>( pHwData );
// Read VCO trim for RF parameter
Wb35Reg_WriteSync( pHwData, 0x03b4, 0x08200000 );
Wb35Reg_ReadSync( pHwData, 0x03b4, &VCO_trim );
// Read Antenna On/Off of software flag
Wb35Reg_WriteSync( pHwData, 0x03b4, 0x08210000 );
Wb35Reg_ReadSync( pHwData, 0x03b4, &SoftwareSet );
// Read TXVGA
Wb35Reg_WriteSync( pHwData, 0x03b4, 0x08100000 );
Wb35Reg_ReadSync( pHwData, 0x03b4, &TxVga );
// Get Scan interval setting from EEPROM offset 0x1c
Wb35Reg_WriteSync( pHwData, 0x03b4, 0x081d0000 );
Wb35Reg_ReadSync( pHwData, 0x03b4, &Region_ScanInterval );
// Update Ethernet address
memcpy( pHwData->CurrentMacAddress, pHwData->PermanentMacAddress, <API key> );
// Update software variable
pHwData->SoftwareSet = (u16)(SoftwareSet & 0xffff);
TxVga &= 0x000000ff;
pHwData-><API key> = (u8)TxVga;
pHwData->VCO_trim = (u8)VCO_trim & 0xff;
if (pHwData->VCO_trim == 0xff)
pHwData->VCO_trim = 0x28;
reg->EEPROMRegion = (u8)(Region_ScanInterval>>8); // 20060720
if( reg->EEPROMRegion<1 || reg->EEPROMRegion>6 )
reg->EEPROMRegion = REGION_AUTO;
//For Get Tx VGA from EEPROM 20060315.5 move here
GetTxVgaFromEEPROM( pHwData );
// Set Scan Interval
pHwData->Scan_Interval = (u8)(Region_ScanInterval & 0xff) * 10;
if ((pHwData->Scan_Interval == 2550) || (pHwData->Scan_Interval < 10)) // Is default setting 0xff * 10
pHwData->Scan_Interval = SCAN_MAX_CHNL_TIME;
// Initial register
<API key>(pHwData);
BBProcessor_initial(pHwData); // Async write, must wait until complete
<API key>(pHwData);
Mxx_initial(pHwData);
Dxx_initial(pHwData);
if (pHwData->SurpriseRemove)
return false;
else
return true; // Initial fail
}
// CardComputeCrc --
// Description:
// Runs the AUTODIN II CRC algorithm on buffer Buffer of length, Length.
// Arguments:
// Buffer - the input buffer
// Length - the length of Buffer
// Return Value:
// The 32-bit CRC value.
// Note:
// This is adapted from the comments in the assembly language
// version in _GENREQ.ASM of the DWB NE1000/2000 driver.
u32
CardComputeCrc(u8 * Buffer, u32 Length)
{
u32 Crc, Carry;
u32 i, j;
u8 CurByte;
Crc = 0xffffffff;
for (i = 0; i < Length; i++) {
CurByte = Buffer[i];
for (j = 0; j < 8; j++) {
Carry = ((Crc & 0x80000000) ? 1 : 0) ^ (CurByte & 0x01);
Crc <<= 1;
CurByte >>= 1;
if (Carry) {
Crc =(Crc ^ 0x04c11db6) | Carry;
}
}
}
return Crc;
}
// BitReverse --
// Reverse the bits in the input argument, dwData, which is
// regarded as a string of bits with the length, DataLength.
// Arguments:
// dwData :
// DataLength :
// Return:
// The converted value.
u32 BitReverse( u32 dwData, u32 DataLength)
{
u32 HalfLength, i, j;
u32 BitA, BitB;
if ( DataLength <= 0) return 0; // No conversion is done.
dwData = dwData & (0xffffffff >> (32 - DataLength));
HalfLength = DataLength / 2;
for ( i = 0, j = DataLength-1 ; i < HalfLength; i++, j
{
BitA = GetBit( dwData, i);
BitB = GetBit( dwData, j);
if (BitA && !BitB) {
dwData = ClearBit( dwData, i);
dwData = SetBit( dwData, j);
} else if (!BitA && BitB) {
dwData = SetBit( dwData, i);
dwData = ClearBit( dwData, j);
} else
{
// Do nothing since these two bits are of the save values.
}
}
return dwData;
}
void <API key>( phw_data_t pHwData )
{
u32 BB3c, BB54;
if ((pHwData->phy_type == RF_WB_242) ||
(pHwData->phy_type == RF_WB_242_1)) {
<API key> ( pHwData, 2412 ); // Sync operation
Wb35Reg_ReadSync( pHwData, 0x103c, &BB3c );
Wb35Reg_ReadSync( pHwData, 0x1054, &BB54 );
pHwData->BB3c_cal = BB3c;
pHwData->BB54_cal = BB54;
<API key>(pHwData);
BBProcessor_initial(pHwData); // Async operation
Wb35Reg_WriteSync( pHwData, 0x103c, BB3c );
Wb35Reg_WriteSync( pHwData, 0x1054, BB54 );
}
} |
#ifndef <API key>
#define <API key>
#define <API key> 0
#define <API key> 0
#define <API key> 0
#define <API key> 0
#define BCM1250_M3_WAR 0
#define SIBYTE_1956_WAR 0
#define <API key> 0
#define MIPS_CACHE_SYNC_WAR 0
#define <API key> 0
#define RM9000_CDEX_SMP_WAR 0
#define <API key> 0
#define R10000_LLSC_WAR 0
#define <API key> 0
#endif /* <API key> */ |
/*
* aoecmd.c
* Filesystem request handling methods
*/
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/genhd.h>
#include <linux/moduleparam.h>
#include <net/net_namespace.h>
#include <asm/unaligned.h>
#include "aoe.h"
static int aoe_deadsecs = 60 * 3;
module_param(aoe_deadsecs, int, 0644);
MODULE_PARM_DESC(aoe_deadsecs, "After aoe_deadsecs seconds, give up and fail dev.");
static int aoe_maxout = 16;
module_param(aoe_maxout, int, 0644);
MODULE_PARM_DESC(aoe_maxout,
"Only aoe_maxout outstanding packets for every MAC on eX.Y.");
static struct sk_buff *
new_skb(ulong len)
{
struct sk_buff *skb;
skb = alloc_skb(len, GFP_ATOMIC);
if (skb) {
<API key>(skb);
<API key>(skb);
skb->protocol = __constant_htons(ETH_P_AOE);
skb->priority = 0;
skb->next = skb->prev = NULL;
/* tell the network layer not to perform IP checksums
* or to get the NIC to do it
*/
skb->ip_summed = CHECKSUM_NONE;
}
return skb;
}
static struct frame *
getframe(struct aoetgt *t, int tag)
{
struct frame *f, *e;
f = t->frames;
e = f + t->nframes;
for (; f<e; f++)
if (f->tag == tag)
return f;
return NULL;
}
/*
* Leave the top bit clear so we have tagspace for userland.
* The bottom 16 bits are the xmit tick for rexmit/rttavg processing.
* This driver reserves tag -1 to mean "unused frame."
*/
static int
newtag(struct aoetgt *t)
{
register ulong n;
n = jiffies & 0xffff;
return n |= (++t->lasttag & 0x7fff) << 16;
}
static int
aoehdr_atainit(struct aoedev *d, struct aoetgt *t, struct aoe_hdr *h)
{
u32 host_tag = newtag(t);
memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src);
memcpy(h->dst, t->addr, sizeof h->dst);
h->type = <API key>(ETH_P_AOE);
h->verfl = AOE_HVER;
h->major = cpu_to_be16(d->aoemajor);
h->minor = d->aoeminor;
h->cmd = AOECMD_ATA;
h->tag = cpu_to_be32(host_tag);
return host_tag;
}
static inline void
put_lba(struct aoe_atahdr *ah, sector_t lba)
{
ah->lba0 = lba;
ah->lba1 = lba >>= 8;
ah->lba2 = lba >>= 8;
ah->lba3 = lba >>= 8;
ah->lba4 = lba >>= 8;
ah->lba5 = lba >>= 8;
}
static void
ifrotate(struct aoetgt *t)
{
t->ifp++;
if (t->ifp >= &t->ifs[NAOEIFS] || t->ifp->nd == NULL)
t->ifp = t->ifs;
if (t->ifp->nd == NULL) {
printk(KERN_INFO "aoe: no interface to rotate to\n");
BUG();
}
}
static void
skb_pool_put(struct aoedev *d, struct sk_buff *skb)
{
__skb_queue_tail(&d->skbpool, skb);
}
static struct sk_buff *
skb_pool_get(struct aoedev *d)
{
struct sk_buff *skb = skb_peek(&d->skbpool);
if (skb && atomic_read(&skb_shinfo(skb)->dataref) == 1) {
__skb_unlink(skb, &d->skbpool);
return skb;
}
if (skb_queue_len(&d->skbpool) < NSKBPOOLMAX &&
(skb = new_skb(ETH_ZLEN)))
return skb;
return NULL;
}
/* freeframe is where we do our load balancing so it's a little hairy. */
static struct frame *
freeframe(struct aoedev *d)
{
struct frame *f, *e, *rf;
struct aoetgt **t;
struct sk_buff *skb;
if (d->targets[0] == NULL) { /* shouldn't happen, but I'm paranoid */
printk(KERN_ERR "aoe: NULL TARGETS!\n");
return NULL;
}
t = d->tgt;
t++;
if (t >= &d->targets[NTARGETS] || !*t)
t = d->targets;
for (;;) {
if ((*t)->nout < (*t)->maxout
&& t != d->htgt
&& (*t)->ifp->nd) {
rf = NULL;
f = (*t)->frames;
e = f + (*t)->nframes;
for (; f < e; f++) {
if (f->tag != FREETAG)
continue;
skb = f->skb;
if (!skb
&& !(f->skb = skb = new_skb(ETH_ZLEN)))
continue;
if (atomic_read(&skb_shinfo(skb)->dataref)
!= 1) {
if (!rf)
rf = f;
continue;
}
gotone: skb_shinfo(skb)->nr_frags = skb->data_len = 0;
skb_trim(skb, 0);
d->tgt = t;
ifrotate(*t);
return f;
}
/* Work can be done, but the network layer is
holding our precious packets. Try to grab
one from the pool. */
f = rf;
if (f == NULL) { /* more paranoia */
printk(KERN_ERR
"aoe: freeframe: %s.\n",
"unexpected null rf");
d->flags |= DEVFL_KICKME;
return NULL;
}
skb = skb_pool_get(d);
if (skb) {
skb_pool_put(d, f->skb);
f->skb = skb;
goto gotone;
}
(*t)->dataref++;
if ((*t)->nout == 0)
d->flags |= DEVFL_KICKME;
}
if (t == d->tgt) /* we've looped and found nada */
break;
t++;
if (t >= &d->targets[NTARGETS] || !*t)
t = d->targets;
}
return NULL;
}
static int
aoecmd_ata_rw(struct aoedev *d)
{
struct frame *f;
struct aoe_hdr *h;
struct aoe_atahdr *ah;
struct buf *buf;
struct bio_vec *bv;
struct aoetgt *t;
struct sk_buff *skb;
ulong bcnt;
char writebit, extbit;
writebit = 0x10;
extbit = 0x4;
f = freeframe(d);
if (f == NULL)
return 0;
t = *d->tgt;
buf = d->inprocess;
bv = buf->bv;
bcnt = t->ifp->maxbcnt;
if (bcnt == 0)
bcnt = DEFAULTBCNT;
if (bcnt > buf->bv_resid)
bcnt = buf->bv_resid;
/* initialize the headers & frame */
skb = f->skb;
h = (struct aoe_hdr *) skb_mac_header(skb);
ah = (struct aoe_atahdr *) (h+1);
skb_put(skb, sizeof *h + sizeof *ah);
memset(h, 0, skb->len);
f->tag = aoehdr_atainit(d, t, h);
t->nout++;
f->waited = 0;
f->buf = buf;
f->bufaddr = page_address(bv->bv_page) + buf->bv_off;
f->bcnt = bcnt;
f->lba = buf->sector;
/* set up ata header */
ah->scnt = bcnt >> 9;
put_lba(ah, buf->sector);
if (d->flags & DEVFL_EXT) {
ah->aflags |= AOEAFL_EXT;
} else {
extbit = 0;
ah->lba3 &= 0x0f;
ah->lba3 |= 0xe0; /* LBA bit + obsolete 0xa0 */
}
if (bio_data_dir(buf->bio) == WRITE) {
skb_fill_page_desc(skb, 0, bv->bv_page, buf->bv_off, bcnt);
ah->aflags |= AOEAFL_WRITE;
skb->len += bcnt;
skb->data_len = bcnt;
t->wpkts++;
} else {
t->rpkts++;
writebit = 0;
}
ah->cmdstat = WIN_READ | writebit | extbit;
/* mark all tracking fields and load out */
buf->nframesout += 1;
buf->bv_off += bcnt;
buf->bv_resid -= bcnt;
buf->resid -= bcnt;
buf->sector += bcnt >> 9;
if (buf->resid == 0) {
d->inprocess = NULL;
} else if (buf->bv_resid == 0) {
buf->bv = ++bv;
buf->bv_resid = bv->bv_len;
WARN_ON(buf->bv_resid == 0);
buf->bv_off = bv->bv_offset;
}
skb->dev = t->ifp->nd;
skb = skb_clone(skb, GFP_ATOMIC);
if (skb)
__skb_queue_tail(&d->sendq, skb);
return 1;
}
/* some callers cannot sleep, and they can call this function,
* transmitting the packets later, when interrupts are on
*/
static void
aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff_head *queue)
{
struct aoe_hdr *h;
struct aoe_cfghdr *ch;
struct sk_buff *skb;
struct net_device *ifp;
read_lock(&dev_base_lock);
for_each_netdev(&init_net, ifp) {
dev_hold(ifp);
if (!is_aoe_netif(ifp))
goto cont;
skb = new_skb(sizeof *h + sizeof *ch);
if (skb == NULL) {
printk(KERN_INFO "aoe: skb alloc failure\n");
goto cont;
}
skb_put(skb, sizeof *h + sizeof *ch);
skb->dev = ifp;
__skb_queue_tail(queue, skb);
h = (struct aoe_hdr *) skb_mac_header(skb);
memset(h, 0, sizeof *h + sizeof *ch);
memset(h->dst, 0xff, sizeof h->dst);
memcpy(h->src, ifp->dev_addr, sizeof h->src);
h->type = <API key>(ETH_P_AOE);
h->verfl = AOE_HVER;
h->major = cpu_to_be16(aoemajor);
h->minor = aoeminor;
h->cmd = AOECMD_CFG;
cont:
dev_put(ifp);
}
read_unlock(&dev_base_lock);
}
static void
resend(struct aoedev *d, struct aoetgt *t, struct frame *f)
{
struct sk_buff *skb;
struct aoe_hdr *h;
struct aoe_atahdr *ah;
char buf[128];
u32 n;
ifrotate(t);
n = newtag(t);
skb = f->skb;
h = (struct aoe_hdr *) skb_mac_header(skb);
ah = (struct aoe_atahdr *) (h+1);
snprintf(buf, sizeof buf,
"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x s=%pm d=%pm nout=%d\n",
"retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n,
h->src, h->dst, t->nout);
aoechr_error(buf);
f->tag = n;
h->tag = cpu_to_be32(n);
memcpy(h->dst, t->addr, sizeof h->dst);
memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src);
switch (ah->cmdstat) {
default:
break;
case WIN_READ:
case WIN_READ_EXT:
case WIN_WRITE:
case WIN_WRITE_EXT:
put_lba(ah, f->lba);
n = f->bcnt;
if (n > DEFAULTBCNT)
n = DEFAULTBCNT;
ah->scnt = n >> 9;
if (ah->aflags & AOEAFL_WRITE) {
skb_fill_page_desc(skb, 0, virt_to_page(f->bufaddr),
offset_in_page(f->bufaddr), n);
skb->len = sizeof *h + sizeof *ah + n;
skb->data_len = n;
}
}
skb->dev = t->ifp->nd;
skb = skb_clone(skb, GFP_ATOMIC);
if (skb == NULL)
return;
__skb_queue_tail(&d->sendq, skb);
}
static int
tsince(int tag)
{
int n;
n = jiffies & 0xffff;
n -= tag & 0xffff;
if (n < 0)
n += 1<<16;
return n;
}
static struct aoeif *
getif(struct aoetgt *t, struct net_device *nd)
{
struct aoeif *p, *e;
p = t->ifs;
e = p + NAOEIFS;
for (; p < e; p++)
if (p->nd == nd)
return p;
return NULL;
}
static struct aoeif *
addif(struct aoetgt *t, struct net_device *nd)
{
struct aoeif *p;
p = getif(t, NULL);
if (!p)
return NULL;
p->nd = nd;
p->maxbcnt = DEFAULTBCNT;
p->lost = 0;
p->lostjumbo = 0;
return p;
}
static void
ejectif(struct aoetgt *t, struct aoeif *ifp)
{
struct aoeif *e;
ulong n;
e = t->ifs + NAOEIFS - 1;
n = (e - ifp) * sizeof *ifp;
memmove(ifp, ifp+1, n);
e->nd = NULL;
}
static int
sthtith(struct aoedev *d)
{
struct frame *f, *e, *nf;
struct sk_buff *skb;
struct aoetgt *ht = *d->htgt;
f = ht->frames;
e = f + ht->nframes;
for (; f < e; f++) {
if (f->tag == FREETAG)
continue;
nf = freeframe(d);
if (!nf)
return 0;
skb = nf->skb;
*nf = *f;
f->skb = skb;
f->tag = FREETAG;
nf->waited = 0;
ht->nout
(*d->tgt)->nout++;
resend(d, *d->tgt, nf);
}
/* he's clean, he's useless. take away his interfaces */
memset(ht->ifs, 0, sizeof ht->ifs);
d->htgt = NULL;
return 1;
}
static inline unsigned char
ata_scnt(unsigned char *packet) {
struct aoe_hdr *h;
struct aoe_atahdr *ah;
h = (struct aoe_hdr *) packet;
ah = (struct aoe_atahdr *) (h+1);
return ah->scnt;
}
static void
rexmit_timer(ulong vp)
{
struct sk_buff_head queue;
struct aoedev *d;
struct aoetgt *t, **tt, **te;
struct aoeif *ifp;
struct frame *f, *e;
register long timeout;
ulong flags, n;
d = (struct aoedev *) vp;
/* timeout is always ~150% of the moving average */
timeout = d->rttavg;
timeout += timeout >> 1;
spin_lock_irqsave(&d->lock, flags);
if (d->flags & DEVFL_TKILL) {
<API key>(&d->lock, flags);
return;
}
tt = d->targets;
te = tt + NTARGETS;
for (; tt < te && *tt; tt++) {
t = *tt;
f = t->frames;
e = f + t->nframes;
for (; f < e; f++) {
if (f->tag == FREETAG
|| tsince(f->tag) < timeout)
continue;
n = f->waited += timeout;
n /= HZ;
if (n > aoe_deadsecs) {
/* waited too long. device failure. */
aoedev_downdev(d);
break;
}
if (n > HELPWAIT /* see if another target can help */
&& (tt != d->targets || d->targets[1]))
d->htgt = tt;
if (t->nout == t->maxout) {
if (t->maxout > 1)
t->maxout
t->lastwadj = jiffies;
}
ifp = getif(t, f->skb->dev);
if (ifp && ++ifp->lost > (t->nframes << 1)
&& (ifp != t->ifs || t->ifs[1].nd)) {
ejectif(t, ifp);
ifp = NULL;
}
if (ata_scnt(skb_mac_header(f->skb)) > DEFAULTBCNT / 512
&& ifp && ++ifp->lostjumbo > (t->nframes << 1)
&& ifp->maxbcnt != DEFAULTBCNT) {
printk(KERN_INFO
"aoe: e%ld.%d: "
"too many lost jumbo on "
"%s:%pm - "
"falling back to %d frames.\n",
d->aoemajor, d->aoeminor,
ifp->nd->name, t->addr,
DEFAULTBCNT);
ifp->maxbcnt = 0;
}
resend(d, t, f);
}
/* window check */
if (t->nout == t->maxout
&& t->maxout < t->nframes
&& (jiffies - t->lastwadj)/HZ > 10) {
t->maxout++;
t->lastwadj = jiffies;
}
}
if (!skb_queue_empty(&d->sendq)) {
n = d->rttavg <<= 1;
if (n > MAXTIMER)
d->rttavg = MAXTIMER;
}
if (d->flags & DEVFL_KICKME || d->htgt) {
d->flags &= ~DEVFL_KICKME;
aoecmd_work(d);
}
<API key>(&queue);
<API key>(&d->sendq, &queue);
d->timer.expires = jiffies + TIMERTICK;
add_timer(&d->timer);
<API key>(&d->lock, flags);
aoenet_xmit(&queue);
}
/* enters with d->lock held */
void
aoecmd_work(struct aoedev *d)
{
struct buf *buf;
loop:
if (d->htgt && !sthtith(d))
return;
if (d->inprocess == NULL) {
if (list_empty(&d->bufq))
return;
buf = container_of(d->bufq.next, struct buf, bufs);
list_del(d->bufq.next);
d->inprocess = buf;
}
if (aoecmd_ata_rw(d))
goto loop;
}
/* this function performs work that has been deferred until sleeping is OK
*/
void
aoecmd_sleepwork(struct work_struct *work)
{
struct aoedev *d = container_of(work, struct aoedev, work);
if (d->flags & DEVFL_GDALLOC)
aoeblk_gdalloc(d);
if (d->flags & DEVFL_NEWSIZE) {
struct block_device *bd;
unsigned long flags;
u64 ssize;
ssize = get_capacity(d->gd);
bd = bdget_disk(d->gd, 0);
if (bd) {
mutex_lock(&bd->bd_inode->i_mutex);
i_size_write(bd->bd_inode, (loff_t)ssize<<9);
mutex_unlock(&bd->bd_inode->i_mutex);
bdput(bd);
}
spin_lock_irqsave(&d->lock, flags);
d->flags |= DEVFL_UP;
d->flags &= ~DEVFL_NEWSIZE;
<API key>(&d->lock, flags);
}
}
static void
ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
{
u64 ssize;
u16 n;
/* word 83: command set supported */
n = get_unaligned_le16(&id[83 << 1]);
/* word 86: command set/feature enabled */
n |= get_unaligned_le16(&id[86 << 1]);
if (n & (1<<10)) { /* bit 10: LBA 48 */
d->flags |= DEVFL_EXT;
/* word 100: number lba48 sectors */
ssize = get_unaligned_le64(&id[100 << 1]);
/* set as in ide-disk.c:<API key> */
d->geo.cylinders = ssize;
d->geo.cylinders /= (255 * 63);
d->geo.heads = 255;
d->geo.sectors = 63;
} else {
d->flags &= ~DEVFL_EXT;
/* number lba28 sectors */
ssize = get_unaligned_le32(&id[60 << 1]);
/* NOTE: obsolete in ATA 6 */
d->geo.cylinders = get_unaligned_le16(&id[54 << 1]);
d->geo.heads = get_unaligned_le16(&id[55 << 1]);
d->geo.sectors = get_unaligned_le16(&id[56 << 1]);
}
if (d->ssize != ssize)
printk(KERN_INFO
"aoe: %pm e%ld.%d v%04x has %llu sectors\n",
t->addr,
d->aoemajor, d->aoeminor,
d->fw_ver, (long long)ssize);
d->ssize = ssize;
d->geo.start = 0;
if (d->flags & (DEVFL_GDALLOC|DEVFL_NEWSIZE))
return;
if (d->gd != NULL) {
set_capacity(d->gd, ssize);
d->flags |= DEVFL_NEWSIZE;
} else
d->flags |= DEVFL_GDALLOC;
schedule_work(&d->work);
}
static void
calc_rttavg(struct aoedev *d, int rtt)
{
register long n;
n = rtt;
if (n < 0) {
n = -rtt;
if (n < MINTIMER)
n = MINTIMER;
else if (n > MAXTIMER)
n = MAXTIMER;
d->mintimer += (n - d->mintimer) >> 1;
} else if (n < d->mintimer)
n = d->mintimer;
else if (n > MAXTIMER)
n = MAXTIMER;
/* g == .25; cf. Congestion Avoidance and Control, Jacobson & Karels; 1988 */
n -= d->rttavg;
d->rttavg += n >> 2;
}
static struct aoetgt *
gettgt(struct aoedev *d, char *addr)
{
struct aoetgt **t, **e;
t = d->targets;
e = t + NTARGETS;
for (; t < e && *t; t++)
if (memcmp((*t)->addr, addr, sizeof((*t)->addr)) == 0)
return *t;
return NULL;
}
static inline void
diskstats(struct gendisk *disk, struct bio *bio, ulong duration, sector_t sector)
{
unsigned long n_sect = bio->bi_size >> 9;
const int rw = bio_data_dir(bio);
struct hd_struct *part;
int cpu;
cpu = part_stat_lock();
part = disk_map_sector_rcu(disk, sector);
part_stat_inc(cpu, part, ios[rw]);
part_stat_add(cpu, part, ticks[rw], duration);
part_stat_add(cpu, part, sectors[rw], n_sect);
part_stat_add(cpu, part, io_ticks, duration);
part_stat_unlock();
}
void
aoecmd_ata_rsp(struct sk_buff *skb)
{
struct sk_buff_head queue;
struct aoedev *d;
struct aoe_hdr *hin, *hout;
struct aoe_atahdr *ahin, *ahout;
struct frame *f;
struct buf *buf;
struct aoetgt *t;
struct aoeif *ifp;
register long n;
ulong flags;
char ebuf[128];
u16 aoemajor;
hin = (struct aoe_hdr *) skb_mac_header(skb);
aoemajor = get_unaligned_be16(&hin->major);
d = aoedev_by_aoeaddr(aoemajor, hin->minor);
if (d == NULL) {
snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
"for unknown device %d.%d\n",
aoemajor, hin->minor);
aoechr_error(ebuf);
return;
}
spin_lock_irqsave(&d->lock, flags);
n = get_unaligned_be32(&hin->tag);
t = gettgt(d, hin->src);
if (t == NULL) {
printk(KERN_INFO "aoe: can't find target e%ld.%d:%pm\n",
d->aoemajor, d->aoeminor, hin->src);
<API key>(&d->lock, flags);
return;
}
f = getframe(t, n);
if (f == NULL) {
calc_rttavg(d, -tsince(n));
<API key>(&d->lock, flags);
snprintf(ebuf, sizeof ebuf,
"%15s e%d.%d tag=%08x@%08lx\n",
"unexpected rsp",
get_unaligned_be16(&hin->major),
hin->minor,
get_unaligned_be32(&hin->tag),
jiffies);
aoechr_error(ebuf);
return;
}
calc_rttavg(d, tsince(f->tag));
ahin = (struct aoe_atahdr *) (hin+1);
hout = (struct aoe_hdr *) skb_mac_header(f->skb);
ahout = (struct aoe_atahdr *) (hout+1);
buf = f->buf;
if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */
printk(KERN_ERR
"aoe: ata error cmd=%2.2Xh stat=%2.2Xh from e%ld.%d\n",
ahout->cmdstat, ahin->cmdstat,
d->aoemajor, d->aoeminor);
if (buf)
buf->flags |= BUFFL_FAIL;
} else {
if (d->htgt && t == *d->htgt) /* I'll help myself, thank you. */
d->htgt = NULL;
n = ahout->scnt << 9;
switch (ahout->cmdstat) {
case WIN_READ:
case WIN_READ_EXT:
if (skb->len - sizeof *hin - sizeof *ahin < n) {
printk(KERN_ERR
"aoe: %s. skb->len=%d need=%ld\n",
"runt data size in read", skb->len, n);
/* fail frame f? just returning will rexmit. */
<API key>(&d->lock, flags);
return;
}
memcpy(f->bufaddr, ahin+1, n);
case WIN_WRITE:
case WIN_WRITE_EXT:
ifp = getif(t, skb->dev);
if (ifp) {
ifp->lost = 0;
if (n > DEFAULTBCNT)
ifp->lostjumbo = 0;
}
if (f->bcnt -= n) {
f->lba += n >> 9;
f->bufaddr += n;
resend(d, t, f);
goto xmit;
}
break;
case WIN_IDENTIFY:
if (skb->len - sizeof *hin - sizeof *ahin < 512) {
printk(KERN_INFO
"aoe: runt data size in ataid. skb->len=%d\n",
skb->len);
<API key>(&d->lock, flags);
return;
}
ataid_complete(d, t, (char *) (ahin+1));
break;
default:
printk(KERN_INFO
"aoe: unrecognized ata command %2.2Xh for %d.%d\n",
ahout->cmdstat,
get_unaligned_be16(&hin->major),
hin->minor);
}
}
if (buf && --buf->nframesout == 0 && buf->resid == 0) {
diskstats(d->gd, buf->bio, jiffies - buf->stime, buf->sector);
n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
bio_endio(buf->bio, n);
mempool_free(buf, d->bufpool);
}
f->buf = NULL;
f->tag = FREETAG;
t->nout
aoecmd_work(d);
xmit:
<API key>(&queue);
<API key>(&d->sendq, &queue);
<API key>(&d->lock, flags);
aoenet_xmit(&queue);
}
void
aoecmd_cfg(ushort aoemajor, unsigned char aoeminor)
{
struct sk_buff_head queue;
<API key>(&queue);
aoecmd_cfg_pkts(aoemajor, aoeminor, &queue);
aoenet_xmit(&queue);
}
struct sk_buff *
aoecmd_ata_id(struct aoedev *d)
{
struct aoe_hdr *h;
struct aoe_atahdr *ah;
struct frame *f;
struct sk_buff *skb;
struct aoetgt *t;
f = freeframe(d);
if (f == NULL)
return NULL;
t = *d->tgt;
/* initialize the headers & frame */
skb = f->skb;
h = (struct aoe_hdr *) skb_mac_header(skb);
ah = (struct aoe_atahdr *) (h+1);
skb_put(skb, sizeof *h + sizeof *ah);
memset(h, 0, skb->len);
f->tag = aoehdr_atainit(d, t, h);
t->nout++;
f->waited = 0;
/* set up ata header */
ah->scnt = 1;
ah->cmdstat = WIN_IDENTIFY;
ah->lba3 = 0xa0;
skb->dev = t->ifp->nd;
d->rttavg = MAXTIMER;
d->timer.function = rexmit_timer;
return skb_clone(skb, GFP_ATOMIC);
}
static struct aoetgt *
addtgt(struct aoedev *d, char *addr, ulong nframes)
{
struct aoetgt *t, **tt, **te;
struct frame *f, *e;
tt = d->targets;
te = tt + NTARGETS;
for (; tt < te && *tt; tt++)
;
if (tt == te) {
printk(KERN_INFO
"aoe: device addtgt failure; too many targets\n");
return NULL;
}
t = kcalloc(1, sizeof *t, GFP_ATOMIC);
f = kcalloc(nframes, sizeof *f, GFP_ATOMIC);
if (!t || !f) {
kfree(f);
kfree(t);
printk(KERN_INFO "aoe: cannot allocate memory to add target\n");
return NULL;
}
t->nframes = nframes;
t->frames = f;
e = f + nframes;
for (; f < e; f++)
f->tag = FREETAG;
memcpy(t->addr, addr, sizeof t->addr);
t->ifp = t->ifs;
t->maxout = t->nframes;
return *tt = t;
}
void
aoecmd_cfg_rsp(struct sk_buff *skb)
{
struct aoedev *d;
struct aoe_hdr *h;
struct aoe_cfghdr *ch;
struct aoetgt *t;
struct aoeif *ifp;
ulong flags, sysminor, aoemajor;
struct sk_buff *sl;
u16 n;
h = (struct aoe_hdr *) skb_mac_header(skb);
ch = (struct aoe_cfghdr *) (h+1);
/*
* Enough people have their dip switches set backwards to
* warrant a loud message for this special case.
*/
aoemajor = get_unaligned_be16(&h->major);
if (aoemajor == 0xfff) {
printk(KERN_ERR "aoe: Warning: shelf address is all ones. "
"Check shelf dip switches.\n");
return;
}
sysminor = SYSMINOR(aoemajor, h->minor);
if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n",
aoemajor, (int) h->minor);
return;
}
n = be16_to_cpu(ch->bufcnt);
if (n > aoe_maxout) /* keep it reasonable */
n = aoe_maxout;
d = <API key>(sysminor);
if (d == NULL) {
printk(KERN_INFO "aoe: device sysminor_m failure\n");
return;
}
spin_lock_irqsave(&d->lock, flags);
t = gettgt(d, h->src);
if (!t) {
t = addtgt(d, h->src, n);
if (!t) {
<API key>(&d->lock, flags);
return;
}
}
ifp = getif(t, skb->dev);
if (!ifp) {
ifp = addif(t, skb->dev);
if (!ifp) {
printk(KERN_INFO
"aoe: device addif failure; "
"too many interfaces?\n");
<API key>(&d->lock, flags);
return;
}
}
if (ifp->maxbcnt) {
n = ifp->nd->mtu;
n -= sizeof (struct aoe_hdr) + sizeof (struct aoe_atahdr);
n /= 512;
if (n > ch->scnt)
n = ch->scnt;
n = n ? n * 512 : DEFAULTBCNT;
if (n != ifp->maxbcnt) {
printk(KERN_INFO
"aoe: e%ld.%d: setting %d%s%s:%pm\n",
d->aoemajor, d->aoeminor, n,
" byte data frames on ", ifp->nd->name,
t->addr);
ifp->maxbcnt = n;
}
}
/* don't change users' perspective */
if (d->nopen) {
<API key>(&d->lock, flags);
return;
}
d->fw_ver = be16_to_cpu(ch->fwver);
sl = aoecmd_ata_id(d);
<API key>(&d->lock, flags);
if (sl) {
struct sk_buff_head queue;
<API key>(&queue);
__skb_queue_tail(&queue, sl);
aoenet_xmit(&queue);
}
}
void
aoecmd_cleanslate(struct aoedev *d)
{
struct aoetgt **t, **te;
struct aoeif *p, *e;
d->mintimer = MINTIMER;
t = d->targets;
te = t + NTARGETS;
for (; t < te && *t; t++) {
(*t)->maxout = (*t)->nframes;
p = (*t)->ifs;
e = p + NAOEIFS;
for (; p < e; p++) {
p->lostjumbo = 0;
p->lost = 0;
p->maxbcnt = DEFAULTBCNT;
}
}
} |
// <API key>.h
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// all copies or substantial portions of the Software.
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <Availability.h>
#if <API key>
#import <MobileCoreServices/MobileCoreServices.h>
#else
#import <CoreServices/CoreServices.h>
#endif
#import "<API key>.h"
#import "<API key>.h"
#import "<API key>.h"
#import "AFSecurityPolicy.h"
#import "<API key>.h"
#ifndef <API key>
#if __has_attribute(<API key>)
#define <API key> __attribute__((<API key>))
#else
#define <API key>
#endif
#endif
<API key>
@interface <API key> : NSObject <NSSecureCoding, NSCopying>
/**
The URL used to monitor reachability, and construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods.
*/
@property (readonly, nonatomic, strong, nullable) NSURL *baseURL;
/**
Requests created with `requestWithMethod:URLString:parameters:` & `<API key>:URLString:parameters:<API key>:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `<API key>`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
@warning `requestSerializer` must not be `nil`.
*/
@property (nonatomic, strong) <API key> <<API key>> * requestSerializer;
/**
Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to a JSON serializer, which serializes data from responses with a `application/json` MIME type, and falls back to the raw data object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-<API key>:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed.
@warning `responseSerializer` must not be `nil`.
*/
@property (nonatomic, strong) <API key> <<API key>> * responseSerializer;
/**
The operation queue on which request operations are scheduled and run.
*/
@property (nonatomic, strong) NSOperationQueue *operationQueue;
@name Managing URL Credentials
/**
Whether request operations should consult the credential storage for authenticating the connection. `YES` by default.
@see <API key> -<API key>
*/
@property (nonatomic, assign) BOOL <API key>;
/**
The credential used by request operations for authentication challenges.
@see <API key> -credential
*/
@property (nonatomic, strong, nullable) NSURLCredential *credential;
@name Managing Security Policy
/**
The security policy used by created request operations to evaluate server trust for secure connections. `<API key>` uses the `defaultPolicy` unless otherwise specified.
*/
@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
@name Managing Network Reachability
/**
The network reachability manager. `<API key>` uses the `sharedManager` by default.
*/
@property (readwrite, nonatomic, strong) <API key> *reachabilityManager;
@name Managing Callback Queues
/**
The dispatch queue for the `completionBlock` of request operations. If `NULL` (default), the main queue is used.
*/
#if OS_OBJECT_USE_OBJC
@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue;
#else
@property (nonatomic, assign, nullable) dispatch_queue_t completionQueue;
#endif
/**
The dispatch group for the `completionBlock` of request operations. If `NULL` (default), a private dispatch group is used.
*/
#if OS_OBJECT_USE_OBJC
@property (nonatomic, strong, nullable) dispatch_group_t completionGroup;
#else
@property (nonatomic, assign, nullable) dispatch_group_t completionGroup;
#endif
@name Creating and Initializing HTTP Clients
/**
Creates and returns an `<API key>` object.
*/
+ (instancetype)manager;
/**
Initializes an `<API key>` object with the specified base URL.
This is the designated initializer.
@param url The base URL for the HTTP client.
@return The newly-initialized HTTP client
*/
- (instancetype)initWithBaseURL:(nullable NSURL *)url <API key>;
@name Managing HTTP Request Operations
/**
Creates an `<API key>`, and sets the response serializers to that of the HTTP client.
@param request The request object to be loaded asynchronously during execution of the operation.
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes two arguments: the created request operation and the object created from the response data of request.
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes two arguments:, the created request operation and the `NSError` object describing the network or parsing error that occurred.
*/
- (<API key> *)<API key>:(NSURLRequest *)request
success:(nullable void (^)(<API key> *operation, id responseObject))success
failure:(nullable void (^)(<API key> *operation, NSError *error))failure;
@name Making HTTP Requests
- (nullable <API key> *)GET:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(<API key> *operation, id responseObject))success
failure:(nullable void (^)(<API key> * __nullable operation, NSError *error))failure;
/**
Creates and runs an `<API key>` with a `HEAD` request.
@param URLString The URL string used to create the request URL.
@param parameters The parameters to be encoded according to the client request serializer.
@param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single arguments: the request operation.
@param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the request operation and the error describing the network or parsing error that occurred.
@see -<API key>:success:failure:
*/
- (nullable <API key> *)HEAD:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(<API key> *operation))success
failure:(nullable void (^)(<API key> * __nullable operation, NSError *error))failure;
- (nullable <API key> *)POST:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(<API key> *operation, id responseObject))success
failure:(nullable void (^)(<API key> * __nullable operation, NSError *error))failure;
- (nullable <API key> *)POST:(NSString *)URLString
parameters:(nullable id)parameters
<API key>:(nullable void (^)(id <AFMultipartFormData> formData))block
success:(nullable void (^)(<API key> *operation, id responseObject))success
failure:(nullable void (^)(<API key> * __nullable operation, NSError *error))failure;
- (nullable <API key> *)PUT:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(<API key> *operation, id responseObject))success
failure:(nullable void (^)(<API key> * __nullable operation, NSError *error))failure;
- (nullable <API key> *)PATCH:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(<API key> *operation, id responseObject))success
failure:(nullable void (^)(<API key> * __nullable operation, NSError *error))failure;
- (nullable <API key> *)DELETE:(NSString *)URLString
parameters:(nullable id)parameters
success:(nullable void (^)(<API key> *operation, id responseObject))success
failure:(nullable void (^)(<API key> * __nullable operation, NSError *error))failure;
@end
<API key> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<html>
<head>
<title>Javascript code prettifier</title>
<link href="src/prettify.css" type="text/css" rel="stylesheet" />
<script src="src/prettify.js" type="text/javascript"></script>
<style type="text/css">
body { margin-left: .5in }
h1, h2, h3, h4, .footer { margin-left: -.4in; }
</style>
</head>
<body onload="prettyPrint()" bgcolor="white">
<small style="float: right">Languages : <a href="README-zh-Hans.html">CH</a></small>
<h1>Javascript code prettifier</h1>
<h2>Setup</h2>
<ol>
<li><a href="http://code.google.com/p/<API key>/downloads/list">Download</a> a distribution
<li>Include the script and stylesheets in your document
(you will need to make sure the css and js file are on your server, and
adjust the paths in the <tt>script</tt> and <tt>link</tt> tag)
<pre class="prettyprint">
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script></pre>
<li>Add <code class="prettyprint lang-in.tag">onload="prettyPrint()"</code> to your
document's body tag.
<li>Modify the stylesheet to get the coloring you prefer</li>
</ol>
<h2>Usage</h2>
<p>Put code snippets in
<tt><pre class="prettyprint">...</pre></tt>
or <tt><code class="prettyprint">...</code></tt>
and it will automatically be pretty printed.
<table summary="code examples">
<tr>
<th>The original
<th>Prettier
<tr>
<td><pre style="border: 1px solid #888;padding: 2px"
><a name="voila1"></a>class Voila {
public:
// Voila
static const string VOILA = "Voila";
// will not interfere with embedded <a href="#voila1">tags</a>.
}</pre>
<td><pre class="prettyprint"><a name="voila2"></a>class Voila {
public:
// Voila
static const string VOILA = "Voila";
// will not interfere with embedded <a href="#voila2">tags</a>.
}</pre>
</table>
<h2>FAQ</h2>
<h3 id="langs">For which languages does it work?</h3>
<p>The comments in <tt>prettify.js</tt> are authoritative but the lexer
should work on a number of languages including C and friends,
Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles.
It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl
and Ruby, but, because of commenting conventions, doesn't work on
Smalltalk, or CAML-like languages.</p>
<p>LISPy languages are supported via an extension:
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-lisp.js"
><code>lang-lisp.js</code></a>.</p>
<p>And similarly for
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-clj.js"
><code>Clojure</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-css.js"
><code>CSS</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-go.js"
><code>Go</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-hs.js"
><code>Haskell</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-lua.js"
><code>Lua</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-ml.js"
><code>OCAML, SML, F#</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-n.js"
><code>Nemerle</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-proto.js"
><code>Protocol Buffers</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-scala.js"
><code>Scala</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-sql.js"
><code>SQL</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-tex.js"
><code>TeX, LaTeX</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-vhdl.js"
><code>VHDL</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-vb.js"
><code>Visual Basic</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-wiki.js"
><code>WikiText</code></a>,
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-xq.js"
><code>XQuery</code></a>, and
<a href="http://code.google.com/p/<API key>/source/browse/trunk/src/lang-yaml.js"
><code>YAML</code></a>.
<p>If you'd like to add an extension for your favorite language, please
look at <tt>src/lang-lisp.js</tt> and file an
<a href="http://code.google.com/p/<API key>/issues/list"
>issue</a> including your language extension, and a testcase.</p>
<h3>How do I specify the language of my code?</h3>
<p>You don't need to specify the language since <code>prettyprint()</code>
will guess. You can specify a language by specifying the language extension
along with the <code>prettyprint</code> class like so:</p>
<pre class="prettyprint lang-html"
><pre class="prettyprint <b>lang-html</b>">
The lang-* class specifies the language file extensions.
File extensions supported by default include
"bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
"java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
"xhtml", "xml", "xsl".
</pre></pre>
<p>You may also use the
<a href="http://dev.w3.org/html5/spec-author-view/the-code-element.html#the-code-element"
>HTML 5</a> convention of embedding a <tt>code</tt> element inside the
<code>PRE</code> and using <code>language-java</code> style classes.
E.g. <xmp class="prettyprint"><pre class="prettyprint"><code class="language-java">...</code></pre></xmp>
<h3>It doesn't work on <tt><obfuscated code sample></tt>?</h3>
<p>Yes. Prettifying obfuscated code is like putting lipstick on a pig
— i.e. outside the scope of this tool.</p>
<h3>Which browsers does it work with?</h3>
<p>It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4.
Look at <a href="tests/prettify_test.html">the test page</a> to see if it
works in your browser.</p>
<h3>What's changed?</h3>
<p>See the <a href="CHANGES.html">change log</a></p>
<h3>Why doesn't Prettyprinting of strings work on WordPress?</h3>
<p>Apparently wordpress does "smart quoting" which changes close quotes.
This causes end quotes to not match up with open quotes.
<p>This breaks prettifying as well as copying and pasting of code samples.
See
<a href="http://wordpress.org/support/topic/125038"
>WordPress's help center</a> for info on how to stop smart quoting of code
snippets.</p>
<h3 id="linenums">How do I put line numbers in my code?</h3>
<p>You can use the <code>linenums</code> class to turn on line
numbering. If your code doesn't start at line number 1, you can
add a colon and a line number to the end of that class as in
<code>linenums:52</code>.
<p>For example
<pre class="prettyprint"><pre class="prettyprint linenums:<b>4</b>"
>// This is line 4.
foo();
bar();
baz();
boo();
far();
faz();
<pre></pre>
produces
<pre class="prettyprint linenums:4"
>// This is line 4.
foo();
bar();
baz();
boo();
far();
faz();
</pre>
<h3>How do I prevent a portion of markup from being marked as code?</h3>
<p>You can use the <code>nocode</code> class to identify a span of markup
that is not code.
<pre class="prettyprint"><pre class=prettyprint>
int x = foo(); /* This is a comment <span class="nocode">This is not code</span>
Continuation of comment */
int y = bar();
</pre></pre>
produces
<pre class="prettyprint">
int x = foo(); /* This is a comment <span class="nocode">This is not code</span>
Continuation of comment */
int y = bar();
</pre>
<p>For a more complete example see the issue22
<a href="tests/prettify_test.html#issue22">testcase</a>.</p>
<h3>I get an error message "a is not a function" or "opt_whenDone is not a function"</h3>
<p>If you are calling <code>prettyPrint</code> via an event handler, wrap it in a function.
Instead of doing
<blockquote>
<code class="prettyprint lang-js"
>addEventListener('load', prettyPrint, false);</code>
</blockquote>
wrap it in a closure like
<blockquote>
<code class="prettyprint lang-js"
>addEventListener('load', function (event) { prettyPrint() }, false);</code>
</blockquote>
so that the browser does not pass an event object to <code>prettyPrint</code> which
will confuse it.
<h3>How can I customize the colors and styles of my code?</h3>
<p>
Prettify adds <code><span></code> with <code>class</code>es describing
the kind of code. You can create CSS styles to matches these
classes.
See the
<a href="http://<API key>.googlecode.com/svn/trunk/styles/index.html">
theme gallery</a> for examples.
</p>
<br><br><br>
<div class="footer">
<!-- Created: Tue Oct 3 17:51:56 PDT 2006 -->
<!-- hhmts start -->Last modified: Fri May 27 20:23:23 PDT 2011 <!-- hhmts end -->
</div>
</body>
</html> |
!function(e){window.qoopido.register("support/element/canvas",e,["../../support"])}(function(e,t,o,n,s,a){"use strict";var r=e.support;return r.addTest("/element/canvas",function(e){var t=r.pool?r.pool.obtain("canvas"):a.createElement("canvas");t.getContext&&t.getContext("2d")?e.resolve():e.reject(),t.dispose&&t.dispose()})}); |
#ifndef __MDNIE_TABLE_H__
#define __MDNIE_TABLE_H__
#include "mdnie.h"
static unsigned short <API key>[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00ac, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0090, 0x0080, /*DE egth*/
0x0092, 0x0030, /*DE pe*/
0x0093, 0x0080, /*DE pf*/
0x0094, 0x0080, /*DE pb*/
0x0095, 0x0080, /*DE ne*/
0x0096, 0x0080, /*DE nf*/
0x0097, 0x0080, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1a04, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x0a94, /*CC lut r 16 144*/
0x0022, 0x18a6, /*CC lut r 32 160*/
0x0023, 0x28b8, /*CC lut r 48 176*/
0x0024, 0x3ac9, /*CC lut r 64 192*/
0x0025, 0x4cd9, /*CC lut r 80 208*/
0x0026, 0x5ee7, /*CC lut r 96 224*/
0x0027, 0x70f4, /*CC lut r 112 240*/
0x0028, 0x82ff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_dynamic_ui[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00ac, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0092, 0x0020, /*DE pe*/
0x0093, 0x0020, /*DE pf*/
0x0094, 0x0020, /*DE pb*/
0x0095, 0x0020, /*DE ne*/
0x0096, 0x0020, /*DE nf*/
0x0097, 0x0020, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1a04, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x0a94, /*CC lut r 16 144*/
0x0022, 0x18a6, /*CC lut r 32 160*/
0x0023, 0x28b8, /*CC lut r 48 176*/
0x0024, 0x3ac9, /*CC lut r 64 192*/
0x0025, 0x4cd9, /*CC lut r 80 208*/
0x0026, 0x5ee7, /*CC lut r 96 224*/
0x0027, 0x70f4, /*CC lut r 112 240*/
0x0028, 0x82ff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_dynamic_video[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00ac, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0092, 0x0080, /*DE pe*/
0x0093, 0x0080, /*DE pf*/
0x0094, 0x0080, /*DE pb*/
0x0095, 0x0080, /*DE ne*/
0x0096, 0x0080, /*DE nf*/
0x0097, 0x0080, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1a04, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x0a94, /*CC lut r 16 144*/
0x0022, 0x18a6, /*CC lut r 32 160*/
0x0023, 0x28b8, /*CC lut r 48 176*/
0x0024, 0x3ac9, /*CC lut r 64 192*/
0x0025, 0x4cd9, /*CC lut r 80 208*/
0x0026, 0x5ee7, /*CC lut r 96 224*/
0x0027, 0x70f4, /*CC lut r 112 240*/
0x0028, 0x82ff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_dynamic_vt[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00ae, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0005, /*FA cs1 | de8 dnr4 hdr2 fa1*/
0x0039, 0x0080, /*FA dnrWeight*/
0x0080, 0x0fff, /*DNR dirTh*/
0x0081, 0x19ff, /*DNR dirnumTh decon7Th*/
0x0082, 0xff16, /*DNR decon5Th maskTh*/
0x0083, 0x0000, /*DNR blTh*/
0x0092, 0x00e0, /*DE pe*/
0x0093, 0x00e0, /*DE pf*/
0x0094, 0x00e0, /*DE pb*/
0x0095, 0x00e0, /*DE ne*/
0x0096, 0x00e0, /*DE nf*/
0x0097, 0x00e0, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0010, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1a04, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x0a94, /*CC lut r 16 144*/
0x0022, 0x18a6, /*CC lut r 32 160*/
0x0023, 0x28b8, /*CC lut r 48 176*/
0x0024, 0x3ac9, /*CC lut r 64 192*/
0x0025, 0x4cd9, /*CC lut r 80 208*/
0x0026, 0x5ee7, /*CC lut r 96 224*/
0x0027, 0x70f4, /*CC lut r 112 240*/
0x0028, 0x82ff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_movie_gallery[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0020, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00f0, /*SCR KgWg*/
0x00ec, 0x00e6, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_movie_ui[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0020, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00f0, /*SCR KgWg*/
0x00ec, 0x00e6, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_movie_video[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0020, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0092, 0x0000, /*DE pe*/
0x0093, 0x0000, /*DE pf*/
0x0094, 0x0000, /*DE pb*/
0x0095, 0x0000, /*DE ne*/
0x0096, 0x0000, /*DE nf*/
0x0097, 0x0000, /*DE nb*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1004, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00f0, /*SCR KgWg*/
0x00ec, 0x00e6, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0000, /*CC chsel strength*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_movie_vt[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x002e, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0005, /*FA cs1 | de8 dnr4 hdr2 fa1*/
0x0039, 0x0080, /*FA dnrWeight*/
0x0080, 0x0fff, /*DNR dirTh*/
0x0081, 0x19ff, /*DNR dirnumTh decon7Th*/
0x0082, 0xff16, /*DNR decon5Th maskTh*/
0x0083, 0x0000, /*DNR blTh*/
0x0092, 0x0040, /*DE pe*/
0x0093, 0x0040, /*DE pf*/
0x0094, 0x0040, /*DE pb*/
0x0095, 0x0040, /*DE ne*/
0x0096, 0x0040, /*DE nf*/
0x0097, 0x0040, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0010, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1204, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00f0, /*SCR KgWg*/
0x00ec, 0x00e6, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short <API key>[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00ac, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0090, 0x0080, /*DE egth*/
0x0092, 0x0000, /*DE pe*/
0x0093, 0x0080, /*DE pf*/
0x0094, 0x0080, /*DE pb*/
0x0095, 0x0080, /*DE ne*/
0x0096, 0x0080, /*DE nf*/
0x0097, 0x0080, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1404, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x179b, /*CC lut r 16 144*/
0x0022, 0x29aa, /*CC lut r 32 160*/
0x0023, 0x3bb9, /*CC lut r 48 176*/
0x0024, 0x4cc8, /*CC lut r 64 192*/
0x0025, 0x5cd6, /*CC lut r 80 208*/
0x0026, 0x6ce4, /*CC lut r 96 224*/
0x0027, 0x7cf2, /*CC lut r 112 240*/
0x0028, 0x8cff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_standard_ui[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0028, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_standard_video[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x002c, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0092, 0x0060, /*DE pe*/
0x0093, 0x0060, /*DE pf*/
0x0094, 0x0060, /*DE pb*/
0x0095, 0x0060, /*DE ne*/
0x0096, 0x0060, /*DE nf*/
0x0097, 0x0060, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0000, /*CC chsel strength*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_standard_vt[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x002e, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0005, /*FA cs1 | de8 dnr4 hdr2 fa1*/
0x0039, 0x0080, /*FA dnrWeight*/
0x0080, 0x0fff, /*DNR dirTh*/
0x0081, 0x19ff, /*DNR dirnumTh decon7Th*/
0x0082, 0xff16, /*DNR decon5Th maskTh*/
0x0083, 0x0000, /*DNR blTh*/
0x0092, 0x00c0, /*DE pe*/
0x0093, 0x00c0, /*DE pf*/
0x0094, 0x00c0, /*DE pb*/
0x0095, 0x00c0, /*DE ne*/
0x0096, 0x00c0, /*DE nf*/
0x0097, 0x00c0, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0010, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_camera[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00a8, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0090, 0x0080, /*DE egth*/
0x0092, 0x0000, /*DE pe*/
0x0093, 0x0080, /*DE pf*/
0x0094, 0x0080, /*DE pb*/
0x0095, 0x0080, /*DE ne*/
0x0096, 0x0080, /*DE nf*/
0x0097, 0x0080, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1404, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x179b, /*CC lut r 16 144*/
0x0022, 0x29aa, /*CC lut r 32 160*/
0x0023, 0x3bb9, /*CC lut r 48 176*/
0x0024, 0x4cc8, /*CC lut r 64 192*/
0x0025, 0x5cd6, /*CC lut r 80 208*/
0x0026, 0x6ce4, /*CC lut r 96 224*/
0x0027, 0x7cf2, /*CC lut r 112 240*/
0x0028, 0x8cff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short <API key>[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00a8, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1a04, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x0a94, /*CC lut r 16 144*/
0x0022, 0x18a6, /*CC lut r 32 160*/
0x0023, 0x28b8, /*CC lut r 48 176*/
0x0024, 0x3ac9, /*CC lut r 64 192*/
0x0025, 0x4cd9, /*CC lut r 80 208*/
0x0026, 0x5ee7, /*CC lut r 96 224*/
0x0027, 0x70f4, /*CC lut r 112 240*/
0x0028, 0x82ff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_dynamic_ebook[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00a8, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1a04, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x0a94, /*CC lut r 16 144*/
0x0022, 0x18a6, /*CC lut r 32 160*/
0x0023, 0x28b8, /*CC lut r 48 176*/
0x0024, 0x3ac9, /*CC lut r 64 192*/
0x0025, 0x4cd9, /*CC lut r 80 208*/
0x0026, 0x5ee7, /*CC lut r 96 224*/
0x0027, 0x70f4, /*CC lut r 112 240*/
0x0028, 0x82ff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short <API key>[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0028, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0000, /*CC chsel strength*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_standard_ebook[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0028, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0000, /*CC chsel strength*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_movie_browser[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0020, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00f0, /*SCR KgWg*/
0x00ec, 0x00e6, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_movie_ebook[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0020, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00f0, /*SCR KgWg*/
0x00ec, 0x00e6, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_auto_ui[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0028, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_auto_video[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x002c, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0092, 0x0060, /*DE pe*/
0x0093, 0x0060, /*DE pf*/
0x0094, 0x0060, /*DE pb*/
0x0095, 0x0060, /*DE ne*/
0x0096, 0x0060, /*DE nf*/
0x0097, 0x0060, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0000, /*CC chsel strength*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_auto_gallery[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00ac, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0090, 0x0080, /*DE egth*/
0x0092, 0x0000, /*DE pe*/
0x0093, 0x0080, /*DE pf*/
0x0094, 0x0080, /*DE pb*/
0x0095, 0x0080, /*DE ne*/
0x0096, 0x0080, /*DE nf*/
0x0097, 0x0080, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1404, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x179b, /*CC lut r 16 144*/
0x0022, 0x29aa, /*CC lut r 32 160*/
0x0023, 0x3bb9, /*CC lut r 48 176*/
0x0024, 0x4cc8, /*CC lut r 64 192*/
0x0025, 0x5cd6, /*CC lut r 80 208*/
0x0026, 0x6ce4, /*CC lut r 96 224*/
0x0027, 0x7cf2, /*CC lut r 112 240*/
0x0028, 0x8cff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_auto_vt[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x002e, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0005, /*FA cs1 | de8 dnr4 hdr2 fa1*/
0x0039, 0x0080, /*FA dnrWeight*/
0x0080, 0x0fff, /*DNR dirTh*/
0x0081, 0x19ff, /*DNR dirnumTh decon7Th*/
0x0082, 0xff16, /*DNR decon5Th maskTh*/
0x0083, 0x0000, /*DNR blTh*/
0x0092, 0x00c0, /*DE pe*/
0x0093, 0x00c0, /*DE pf*/
0x0094, 0x00c0, /*DE pb*/
0x0095, 0x00c0, /*DE ne*/
0x0096, 0x00c0, /*DE nf*/
0x0097, 0x00c0, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0010, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_auto_browser[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0028, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0000, /*CC chsel strength*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_auto_ebook[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x0028, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1804, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00f0, /*SCR KgWg*/
0x00ec, 0x00e6, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0000, /*CC chsel strength*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
static unsigned short tune_auto_camera[] = {
0x0000, 0x0000, /*BANK 0*/
0x0008, 0x00a8, /*Dither8 UC4 ABC2 CP1 | CC8 MCM4 SCR2 SCC1 | CS8 DE4 DNR2 HDR1*/
0x0030, 0x0000, /*FA cs1 de8 hdr2 fa1*/
0x0090, 0x0080, /*DE egth*/
0x0092, 0x0000, /*DE pe*/
0x0093, 0x0080, /*DE pf*/
0x0094, 0x0080, /*DE pb*/
0x0095, 0x0080, /*DE ne*/
0x0096, 0x0080, /*DE nf*/
0x0097, 0x0080, /*DE nb*/
0x0098, 0x1000, /*DE max ratio*/
0x0099, 0x0100, /*DE min ratio*/
0x00b0, 0x1010, /*CS hg ry*/
0x00b1, 0x1010, /*CS hg gc*/
0x00b2, 0x1010, /*CS hg bm*/
0x00b3, 0x1404, /*CS weight grayTH*/
0x00e1, 0xff00, /*SCR RrCr*/
0x00e2, 0x00ff, /*SCR RgCg*/
0x00e3, 0x00ff, /*SCR RbCb*/
0x00e4, 0x00ff, /*SCR GrMr*/
0x00e5, 0xff00, /*SCR GgMg*/
0x00e6, 0x00ff, /*SCR GbMb*/
0x00e7, 0x00ff, /*SCR BrYr*/
0x00e8, 0x00e4, /*SCR BgYg*/
0x00e9, 0xff00, /*SCR BbYb*/
0x00ea, 0x00ff, /*SCR KrWr*/
0x00eb, 0x00ff, /*SCR KgWg*/
0x00ec, 0x00ff, /*SCR KbWb*/
0x0000, 0x0001, /*BANK 1*/
0x001f, 0x0080, /*CC chsel strength*/
0x0020, 0x0000, /*CC lut r 0*/
0x0021, 0x179b, /*CC lut r 16 144*/
0x0022, 0x29aa, /*CC lut r 32 160*/
0x0023, 0x3bb9, /*CC lut r 48 176*/
0x0024, 0x4cc8, /*CC lut r 64 192*/
0x0025, 0x5cd6, /*CC lut r 80 208*/
0x0026, 0x6ce4, /*CC lut r 96 224*/
0x0027, 0x7cf2, /*CC lut r 112 240*/
0x0028, 0x8cff, /*CC lut r 128 255*/
0x00ff, 0x0000, /*Mask Release*/
END_SEQ, 0x0000
};
/* last is dummy table because MODE_MAX is different */
struct mdnie_tuning_info tuning_table[CABC_MAX][MODE_MAX][SCENARIO_MAX] = {
{
{
{"dynamic_ui", tune_dynamic_ui},
{"dynamic_video", tune_dynamic_video},
{"dynamic_video", tune_dynamic_video},
{"dynamic_video", tune_dynamic_video},
{"camera", tune_camera},
{"dynamic_ui", tune_dynamic_ui},
{"dynamic_gallery", <API key>},
{"dynamic_vt", tune_dynamic_vt},
{"dynamic_browser", <API key>},
{"dynamic_ebook", tune_dynamic_ebook},
{"email", tune_dynamic_ui}
}, {
{"standard_ui", tune_standard_ui},
{"standard_video", tune_standard_video},
{"standard_video", tune_standard_video},
{"standard_video", tune_standard_video},
{"camera", tune_camera},
{"standard_ui", tune_standard_ui},
{"standard_gallery", <API key>},
{"standard_vt", tune_standard_vt},
{"standard_browser", <API key>},
{"standard_ebook", tune_standard_ebook},
{"email", tune_standard_ui}
}, {
{"movie_ui", tune_movie_ui},
{"movie_video", tune_movie_video},
{"movie_video", tune_movie_video},
{"movie_video", tune_movie_video},
{"camera", tune_camera},
{"movie_ui", tune_movie_ui},
{"movie_gallery", tune_movie_gallery},
{"movie_vt", tune_movie_vt},
{"movie_browser", tune_movie_browser},
{"movie_ebook", tune_movie_ebook},
{"email", tune_movie_ui}
}, {
{"auto_ui", tune_auto_ui},
{"auto_video", tune_auto_video},
{"auto_video", tune_auto_video},
{"auto_video", tune_auto_video},
{"auto_camera", tune_auto_camera},
{"auto_ui", tune_auto_ui},
{"auto_gallery", tune_auto_gallery},
{"auto_vt", tune_auto_vt},
{"auto_browser", tune_auto_browser},
{"auto_ebook", tune_auto_ebook},
{"email", tune_auto_ui}
}, {
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL}
}
}
};
#endif /* __MDNIE_TABLE_H__ */ |
#ifndef _RXTXBB_REG_REG_H_
#define _RXTXBB_REG_REG_H_
#define <API key> 0x00000000
#define <API key> 0x00000000
#define <API key> 31
#define <API key> 19
#define <API key> 0xfff80000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 18
#define <API key> 17
#define <API key> 0x00060000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 16
#define <API key> 9
#define <API key> 0x0001fe00
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 8
#define <API key> 8
#define <API key> 0x00000100
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 7
#define <API key> 7
#define <API key> 0x00000080
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 6
#define <API key> 6
#define <API key> 0x00000040
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 5
#define <API key> 5
#define <API key> 0x00000020
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 4
#define <API key> 4
#define <API key> 0x00000010
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 3
#define <API key> 3
#define <API key> 0x00000008
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 2
#define <API key> 2
#define <API key> 0x00000004
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 1
#define <API key> 1
#define <API key> 0x00000002
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 0
#define <API key> 0
#define <API key> 0x00000001
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 0x00000004
#define <API key> 0x00000004
#define <API key> 31
#define <API key> 29
#define <API key> 0xe0000000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 28
#define <API key> 26
#define <API key> 0x1c000000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 25
#define <API key> 23
#define <API key> 0x03800000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 22
#define <API key> 21
#define <API key> 0x00600000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 20
#define <API key> 20
#define <API key> 0x00100000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 19
#define <API key> 19
#define <API key> 0x00080000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 18
#define <API key> 18
#define <API key> 0x00040000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 17
#define <API key> 17
#define <API key> 0x00020000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 16
#define <API key> 16
#define <API key> 0x00010000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 15
#define <API key> 15
#define <API key> 0x00008000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 14
#define <API key> 13
#define <API key> 0x00006000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 12
#define <API key> 8
#define <API key> 0x00001f00
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 7
#define <API key> 7
#define <API key> 0x00000080
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 6
#define <API key> 6
#define <API key> 0x00000040
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 5
#define <API key> 5
#define <API key> 0x00000020
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 4
#define <API key> 4
#define <API key> 0x00000010
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 3
#define <API key> 3
#define <API key> 0x00000008
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 2
#define <API key> 2
#define <API key> 0x00000004
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 1
#define <API key> 1
#define <API key> 0x00000002
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 0
#define <API key> 0
#define <API key> 0x00000001
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 0x00000008
#define <API key> 0x00000008
#define <API key> 31
#define <API key> 27
#define <API key> 0xf8000000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 26
#define <API key> 24
#define <API key> 0x07000000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 23
#define <API key> 21
#define <API key> 0x00e00000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 20
#define <API key> 18
#define <API key> 0x001c0000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 17
#define <API key> 15
#define <API key> 0x00038000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 14
#define <API key> 12
#define <API key> 0x00007000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 11
#define <API key> 9
#define <API key> 0x00000e00
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 8
#define <API key> 6
#define <API key> 0x000001c0
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 5
#define <API key> 3
#define <API key> 0x00000038
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 2
#define <API key> 0
#define <API key> 0x00000007
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 0x0000000c
#define <API key> 0x0000000c
#define <API key> 31
#define <API key> 31
#define <API key> 0x80000000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 30
#define <API key> 30
#define <API key> 0x40000000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 29
#define <API key> 25
#define <API key> 0x3e000000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 24
#define <API key> 20
#define <API key> 0x01f00000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 19
#define <API key> 15
#define <API key> 0x000f8000
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 14
#define <API key> 10
#define <API key> 0x00007c00
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 9
#define <API key> 5
#define <API key> 0x000003e0
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#define <API key> 4
#define <API key> 0
#define <API key> 0x0000001f
#define <API key>(x) (((x) & <API key>) >> <API key>)
#define <API key>(x) (((x) << <API key>) & <API key>)
#ifndef __ASSEMBLER__
typedef struct rxtxbb_reg_reg_s {
volatile unsigned int rxtxbb_rxtxbb1;
volatile unsigned int rxtxbb_rxtxbb2;
volatile unsigned int rxtxbb_rxtxbb3;
volatile unsigned int rxtxbb_rxtxbb4;
} rxtxbb_reg_reg_t;
#endif /* __ASSEMBLER__ */
#endif /* _RXTXBB_REG_H_ */ |
! { dg-do compile }
!
! PR fortran/56816
! The unfinished SELECT TYPE statement below was leading to an ICE because
! at the time the statement was rejected, the compiler tried to free
! some symbols that had already been freed with the SELECT TYPE
! namespace.
!
! Original testcase from Dominique Pelletier <dominique.pelletier@polymtl.ca>
!
module any_list_module
implicit none
private
public :: anylist, anyitem
type anylist
end type
type anyitem
class(*), allocatable :: value
end type
end module any_list_module
module my_item_list_module
use any_list_module
implicit none
type, extends (anyitem) :: myitem
end type myitem
contains
subroutine myprint (this)
class (myitem) :: this
select type ( v => this % value ! { dg-error "parse error in SELECT TYPE" }
end select ! { dg-error "Expecting END SUBROUTINE" }
end subroutine myprint
end module my_item_list_module |
MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS["STIXGeneral-bold"],{9651:[811,127,1145,35,1110],9655:[791,284,1043,70,1008],9661:[811,127,1145,35,1110],9665:[791,284,1043,35,973],9674:[795,289,790,45,745],9708:[811,127,1145,35,1110]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Bold/GeometricShapes.js"); |
import express = require("express");
import passport = require('passport');
import twitter = require('passport-twitter');
// just some test model
var User = {
findOrCreate(id:string, provider:string, callback:(err:any, user:any) => void): void {
callback(null, {username:'james'});
}
}
passport.use(new twitter.Strategy({
consumerKey: process.env.PASSPORT_<TwitterConsumerkey>,
consumerSecret: process.env.PASSPORT_<TwitterConsumerkey>,
callbackURL: process.env.PASSPORT_<TwitterConsumerkey>
},
function(accessToken:string, refreshToken:string, profile:twitter.Profile, done:(error:any, user?:any) => void) {
User.findOrCreate(profile.id, profile.provider, function(err, user) {
if (err) { return done(err); }
done(null, user);
});
})
);
passport.use(new twitter.Strategy({
consumerKey: process.env.PASSPORT_<TwitterConsumerkey>,
consumerSecret: process.env.PASSPORT_<TwitterConsumerkey>,
callbackURL: process.env.PASSPORT_<TwitterConsumerkey>,
passReqToCallback : false
},
function(accessToken:string, refreshToken:string, profile:twitter.Profile, done:(error:any, user?:any) => void) {
User.findOrCreate(profile.id, profile.provider, function(err, user) {
if (err) { return done(err); }
done(null, user);
});
})
);
passport.use(new twitter.Strategy({
consumerKey: process.env.PASSPORT_<TwitterConsumerkey>,
consumerSecret: process.env.PASSPORT_<TwitterConsumerkey>,
callbackURL: process.env.PASSPORT_<TwitterConsumerkey>,
passReqToCallback : true,
includeEmail: true
},
function(req: express.Request, accessToken:string, refreshToken:string, profile:twitter.Profile, done:(error:any, user?:any) => void) {
User.findOrCreate(profile.id, profile.provider, function(err, user) {
if (err) { return done(err); }
done(null, user);
});
})
); |
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/edac.h>
#include <linux/io.h>
#include "edac_core.h"
#include <asm-generic/<API key>.h>
#define I3200_REVISION "1.1"
#define EDAC_MOD_STR "i3200_edac"
#define <API key> 0x29f0
#define I3200_DIMMS 4
#define I3200_RANKS 8
#define <API key> 4
#define I3200_CHANNELS 2
/* Intel 3200 register addresses - device 0 function 0 - DRAM Controller */
#define I3200_MCHBAR_LOW 0x48 /* MCH Memory Mapped Register BAR */
#define I3200_MCHBAR_HIGH 0x4c
#define I3200_MCHBAR_MASK 0xfffffc000ULL /* bits 35:14 */
#define <API key> 16384
#define I3200_TOM 0xa0 /* Top of Memory (16b)
*
* 15:10 reserved
* 9:0 total populated physical memory
*/
#define I3200_TOM_MASK 0x3ff /* bits 9:0 */
#define I3200_TOM_SHIFT 26 /* 64MiB grain */
#define I3200_ERRSTS 0xc8 /* Error Status Register (16b)
*
* 15 reserved
* 14 Isochronous TBWRR Run Behind FIFO Full
* (ITCV)
* 13 Isochronous TBWRR Run Behind FIFO Put
* (ITSTV)
* 12 reserved
* 11 MCH Thermal Sensor Event
* for SMI/SCI/SERR (GTSE)
* 10 reserved
* 9 LOCK to non-DRAM Memory Flag (LCKF)
* 8 reserved
* 7 DRAM Throttle Flag (DTF)
* 6:2 reserved
* 1 Multi-bit DRAM ECC Error Flag (DMERR)
* 0 Single-bit DRAM ECC Error Flag (DSERR)
*/
#define I3200_ERRSTS_UE 0x0002
#define I3200_ERRSTS_CE 0x0001
#define I3200_ERRSTS_BITS (I3200_ERRSTS_UE | I3200_ERRSTS_CE)
/* Intel MMIO register space - device 0 function 0 - MMR space */
#define I3200_C0DRB 0x200 /* Channel 0 DRAM Rank Boundary (16b x 4)
*
* 15:10 reserved
* 9:0 Channel 0 DRAM Rank Boundary Address
*/
#define I3200_C1DRB 0x600 /* Channel 1 DRAM Rank Boundary (16b x 4) */
#define I3200_DRB_MASK 0x3ff /* bits 9:0 */
#define I3200_DRB_SHIFT 26 /* 64MiB grain */
#define I3200_C0ECCERRLOG 0x280 /* Channel 0 ECC Error Log (64b)
*
* 63:48 Error Column Address (ERRCOL)
* 47:32 Error Row Address (ERRROW)
* 31:29 Error Bank Address (ERRBANK)
* 28:27 Error Rank Address (ERRRANK)
* 26:24 reserved
* 23:16 Error Syndrome (ERRSYND)
* 15: 2 reserved
* 1 Multiple Bit Error Status (MERRSTS)
* 0 Correctable Error Status (CERRSTS)
*/
#define I3200_C1ECCERRLOG 0x680 /* Chan 1 ECC Error Log (64b) */
#define I3200_ECCERRLOG_CE 0x1
#define I3200_ECCERRLOG_UE 0x2
#define <API key> 0x18000000
#define <API key> 27
#define <API key> 0xff0000
#define <API key> 16
#define I3200_CAPID0 0xe0 /* P.95 of spec for details */
struct i3200_priv {
void __iomem *window;
};
static int nr_channels;
static int how_many_channels(struct pci_dev *pdev)
{
int n_channels;
unsigned char capid0_8b; /* 8th byte of CAPID0 */
<API key>(pdev, I3200_CAPID0 + 8, &capid0_8b);
if (capid0_8b & 0x20) { /* check DCD: Dual Channel Disable */
edac_dbg(0, "In single channel mode\n");
n_channels = 1;
} else {
edac_dbg(0, "In dual channel mode\n");
n_channels = 2;
}
if (capid0_8b & 0x10) /* check if both channels are filled */
edac_dbg(0, "2 DIMMS per channel disabled\n");
else
edac_dbg(0, "2 DIMMS per channel enabled\n");
return n_channels;
}
static unsigned long eccerrlog_syndrome(u64 log)
{
return (log & <API key>) >>
<API key>;
}
static int eccerrlog_row(int channel, u64 log)
{
u64 rank = ((log & <API key>) >>
<API key>);
return rank | (channel * <API key>);
}
enum i3200_chips {
I3200 = 0,
};
struct i3200_dev_info {
const char *ctl_name;
};
struct i3200_error_info {
u16 errsts;
u16 errsts2;
u64 eccerrlog[I3200_CHANNELS];
};
static const struct i3200_dev_info i3200_devs[] = {
[I3200] = {
.ctl_name = "i3200"
},
};
static struct pci_dev *mci_pdev;
static int i3200_registered = 1;
static void <API key>(struct mem_ctl_info *mci)
{
struct pci_dev *pdev;
pdev = to_pci_dev(mci->pdev);
/*
* Clear any error bits.
* (Yes, we really clear bits by writing 1 to them.)
*/
pci_write_bits16(pdev, I3200_ERRSTS, I3200_ERRSTS_BITS,
I3200_ERRSTS_BITS);
}
static void <API key>(struct mem_ctl_info *mci,
struct i3200_error_info *info)
{
struct pci_dev *pdev;
struct i3200_priv *priv = mci->pvt_info;
void __iomem *window = priv->window;
pdev = to_pci_dev(mci->pdev);
/*
* This is a mess because there is no atomic way to read all the
* registers at once and the registers can transition from CE being
* overwritten by UE.
*/
<API key>(pdev, I3200_ERRSTS, &info->errsts);
if (!(info->errsts & I3200_ERRSTS_BITS))
return;
info->eccerrlog[0] = readq(window + I3200_C0ECCERRLOG);
if (nr_channels == 2)
info->eccerrlog[1] = readq(window + I3200_C1ECCERRLOG);
<API key>(pdev, I3200_ERRSTS, &info->errsts2);
/*
* If the error is the same for both reads then the first set
* of reads is valid. If there is a change then there is a CE
* with no info and the second set of reads is valid and
* should be UE info.
*/
if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) {
info->eccerrlog[0] = readq(window + I3200_C0ECCERRLOG);
if (nr_channels == 2)
info->eccerrlog[1] = readq(window + I3200_C1ECCERRLOG);
}
<API key>(mci);
}
static void <API key>(struct mem_ctl_info *mci,
struct i3200_error_info *info)
{
int channel;
u64 log;
if (!(info->errsts & I3200_ERRSTS_BITS))
return;
if ((info->errsts ^ info->errsts2) & I3200_ERRSTS_BITS) {
<API key>(<API key>, mci, 1, 0, 0, 0,
-1, -1, -1, "UE overwrote CE", "");
info->errsts = info->errsts2;
}
for (channel = 0; channel < nr_channels; channel++) {
log = info->eccerrlog[channel];
if (log & I3200_ECCERRLOG_UE) {
<API key>(<API key>, mci, 1,
0, 0, 0,
eccerrlog_row(channel, log),
-1, -1,
"i3000 UE", "");
} else if (log & I3200_ECCERRLOG_CE) {
<API key>(<API key>, mci, 1,
0, 0, eccerrlog_syndrome(log),
eccerrlog_row(channel, log),
-1, -1,
"i3000 UE", "");
}
}
}
static void i3200_check(struct mem_ctl_info *mci)
{
struct i3200_error_info info;
edac_dbg(1, "MC%d\n", mci->mc_idx);
<API key>(mci, &info);
<API key>(mci, &info);
}
static void __iomem *i3200_map_mchbar(struct pci_dev *pdev)
{
union {
u64 mchbar;
struct {
u32 mchbar_low;
u32 mchbar_high;
};
} u;
void __iomem *window;
<API key>(pdev, I3200_MCHBAR_LOW, &u.mchbar_low);
<API key>(pdev, I3200_MCHBAR_HIGH, &u.mchbar_high);
u.mchbar &= I3200_MCHBAR_MASK;
if (u.mchbar != (resource_size_t)u.mchbar) {
printk(KERN_ERR
"i3200: mmio space beyond accessible range (0x%llx)\n",
(unsigned long long)u.mchbar);
return NULL;
}
window = ioremap_nocache(u.mchbar, <API key>);
if (!window)
printk(KERN_ERR "i3200: cannot map mmio space at 0x%llx\n",
(unsigned long long)u.mchbar);
return window;
}
static void i3200_get_drbs(void __iomem *window,
u16 drbs[I3200_CHANNELS][<API key>])
{
int i;
for (i = 0; i < <API key>; i++) {
drbs[0][i] = readw(window + I3200_C0DRB + 2*i) & I3200_DRB_MASK;
drbs[1][i] = readw(window + I3200_C1DRB + 2*i) & I3200_DRB_MASK;
edac_dbg(0, "drb[0][%d] = %d, drb[1][%d] = %d\n", i, drbs[0][i], i, drbs[1][i]);
}
}
static bool i3200_is_stacked(struct pci_dev *pdev,
u16 drbs[I3200_CHANNELS][<API key>])
{
u16 tom;
<API key>(pdev, I3200_TOM, &tom);
tom &= I3200_TOM_MASK;
return drbs[I3200_CHANNELS - 1][<API key> - 1] == tom;
}
static unsigned long drb_to_nr_pages(
u16 drbs[I3200_CHANNELS][<API key>], bool stacked,
int channel, int rank)
{
int n;
n = drbs[channel][rank];
if (!n)
return 0;
if (rank > 0)
n -= drbs[channel][rank - 1];
if (stacked && (channel == 1) &&
drbs[channel][rank] == drbs[channel][<API key> - 1])
n -= drbs[0][<API key> - 1];
n <<= (I3200_DRB_SHIFT - PAGE_SHIFT);
return n;
}
static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
{
int rc;
int i, j;
struct mem_ctl_info *mci = NULL;
struct edac_mc_layer layers[2];
u16 drbs[I3200_CHANNELS][<API key>];
bool stacked;
void __iomem *window;
struct i3200_priv *priv;
edac_dbg(0, "MC:\n");
window = i3200_map_mchbar(pdev);
if (!window)
return -ENODEV;
i3200_get_drbs(window, drbs);
nr_channels = how_many_channels(pdev);
layers[0].type = <API key>;
layers[0].size = I3200_DIMMS;
layers[0].is_virt_csrow = true;
layers[1].type = <API key>;
layers[1].size = nr_channels;
layers[1].is_virt_csrow = false;
mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
sizeof(struct i3200_priv));
if (!mci)
return -ENOMEM;
edac_dbg(3, "MC: init mci\n");
mci->pdev = &pdev->dev;
mci->mtype_cap = MEM_FLAG_DDR2;
mci->edac_ctl_cap = EDAC_FLAG_SECDED;
mci->edac_cap = EDAC_FLAG_SECDED;
mci->mod_name = EDAC_MOD_STR;
mci->mod_ver = I3200_REVISION;
mci->ctl_name = i3200_devs[dev_idx].ctl_name;
mci->dev_name = pci_name(pdev);
mci->edac_check = i3200_check;
mci->ctl_page_to_phys = NULL;
priv = mci->pvt_info;
priv->window = window;
stacked = i3200_is_stacked(pdev, drbs);
/*
* The dram rank boundary (DRB) reg values are boundary addresses
* for each DRAM rank with a granularity of 64MB. DRB regs are
* cumulative; the last one will contain the total memory
* contained in all ranks.
*/
for (i = 0; i < I3200_DIMMS; i++) {
unsigned long nr_pages;
for (j = 0; j < nr_channels; j++) {
struct dimm_info *dimm = EDAC_DIMM_PTR(mci->layers, mci->dimms,
mci->n_layers, i, j, 0);
nr_pages = drb_to_nr_pages(drbs, stacked, j, i);
if (nr_pages == 0)
continue;
edac_dbg(0, "csrow %d, channel %d%s, size = %ld Mb\n", i, j,
stacked ? " (stacked)" : "", PAGES_TO_MiB(nr_pages));
dimm->nr_pages = nr_pages;
dimm->grain = nr_pages << PAGE_SHIFT;
dimm->mtype = MEM_DDR2;
dimm->dtype = DEV_UNKNOWN;
dimm->edac_mode = EDAC_UNKNOWN;
}
}
<API key>(mci);
rc = -ENODEV;
if (edac_mc_add_mc(mci)) {
edac_dbg(3, "MC: failed edac_mc_add_mc()\n");
goto fail;
}
/* get this far and it's successful */
edac_dbg(3, "MC: success\n");
return 0;
fail:
iounmap(window);
if (mci)
edac_mc_free(mci);
return rc;
}
static int i3200_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
int rc;
edac_dbg(0, "MC:\n");
if (pci_enable_device(pdev) < 0)
return -EIO;
rc = i3200_probe1(pdev, ent->driver_data);
if (!mci_pdev)
mci_pdev = pci_dev_get(pdev);
return rc;
}
static void i3200_remove_one(struct pci_dev *pdev)
{
struct mem_ctl_info *mci;
struct i3200_priv *priv;
edac_dbg(0, "\n");
mci = edac_mc_del_mc(&pdev->dev);
if (!mci)
return;
priv = mci->pvt_info;
iounmap(priv->window);
edac_mc_free(mci);
}
static <API key>(i3200_pci_tbl) = {
{
PCI_VEND_DEV(INTEL, 3200_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
I3200},
{
0,
} /* 0 terminated list. */
};
MODULE_DEVICE_TABLE(pci, i3200_pci_tbl);
static struct pci_driver i3200_driver = {
.name = EDAC_MOD_STR,
.probe = i3200_init_one,
.remove = i3200_remove_one,
.id_table = i3200_pci_tbl,
};
static int __init i3200_init(void)
{
int pci_rc;
edac_dbg(3, "MC:\n");
/* Ensure that the OPSTATE is set correctly for POLL or NMI */
opstate_init();
pci_rc = pci_register_driver(&i3200_driver);
if (pci_rc < 0)
goto fail0;
if (!mci_pdev) {
i3200_registered = 0;
mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
<API key>, NULL);
if (!mci_pdev) {
edac_dbg(0, "i3200 pci_get_device fail\n");
pci_rc = -ENODEV;
goto fail1;
}
pci_rc = i3200_init_one(mci_pdev, i3200_pci_tbl);
if (pci_rc < 0) {
edac_dbg(0, "i3200 init fail\n");
pci_rc = -ENODEV;
goto fail1;
}
}
return 0;
fail1:
<API key>(&i3200_driver);
fail0:
if (mci_pdev)
pci_dev_put(mci_pdev);
return pci_rc;
}
static void __exit i3200_exit(void)
{
edac_dbg(3, "MC:\n");
<API key>(&i3200_driver);
if (!i3200_registered) {
i3200_remove_one(mci_pdev);
pci_dev_put(mci_pdev);
}
}
module_init(i3200_init);
module_exit(i3200_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Akamai Technologies, Inc.");
MODULE_DESCRIPTION("MC support for Intel 3200 memory hub controllers");
module_param(edac_op_state, int, 0444);
MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); |
struct platform_device; /* don't need the contents */
#include <linux/gpio.h>
#include <plat/iic.h>
#include <plat/gpio-cfg.h>
void s3c_i2c1_cfg_gpio(struct platform_device *dev)
{
<API key>(S5PV310_GPD1(2), 2,
S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
} |
//var Quotes = {
// SINGLE: 1,
// DOUBLE: 2
//var regex = {
// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/
CodeMirror.defineMode("gherkin", function () {
return {
startState: function () {
return {
lineNumber: 0,
tableHeaderLine: null,
allowFeature: true,
allowBackground: false,
allowScenario: false,
allowSteps: false,
allowPlaceholders: false,
inMultilineArgument: false,
inMultilineString: false,
inMultilineTable: false
};
},
token: function (stream, state) {
if (stream.sol()) {
state.lineNumber++;
}
stream.eatSpace();
// INSIDE OF MULTILINE ARGUMENTS
if (state.inMultilineArgument) {
// STRING
if (state.inMultilineString) {
// String
state.inMultilineString = true;
return "string";
} else if (stream.match("|")) {
// Table
state.inMultilineTable = true;
return "bracket";
} else {
// Or abort
state.inMultilineArgument = false;
state.tableHeaderLine = null;
}
return null;
}
// LINE COMMENT
if (stream.match(/
return "comment";
// TAG
} else if (stream.match(/@\S+/)) {
return "def";
// FEATURE
} else if (state.allowFeature && stream.match(/Feature:/)) {
state.allowScenario = true;
state.allowBackground = true;
state.allowPlaceholders = false;
state.allowSteps = false;
return "keyword";
// BACKGROUND
} else if (state.allowBackground && stream.match("Background:")) {
state.allowPlaceholders = false;
state.allowSteps = true;
state.allowBackground = false;
return "keyword";
// SCENARIO OUTLINE
} else if (state.allowScenario && stream.match("Scenario Outline:")) {
state.allowPlaceholders = true;
state.allowSteps = true;
return "keyword";
// EXAMPLES
} else if (state.allowScenario && stream.match("Examples:")) {
state.allowPlaceholders = false;
state.allowSteps = true;
state.allowBackground = false;
state.inMultilineArgument = true;
return "keyword";
// SCENARIO
} else if (state.allowScenario && stream.match(/Scenario:/)) {
state.allowPlaceholders = false;
state.allowSteps = true;
state.allowBackground = false;
return "keyword";
// STEPS
} else if (state.allowSteps && stream.match(/(Given|When|Then|And|But)/)) {
return "keyword";
// INLINE STRING
} else if (!state.inMultilineArgument && stream.match(/"/)) {
stream.match(/.*?"/);
return "string";
// MULTILINE ARGUMENTS
} else if (state.allowSteps && stream.eat(":")) {
if (stream.match(/\s*$/)) {
state.inMultilineArgument = true;
return "keyword";
} else {
return null;
}
} else if (state.allowSteps && stream.match("<")) {
if (stream.match(/.*?>/)) {
return "property";
} else {
return null;
}
// Fall through
} else {
stream.eatWhile(/[^":<]/);
}
return null;
}
};
});
CodeMirror.defineMIME("text/x-feature", "gherkin"); |
<?php
// $Id: index.php 40086 2012-03-08 15:47:37Z changi67 $
// This redirects to the sites root to prevent directory browsing
header("location: ../../../index.php");
die; |
<ul class="breadcrumbs">
<li><a href="#">Home</a></li>
<li><a href="#">Features</a></li>
<li class="unavailable"><a href="#">Gene Splicing</a></li>
<li class="current"><a href="#">Cloning</a></li>
</ul> |
<?php
namespace Codeception\PHPUnit;
use Codeception\Event\FailEvent;
use Codeception\Event\SuiteEvent;
use Codeception\Event\TestEvent;
use Codeception\Events;
use Codeception\TestInterface;
use Exception;
use <API key>;
use Symfony\Component\EventDispatcher\EventDispatcher;
class Listener implements \<API key>
{
/**
* @var \Symfony\Component\EventDispatcher\EventDispatcher
*/
protected $dispatcher;
protected $unsuccessfulTests = [];
protected $skippedTests = [];
protected $startedTests = [];
public function __construct(EventDispatcher $dispatcher)
{
$this->dispatcher = $dispatcher;
}
/**
* Risky test.
*
* @param <API key> $test
* @param Exception $e
* @param float $time
* @since Method available since Release 4.0.0
*/
public function addRiskyTest(<API key> $test, Exception $e, $time)
{
}
public function addFailure(\<API key> $test, \<API key> $e, $time)
{
$this->unsuccessfulTests[] = spl_object_hash($test);
$this->fire(Events::TEST_FAIL, new FailEvent($test, $time, $e));
}
public function addError(\<API key> $test, \Exception $e, $time)
{
$this->unsuccessfulTests[] = spl_object_hash($test);
$this->fire(Events::TEST_ERROR, new FailEvent($test, $time, $e));
}
public function addIncompleteTest(\<API key> $test, \Exception $e, $time)
{
if (in_array(spl_object_hash($test), $this->skippedTests)) {
return;
}
$this->unsuccessfulTests[] = spl_object_hash($test);
$this->fire(Events::TEST_INCOMPLETE, new FailEvent($test, $time, $e));
$this->skippedTests[] = spl_object_hash($test);
}
public function addSkippedTest(\<API key> $test, \Exception $e, $time)
{
if (in_array(spl_object_hash($test), $this->skippedTests)) {
return;
}
$this->unsuccessfulTests[] = spl_object_hash($test);
$this->fire(Events::TEST_SKIPPED, new FailEvent($test, $time, $e));
$this->skippedTests[] = spl_object_hash($test);
}
public function startTestSuite(\<API key> $suite)
{
$this->dispatcher->dispatch('suite.start', new SuiteEvent($suite));
}
public function endTestSuite(\<API key> $suite)
{
$this->dispatcher->dispatch('suite.end', new SuiteEvent($suite));
}
public function startTest(\<API key> $test)
{
$this->dispatcher->dispatch(Events::TEST_START, new TestEvent($test));
if (!$test instanceof TestInterface) {
return;
}
if ($test->getMetadata()->isBlocked()) {
return;
}
try {
$this->startedTests[] = spl_object_hash($test);
$this->fire(Events::TEST_BEFORE, new TestEvent($test));
} catch (\<API key> $e) {
$test->getTestResultObject()->addFailure($test, $e, 0);
} catch (\<API key> $e) {
$test->getTestResultObject()->addFailure($test, $e, 0);
}
}
public function endTest(\<API key> $test, $time)
{
$hash = spl_object_hash($test);
if (!in_array($hash, $this->unsuccessfulTests)) {
$this->fire(Events::TEST_SUCCESS, new TestEvent($test, $time));
}
if (in_array($hash, $this->startedTests)) {
$this->fire(Events::TEST_AFTER, new TestEvent($test, $time));
}
$this->dispatcher->dispatch(Events::TEST_END, new TestEvent($test, $time));
}
protected function fire($event, TestEvent $eventType)
{
$test = $eventType->getTest();
if ($test instanceof TestInterface) {
foreach ($test->getMetadata()->getGroups() as $group) {
$this->dispatcher->dispatch($event . '.' . $group, $eventType);
}
}
$this->dispatcher->dispatch($event, $eventType);
}
} |
#ifndef _LINUX_ERRQUEUE_H
#define _LINUX_ERRQUEUE_H 1
struct sock_extended_err
{
__u32 ee_errno;
__u8 ee_origin;
__u8 ee_type;
__u8 ee_code;
__u8 ee_pad;
__u32 ee_info;
__u32 ee_data;
};
#define SO_EE_ORIGIN_NONE 0
#define SO_EE_ORIGIN_LOCAL 1
#define SO_EE_ORIGIN_ICMP 2
#define SO_EE_ORIGIN_ICMP6 3
#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
#ifdef __KERNEL__
#include <net/ip.h>
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
#include <linux/ipv6.h>
#endif
#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
struct sock_exterr_skb
{
union {
struct inet_skb_parm h4;
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
struct inet6_skb_parm h6;
#endif
} header;
struct sock_extended_err ee;
u16 addr_offset;
__be16 port;
};
#endif
#endif |
#ifndef __ASM_EMEV2_H__
#define __ASM_EMEV2_H__
extern void emev2_map_io(void);
extern void emev2_init_delay(void);
extern void <API key>(void);
extern void emev2_clock_init(void);
#define EMEV2_GPIO_BASE 200
#define EMEV2_GPIO_IRQ(n) (EMEV2_GPIO_BASE + (n))
extern struct smp_operations emev2_smp_ops;
#endif /* __ASM_EMEV2_H__ */ |
#ifndef EXYNOS_REGS_FIMC_H
#define EXYNOS_REGS_FIMC_H
/*
* Register part
*/
/* Input source format */
#define EXYNOS_CISRCFMT (0x00)
/* Window offset */
#define EXYNOS_CIWDOFST (0x04)
/* Global control */
#define EXYNOS_CIGCTRL (0x08)
/* Window offset 2 */
#define EXYNOS_CIWDOFST2 (0x14)
/* Y 1st frame start address for output DMA */
#define EXYNOS_CIOYSA1 (0x18)
/* Y 2nd frame start address for output DMA */
#define EXYNOS_CIOYSA2 (0x1c)
/* Y 3rd frame start address for output DMA */
#define EXYNOS_CIOYSA3 (0x20)
/* Y 4th frame start address for output DMA */
#define EXYNOS_CIOYSA4 (0x24)
/* Cb 1st frame start address for output DMA */
#define EXYNOS_CIOCBSA1 (0x28)
/* Cb 2nd frame start address for output DMA */
#define EXYNOS_CIOCBSA2 (0x2c)
/* Cb 3rd frame start address for output DMA */
#define EXYNOS_CIOCBSA3 (0x30)
/* Cb 4th frame start address for output DMA */
#define EXYNOS_CIOCBSA4 (0x34)
/* Cr 1st frame start address for output DMA */
#define EXYNOS_CIOCRSA1 (0x38)
/* Cr 2nd frame start address for output DMA */
#define EXYNOS_CIOCRSA2 (0x3c)
/* Cr 3rd frame start address for output DMA */
#define EXYNOS_CIOCRSA3 (0x40)
/* Cr 4th frame start address for output DMA */
#define EXYNOS_CIOCRSA4 (0x44)
/* Target image format */
#define EXYNOS_CITRGFMT (0x48)
/* Output DMA control */
#define EXYNOS_CIOCTRL (0x4c)
/* Pre-scaler control 1 */
#define EXYNOS_CISCPRERATIO (0x50)
/* Pre-scaler control 2 */
#define EXYNOS_CISCPREDST (0x54)
/* Main scaler control */
#define EXYNOS_CISCCTRL (0x58)
/* Target area */
#define EXYNOS_CITAREA (0x5c)
/* Status */
#define EXYNOS_CISTATUS (0x64)
/* Status2 */
#define EXYNOS_CISTATUS2 (0x68)
/* Image capture enable command */
#define EXYNOS_CIIMGCPT (0xc0)
/* Capture sequence */
#define EXYNOS_CICPTSEQ (0xc4)
/* Image effects */
#define EXYNOS_CIIMGEFF (0xd0)
/* Y frame start address for input DMA */
#define EXYNOS_CIIYSA0 (0xd4)
/* Cb frame start address for input DMA */
#define EXYNOS_CIICBSA0 (0xd8)
/* Cr frame start address for input DMA */
#define EXYNOS_CIICRSA0 (0xdc)
/* Input DMA Y Line Skip */
#define <API key> (0xec)
/* Input DMA Cb Line Skip */
#define <API key> (0xf0)
/* Input DMA Cr Line Skip */
#define <API key> (0xf4)
/* Real input DMA image size */
#define EXYNOS_CIREAL_ISIZE (0xf8)
/* Input DMA control */
#define EXYNOS_MSCTRL (0xfc)
/* Y frame start address for input DMA */
#define EXYNOS_CIIYSA1 (0x144)
/* Cb frame start address for input DMA */
#define EXYNOS_CIICBSA1 (0x148)
/* Cr frame start address for input DMA */
#define EXYNOS_CIICRSA1 (0x14c)
/* Output DMA Y offset */
#define EXYNOS_CIOYOFF (0x168)
/* Output DMA CB offset */
#define EXYNOS_CIOCBOFF (0x16c)
/* Output DMA CR offset */
#define EXYNOS_CIOCROFF (0x170)
/* Input DMA Y offset */
#define EXYNOS_CIIYOFF (0x174)
/* Input DMA CB offset */
#define EXYNOS_CIICBOFF (0x178)
/* Input DMA CR offset */
#define EXYNOS_CIICROFF (0x17c)
/* Input DMA original image size */
#define EXYNOS_ORGISIZE (0x180)
/* Output DMA original image size */
#define EXYNOS_ORGOSIZE (0x184)
/* Real output DMA image size */
#define EXYNOS_CIEXTEN (0x188)
/* DMA parameter */
#define EXYNOS_CIDMAPARAM (0x18c)
/* MIPI CSI image format */
#define EXYNOS_CSIIMGFMT (0x194)
/* FIMC Clock Source Select */
#define EXYNOS_MISC_FIMC (0x198)
/* Add for FIMC v5.1 */
/* Output Frame Buffer Sequence */
#define EXYNOS_CIFCNTSEQ (0x1fc)
/* Y 5th frame start address for output DMA */
#define EXYNOS_CIOYSA5 (0x200)
/* Y 6th frame start address for output DMA */
#define EXYNOS_CIOYSA6 (0x204)
/* Y 7th frame start address for output DMA */
#define EXYNOS_CIOYSA7 (0x208)
/* Y 8th frame start address for output DMA */
#define EXYNOS_CIOYSA8 (0x20c)
/* Y 9th frame start address for output DMA */
#define EXYNOS_CIOYSA9 (0x210)
/* Y 10th frame start address for output DMA */
#define EXYNOS_CIOYSA10 (0x214)
/* Y 11th frame start address for output DMA */
#define EXYNOS_CIOYSA11 (0x218)
/* Y 12th frame start address for output DMA */
#define EXYNOS_CIOYSA12 (0x21c)
/* Y 13th frame start address for output DMA */
#define EXYNOS_CIOYSA13 (0x220)
/* Y 14th frame start address for output DMA */
#define EXYNOS_CIOYSA14 (0x224)
/* Y 15th frame start address for output DMA */
#define EXYNOS_CIOYSA15 (0x228)
/* Y 16th frame start address for output DMA */
#define EXYNOS_CIOYSA16 (0x22c)
/* Y 17th frame start address for output DMA */
#define EXYNOS_CIOYSA17 (0x230)
/* Y 18th frame start address for output DMA */
#define EXYNOS_CIOYSA18 (0x234)
/* Y 19th frame start address for output DMA */
#define EXYNOS_CIOYSA19 (0x238)
/* Y 20th frame start address for output DMA */
#define EXYNOS_CIOYSA20 (0x23c)
/* Y 21th frame start address for output DMA */
#define EXYNOS_CIOYSA21 (0x240)
/* Y 22th frame start address for output DMA */
#define EXYNOS_CIOYSA22 (0x244)
/* Y 23th frame start address for output DMA */
#define EXYNOS_CIOYSA23 (0x248)
/* Y 24th frame start address for output DMA */
#define EXYNOS_CIOYSA24 (0x24c)
/* Y 25th frame start address for output DMA */
#define EXYNOS_CIOYSA25 (0x250)
/* Y 26th frame start address for output DMA */
#define EXYNOS_CIOYSA26 (0x254)
/* Y 27th frame start address for output DMA */
#define EXYNOS_CIOYSA27 (0x258)
/* Y 28th frame start address for output DMA */
#define EXYNOS_CIOYSA28 (0x25c)
/* Y 29th frame start address for output DMA */
#define EXYNOS_CIOYSA29 (0x260)
/* Y 30th frame start address for output DMA */
#define EXYNOS_CIOYSA30 (0x264)
/* Y 31th frame start address for output DMA */
#define EXYNOS_CIOYSA31 (0x268)
/* Y 32th frame start address for output DMA */
#define EXYNOS_CIOYSA32 (0x26c)
/* CB 5th frame start address for output DMA */
#define EXYNOS_CIOCBSA5 (0x270)
/* CB 6th frame start address for output DMA */
#define EXYNOS_CIOCBSA6 (0x274)
/* CB 7th frame start address for output DMA */
#define EXYNOS_CIOCBSA7 (0x278)
/* CB 8th frame start address for output DMA */
#define EXYNOS_CIOCBSA8 (0x27c)
/* CB 9th frame start address for output DMA */
#define EXYNOS_CIOCBSA9 (0x280)
/* CB 10th frame start address for output DMA */
#define EXYNOS_CIOCBSA10 (0x284)
/* CB 11th frame start address for output DMA */
#define EXYNOS_CIOCBSA11 (0x288)
/* CB 12th frame start address for output DMA */
#define EXYNOS_CIOCBSA12 (0x28c)
/* CB 13th frame start address for output DMA */
#define EXYNOS_CIOCBSA13 (0x290)
/* CB 14th frame start address for output DMA */
#define EXYNOS_CIOCBSA14 (0x294)
/* CB 15th frame start address for output DMA */
#define EXYNOS_CIOCBSA15 (0x298)
/* CB 16th frame start address for output DMA */
#define EXYNOS_CIOCBSA16 (0x29c)
/* CB 17th frame start address for output DMA */
#define EXYNOS_CIOCBSA17 (0x2a0)
/* CB 18th frame start address for output DMA */
#define EXYNOS_CIOCBSA18 (0x2a4)
/* CB 19th frame start address for output DMA */
#define EXYNOS_CIOCBSA19 (0x2a8)
/* CB 20th frame start address for output DMA */
#define EXYNOS_CIOCBSA20 (0x2ac)
/* CB 21th frame start address for output DMA */
#define EXYNOS_CIOCBSA21 (0x2b0)
/* CB 22th frame start address for output DMA */
#define EXYNOS_CIOCBSA22 (0x2b4)
/* CB 23th frame start address for output DMA */
#define EXYNOS_CIOCBSA23 (0x2b8)
/* CB 24th frame start address for output DMA */
#define EXYNOS_CIOCBSA24 (0x2bc)
/* CB 25th frame start address for output DMA */
#define EXYNOS_CIOCBSA25 (0x2c0)
/* CB 26th frame start address for output DMA */
#define EXYNOS_CIOCBSA26 (0x2c4)
/* CB 27th frame start address for output DMA */
#define EXYNOS_CIOCBSA27 (0x2c8)
/* CB 28th frame start address for output DMA */
#define EXYNOS_CIOCBSA28 (0x2cc)
/* CB 29th frame start address for output DMA */
#define EXYNOS_CIOCBSA29 (0x2d0)
/* CB 30th frame start address for output DMA */
#define EXYNOS_CIOCBSA30 (0x2d4)
/* CB 31th frame start address for output DMA */
#define EXYNOS_CIOCBSA31 (0x2d8)
/* CB 32th frame start address for output DMA */
#define EXYNOS_CIOCBSA32 (0x2dc)
/* CR 5th frame start address for output DMA */
#define EXYNOS_CIOCRSA5 (0x2e0)
/* CR 6th frame start address for output DMA */
#define EXYNOS_CIOCRSA6 (0x2e4)
/* CR 7th frame start address for output DMA */
#define EXYNOS_CIOCRSA7 (0x2e8)
/* CR 8th frame start address for output DMA */
#define EXYNOS_CIOCRSA8 (0x2ec)
/* CR 9th frame start address for output DMA */
#define EXYNOS_CIOCRSA9 (0x2f0)
/* CR 10th frame start address for output DMA */
#define EXYNOS_CIOCRSA10 (0x2f4)
/* CR 11th frame start address for output DMA */
#define EXYNOS_CIOCRSA11 (0x2f8)
/* CR 12th frame start address for output DMA */
#define EXYNOS_CIOCRSA12 (0x2fc)
/* CR 13th frame start address for output DMA */
#define EXYNOS_CIOCRSA13 (0x300)
/* CR 14th frame start address for output DMA */
#define EXYNOS_CIOCRSA14 (0x304)
/* CR 15th frame start address for output DMA */
#define EXYNOS_CIOCRSA15 (0x308)
/* CR 16th frame start address for output DMA */
#define EXYNOS_CIOCRSA16 (0x30c)
/* CR 17th frame start address for output DMA */
#define EXYNOS_CIOCRSA17 (0x310)
/* CR 18th frame start address for output DMA */
#define EXYNOS_CIOCRSA18 (0x314)
/* CR 19th frame start address for output DMA */
#define EXYNOS_CIOCRSA19 (0x318)
/* CR 20th frame start address for output DMA */
#define EXYNOS_CIOCRSA20 (0x31c)
/* CR 21th frame start address for output DMA */
#define EXYNOS_CIOCRSA21 (0x320)
/* CR 22th frame start address for output DMA */
#define EXYNOS_CIOCRSA22 (0x324)
/* CR 23th frame start address for output DMA */
#define EXYNOS_CIOCRSA23 (0x328)
/* CR 24th frame start address for output DMA */
#define EXYNOS_CIOCRSA24 (0x32c)
/* CR 25th frame start address for output DMA */
#define EXYNOS_CIOCRSA25 (0x330)
/* CR 26th frame start address for output DMA */
#define EXYNOS_CIOCRSA26 (0x334)
/* CR 27th frame start address for output DMA */
#define EXYNOS_CIOCRSA27 (0x338)
/* CR 28th frame start address for output DMA */
#define EXYNOS_CIOCRSA28 (0x33c)
/* CR 29th frame start address for output DMA */
#define EXYNOS_CIOCRSA29 (0x340)
/* CR 30th frame start address for output DMA */
#define EXYNOS_CIOCRSA30 (0x344)
/* CR 31th frame start address for output DMA */
#define EXYNOS_CIOCRSA31 (0x348)
/* CR 32th frame start address for output DMA */
#define EXYNOS_CIOCRSA32 (0x34c)
/*
* Macro part
*/
/* frame start address 1 ~ 4, 5 ~ 32 */
/* Number of Default PingPong Memory */
#define DEF_PP 4
#define EXYNOS_CIOYSA(__x) \
(((__x) < DEF_PP) ? \
(EXYNOS_CIOYSA1 + (__x) * 4) : \
(EXYNOS_CIOYSA5 + ((__x) - DEF_PP) * 4))
#define EXYNOS_CIOCBSA(__x) \
(((__x) < DEF_PP) ? \
(EXYNOS_CIOCBSA1 + (__x) * 4) : \
(EXYNOS_CIOCBSA5 + ((__x) - DEF_PP) * 4))
#define EXYNOS_CIOCRSA(__x) \
(((__x) < DEF_PP) ? \
(EXYNOS_CIOCRSA1 + (__x) * 4) : \
(EXYNOS_CIOCRSA5 + ((__x) - DEF_PP) * 4))
/* Number of Default PingPong Memory */
#define DEF_IPP 1
#define EXYNOS_CIIYSA(__x) \
(((__x) < DEF_IPP) ? \
(EXYNOS_CIIYSA0) : (EXYNOS_CIIYSA1))
#define EXYNOS_CIICBSA(__x) \
(((__x) < DEF_IPP) ? \
(EXYNOS_CIICBSA0) : (EXYNOS_CIICBSA1))
#define EXYNOS_CIICRSA(__x) \
(((__x) < DEF_IPP) ? \
(EXYNOS_CIICRSA0) : (EXYNOS_CIICRSA1))
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) (((x) & 0x1fff) << 16)
#define <API key>(x) (((x) & 0x1fff) << 0)
#define <API key>(x) ((x) << 28)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 0)
#define <API key>(x) (((x) >> 26) & 0x3)
#define <API key>(x) (((x) >> 17) & 0x1)
#define <API key>(x) (((x) >> 16) & 0x1)
#define <API key>(x) (((x) >> 9) & 0x1)
#define <API key>(x) (((x) >> 8) & 0x1)
#define <API key>(x) (((x) >> 7) & 0x3f)
#define <API key>(x) ((x) & 0x3f)
#define EXYNOS_CIIMGEFF_FIN(x) ((x & 0x7) << 26)
#define <API key>(x) ((x) << 13)
#define <API key>(x) ((x) << 0)
#define EXYNOS_CIILINESKIP(x) (((x) & 0xf) << 24)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 24)
#define <API key>(x) ((x) & 0x1)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((x) << 16)
#define <API key>(x) ((x) << 0)
#define <API key>(x) ((((x) & 0x2000) >> 13) << 26)
#define <API key>(x) ((((x) & 0x2000) >> 13) << 24)
#define <API key>(x) (((x) & 0x3F) << 10)
#define <API key>(x) ((x) & 0x3F)
/*
* Bit definition part
*/
/* Source format register */
#define <API key> (1 << 31)
#define <API key> (0 << 31)
#define <API key> (1 << 29)
#define <API key> (0 << 14)
#define <API key> (1 << 14)
#define <API key> (2 << 14)
#define <API key> (3 << 14)
/* ITU601 16bit only */
#define <API key> (0 << 14)
/* ITU601 16bit only */
#define <API key> (1 << 14)
/* Window offset register */
#define <API key> (1 << 31)
#define <API key> (1 << 30)
#define <API key> (1 << 29)
#define <API key> (0x7ff << 16)
#define <API key> (1 << 15)
#define <API key> (1 << 14)
#define <API key> (0xfff << 0)
/* Global control register */
#define <API key> (1 << 31)
#define <API key> (1 << 30)
#define <API key> (0 << 29)
#define <API key> (1 << 29)
#define <API key> (1 << 29)
#define <API key> (0 << 27)
#define <API key> (1 << 27)
#define <API key> (2 << 27)
#define <API key> (3 << 27)
#define <API key> (3 << 27)
#define <API key> (27)
#define <API key> (1 << 26)
#define <API key> (1 << 25)
#define <API key> (1 << 24)
#define <API key> (1 << 22)
#define <API key> (1 << 21)
#define <API key> (0 << 20)
#define <API key> (1 << 20)
#define <API key> (1 << 19)
#define <API key> (1 << 18)
#define <API key> (0 << 16)
#define <API key> (1 << 16)
#define <API key> (1 << 12)
#define <API key> (1 << 8)
#define <API key> (0 << 7)
#define <API key> (1 << 7)
#define <API key> (1 << 7)
#define <API key> (0 << 6)
#define <API key> (1 << 6)
#define <API key> (1 << 10)
#define <API key> (1 << 10)
#define <API key> (0 << 10)
#define <API key> (1 << 6)
#define <API key> (0 << 5)
#define <API key> (1 << 5)
#define <API key> (1 << 5)
#define <API key> (1 << 4)
#define <API key> (0 << 3)
#define <API key> (1 << 3)
#define <API key> (1 << 3)
#define <API key> (0 << 0)
#define <API key> (1 << 0)
/* Window offset2 register */
#define <API key> (0xfff << 16)
#define <API key> (0xfff << 16)
/* Target format register */
#define <API key> (1 << 31)
#define <API key> (0 << 29)
#define <API key> (1 << 29)
#define <API key> (2 << 29)
#define <API key> (3 << 29)
#define <API key> (3 << 29)
#define <API key> (14)
#define <API key> (0 << 14)
#define <API key> (1 << 14)
#define <API key> (2 << 14)
#define <API key> (3 << 14)
#define <API key> (3 << 14)
#define <API key> (1 << 13)
#define <API key> (0x1fff << 0)
#define <API key> (0x1fff << 16)
/* Output DMA control register */
#define <API key> (1 << 31)
#define <API key> (1 << 31)
#define <API key> (1 << 30)
#define <API key> (0 << 24)
#define <API key> (1 << 24)
#define <API key> (2 << 24)
#define <API key> (3 << 24)
#define <API key> (24)
#define <API key> (3 << 24)
#define <API key> (0 << 3)
#define <API key> (1 << 3)
#define <API key> (1 << 3)
#define <API key> (1 << 2)
#define <API key> (0xff << 4)
#define <API key> (0 << 0)
#define <API key> (1 << 0)
#define <API key> (2 << 0)
#define <API key> (3 << 0)
#define <API key> (3 << 0)
/* Main scaler control register */
#define <API key> (1 << 31)
#define <API key> (1 << 30)
#define <API key> (1 << 29)
#define <API key> (0 << 28)
#define <API key> (1 << 28)
#define <API key> (0 << 27)
#define <API key> (1 << 27)
#define <API key> (1 << 26)
#define <API key> (0 << 25)
#define <API key> (1 << 25)
#define <API key> (1 << 25)
#define <API key> (1 << 15)
#define <API key> (0 << 13)
#define <API key> (1 << 13)
#define <API key> (2 << 13)
#define <API key> (3 << 13)
#define <API key> (0 << 11)
#define <API key> (1 << 11)
#define <API key> (2 << 11)
#define <API key> (3 << 11)
#define <API key> (0 << 10)
#define <API key> (1 << 10)
#define <API key> (1 << 9)
#define <API key> (0x1ff << 0)
#define <API key> (0x1ff << 16)
/* Status register */
#define <API key> (1 << 31)
#define <API key> (1 << 30)
#define <API key> (1 << 29)
#define <API key> (1 << 28)
#define <API key> (1 << 26)
#define <API key> (1 << 25)
#define <API key> (1 << 22)
#define <API key> (1 << 21)
#define <API key> (1 << 20)
#define <API key> (1 << 19)
#define <API key> (1 << 18)
#define <API key> (1 << 17)
#define <API key> (1 << 16)
#define <API key> (1 << 15)
#define <API key> (1 << 14)
/* Image capture enable register */
#define <API key> (1 << 31)
#define <API key> (1 << 30)
#define <API key> (1 << 25)
#define <API key> (0 << 18)
#define <API key> (1 << 18)
/* Image effects register */
#define <API key> (0 << 30)
#define <API key> (1 << 30)
#define <API key> (0 << 29)
#define <API key> (1 << 29)
#define <API key> (0 << 26)
#define <API key> (1 << 26)
#define <API key> (2 << 26)
#define <API key> (3 << 26)
#define <API key> (4 << 26)
#define <API key> (5 << 26)
#define <API key> (7 << 26)
#define <API key> ((0xff < 13) | (0xff < 0))
/* Real input DMA size register */
#define <API key> (1 << 31)
#define <API key> (1 << 30)
#define <API key> (0x3FFF << 16)
#define <API key> (0x3FFF << 0)
/* Input DMA control register */
#define <API key> (1 << 31)
#define <API key> (1 << 31)
#define <API key> (0 << 31)
#define <API key> (24)
#define <API key> (0xf << 24)
#define <API key> (0 << 16)
#define <API key> (1 << 16)
#define <API key> (2 << 16)
#define <API key> (3 << 16)
#define <API key> (16)
#define <API key> (0x3 << 16)
#define <API key> (0 << 15)
#define <API key> (1 << 15)
#define <API key> (13)
#define <API key> (0 << 13)
#define <API key> (1 << 13)
#define <API key> (2 << 13)
#define <API key> (3 << 13)
#define <API key> (3 << 13)
#define <API key> (0 << 4)
#define <API key> (1 << 4)
#define <API key> (2 << 4)
#define <API key> (3 << 4)
#define <API key> (0 << 3)
#define <API key> (1 << 3)
#define <API key> (1 << 3)
#define <API key> (0 << 1)
#define <API key> (1 << 1)
#define <API key> (2 << 1)
#define <API key> (3 << 1)
#define EXYNOS_MSCTRL_ENVID (1 << 0)
/* DMA parameter register */
#define <API key> (0 << 29)
#define <API key> (1 << 29)
#define <API key> (2 << 29)
#define <API key> (3 << 29)
#define <API key> (3 << 29)
#define <API key> (0 << 24)
#define <API key> (1 << 24)
#define <API key> (2 << 24)
#define <API key> (3 << 24)
#define <API key> (4 << 24)
#define <API key> (5 << 24)
#define <API key> (6 << 24)
#define <API key> (0 << 20)
#define <API key> (1 << 20)
#define <API key> (2 << 20)
#define <API key> (3 << 20)
#define <API key> (4 << 20)
#define <API key> (5 << 20)
#define <API key> (0 << 13)
#define <API key> (1 << 13)
#define <API key> (2 << 13)
#define <API key> (3 << 13)
#define <API key> (3 << 13)
#define <API key> (0 << 8)
#define <API key> (1 << 8)
#define <API key> (2 << 8)
#define <API key> (3 << 8)
#define <API key> (4 << 8)
#define <API key> (5 << 8)
#define <API key> (6 << 8)
#define <API key> (0 << 4)
#define <API key> (1 << 4)
#define <API key> (2 << 4)
#define <API key> (3 << 4)
#define <API key> (4 << 4)
#define <API key> (5 << 4)
/* Gathering Extension register */
#define <API key> (1 << 26)
#define <API key> (1 << 24)
#define <API key> (0x3F << 10)
#define <API key> (0x3F)
#define <API key> (1 << 22)
/* FIMC Clock Source Select register */
#define EXYNOS_CLKSRC_HCLK (0 << 1)
#define <API key> (1 << 1)
#define EXYNOS_CLKSRC_SCLK (1 << 1)
/* SYSREG for FIMC writeback */
#define SYSREG_CAMERA_BLK (S3C_VA_SYS + 0x0218)
#define SYSREG_ISP_BLK (S3C_VA_SYS + 0x020c)
#define <API key> (0x3 << 23)
#define <API key> 23
#endif /* EXYNOS_REGS_FIMC_H */ |
using System;
using System.Linq;
using System.Text.RegularExpressions;
using Orchard.Forms.Services;
using Orchard.Localization;
namespace Orchard.Projections.FilterEditors.Forms {
public class <API key> : FormHandler {
public Localizer T { get; set; }
private static readonly Regex _dateRegEx = new Regex(@"(\d{1,4}(\-\d{1,2}(\-\d{1,2}\s*(\d{1,2}(:\d{1,2}(:\d{1,2})?)?)?)?)?)|(\{.*\})");
public override void Validating(ValidatingContext context) {
if (context.FormName == DateTimeFilterForm.FormName) {
var isRange = new[] {"Between", "NotBetween"}.Contains(context.ValueProvider.GetValue("Operator").AttemptedValue);
var min = context.ValueProvider.GetValue("Min");
var max = context.ValueProvider.GetValue("Max");
var value = context.ValueProvider.GetValue("Value");
var valueType = context.ValueProvider.GetValue("ValueType");
// validating mandatory values
if (isRange) {
if (min == null || String.IsNullOrWhiteSpace(min.AttemptedValue)) {
context.ModelState.AddModelError("Min", T("The field {0} is required.", T("Min").Text).Text);
}
if (max == null || String.IsNullOrWhiteSpace(max.AttemptedValue)) {
context.ModelState.AddModelError("Max", T("The field {0} is required.", T("Max").Text).Text);
}
}
else {
if (min == null || String.IsNullOrWhiteSpace(value.AttemptedValue)) {
context.ModelState.AddModelError("Value", T("The field {0} is required.", T("Value").Text).Text);
}
}
if (!context.ModelState.IsValid) {
return;
}
// validating data type
if (valueType.AttemptedValue == "0") {
// A date
if(isRange) {
if(!_dateRegEx.IsMatch(min.AttemptedValue) && !IsToken(min.AttemptedValue)) {
context.ModelState.AddModelError("Min", T("The field {0} should contain a valid date (YYYY-MM-DD hh:mm:ss)", T("Min").Text).Text);
}
if (!_dateRegEx.IsMatch(max.AttemptedValue) && !IsToken(max.AttemptedValue)) {
context.ModelState.AddModelError("Max", T("The field {0} should contain a valid date (YYYY-MM-DD hh:mm:ss)", T("Max").Text).Text);
}
}
else {
if (!_dateRegEx.IsMatch(value.AttemptedValue) && !IsToken(value.AttemptedValue)) {
context.ModelState.AddModelError("Value", T("The field {0} should contain a valid date (YYYY-MM-DD hh:mm:ss)", T("Value").Text).Text);
}
}
}
else {
// An offset
int number;
if (isRange) {
if (!Int32.TryParse(min.AttemptedValue, out number) && !IsToken(min.AttemptedValue)) {
context.ModelState.AddModelError("Min", T("The field {0} must be a valid number.", T("Min").Text).Text);
}
if (!Int32.TryParse(max.AttemptedValue, out number) && !IsToken(max.AttemptedValue)) {
context.ModelState.AddModelError("Max", T("The field {0} must be a valid number.", T("Max").Text).Text);
}
}
else {
if (!Int32.TryParse(value.AttemptedValue, out number) && !IsToken(value.AttemptedValue)) {
context.ModelState.AddModelError("Value", T("The field {0} must be a valid number.", T("Value").Text).Text);
}
}
}
}
}
private bool IsToken(string value) {
return value.StartsWith("{") && value.EndsWith("}");
}
}
} |
named path (quater) |
import identity from './identity.js';
import metaMap from './_metaMap.js';
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
export default baseSetData; |
<?php
// No direct access.
defined('_JEXEC') or die;
$fieldSets = $this->form->getFieldsets('params');
foreach ($fieldSets as $name => $fieldSet) :
$label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_PLUGINS_'.$name.'_FIELDSET_LABEL';
echo JHtml::_('sliders.panel', JText::_($label), $name.'-options');
if (isset($fieldSet->description) && trim($fieldSet->description)) :
echo '<p class="tip">'.$this->escape(JText::_($fieldSet->description)).'</p>';
endif;
?>
<fieldset class="panelform">
<legend class="element-invisible"><?php echo JText::_($label) ?></legend>
<?php $hidden_fields = ''; ?>
<ul class="adminformlist">
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<?php if (!$field->hidden) : ?>
<li>
<?php echo $field->label; ?>
<?php echo $field->input; ?>
</li>
<?php else : $hidden_fields.= $field->input; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php echo $hidden_fields; ?>
</fieldset>
<?php endforeach; ?> |
.tree {
margin: 0;
padding: 0;
list-style-type: none;
}
.tree li {
white-space: nowrap;
}
.tree li ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.tree-node {
height: 18px;
white-space: nowrap;
cursor: pointer;
}
.tree-hit {
cursor: pointer;
}
.tree-expanded,
.tree-collapsed,
.tree-folder,
.tree-file,
.tree-checkbox,
.tree-indent {
display: inline-block;
width: 16px;
height: 18px;
vertical-align: top;
overflow: hidden;
}
.tree-expanded {
background: url('images/tree_icons.png') no-repeat -18px 0px;
}
.tree-expanded-hover {
background: url('images/tree_icons.png') no-repeat -50px 0px;
}
.tree-collapsed {
background: url('images/tree_icons.png') no-repeat 0px 0px;
}
.<API key> {
background: url('images/tree_icons.png') no-repeat -32px 0px;
}
.tree-lines .tree-expanded,
.tree-lines .tree-root-first .tree-expanded {
background: url('images/tree_icons.png') no-repeat -144px 0;
}
.tree-lines .tree-collapsed,
.tree-lines .tree-root-first .tree-collapsed {
background: url('images/tree_icons.png') no-repeat -128px 0;
}
.tree-lines .tree-node-last .tree-expanded,
.tree-lines .tree-root-one .tree-expanded {
background: url('images/tree_icons.png') no-repeat -80px 0;
}
.tree-lines .tree-node-last .tree-collapsed,
.tree-lines .tree-root-one .tree-collapsed {
background: url('images/tree_icons.png') no-repeat -64px 0;
}
.tree-line {
background: url('images/tree_icons.png') no-repeat -176px 0;
}
.tree-join {
background: url('images/tree_icons.png') no-repeat -192px 0;
}
.tree-joinbottom {
background: url('images/tree_icons.png') no-repeat -160px 0;
}
.tree-folder {
background: url('images/tree_icons.png') no-repeat -208px 0;
}
.tree-folder-open {
background: url('images/tree_icons.png') no-repeat -224px 0;
}
.tree-file {
background: url('images/tree_icons.png') no-repeat -240px 0;
}
.tree-loading {
background: url('images/loading.gif') no-repeat center center;
}
.tree-checkbox0 {
background: url('images/tree_icons.png') no-repeat -208px -18px;
}
.tree-checkbox1 {
background: url('images/tree_icons.png') no-repeat -224px -18px;
}
.tree-checkbox2 {
background: url('images/tree_icons.png') no-repeat -240px -18px;
}
.tree-title {
font-size: 12px;
display: inline-block;
text-decoration: none;
vertical-align: top;
white-space: nowrap;
padding: 0 2px;
height: 18px;
line-height: 18px;
}
.tree-node-proxy {
font-size: 12px;
line-height: 20px;
padding: 0 2px 0 20px;
border-width: 1px;
border-style: solid;
z-index: 9900000;
}
.tree-dnd-icon {
display: inline-block;
position: absolute;
width: 16px;
height: 18px;
left: 2px;
top: 50%;
margin-top: -9px;
}
.tree-dnd-yes {
background: url('images/tree_icons.png') no-repeat -256px 0;
}
.tree-dnd-no {
background: url('images/tree_icons.png') no-repeat -256px -18px;
}
.tree-node-top {
border-top: 1px dotted red;
}
.tree-node-bottom {
border-bottom: 1px dotted red;
}
.tree-node-append .tree-title {
border: 1px dotted red;
}
.tree-editor {
border: 1px solid #ccc;
font-size: 12px;
height: 14px !important;
height: 18px;
line-height: 14px;
padding: 1px 2px;
width: 80px;
position: absolute;
top: 0;
}
.tree-node-proxy {
background-color: #ffffff;
color: #000000;
border-color: #D3D3D3;
}
.tree-node-hover {
background: #e2e2e2;
color: #000000;
}
.tree-node-selected {
background: #0092DC;
color: #fff;
}
.tree-node-hidden {
display: none;
} |
<?php
namespace Symfony\Component\VarDumper\Dumper;
use Symfony\Component\VarDumper\Cloner\Cursor;
use Symfony\Component\VarDumper\Cloner\Data;
/**
* HtmlDumper dumps variables as HTML.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class HtmlDumper extends CliDumper
{
public static $defaultOutput = 'php://output';
protected $dumpHeader;
protected $dumpPrefix = '<pre class=sf-dump id=%s data-indent-pad="%s">';
protected $dumpSuffix = '</pre><script>Sfdump("%s")</script>';
protected $dumpId = 'sf-dump';
protected $colors = true;
protected $headerIsDumped = false;
protected $lastDepth = -1;
protected $styles = array(
'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace',
'num' => 'font-weight:bold; color:#1299DA',
'const' => 'font-weight:bold',
'str' => 'font-weight:bold; color:#56DB3A',
'cchr' => 'color:#FF8400',
'note' => 'color:#1299DA',
'ref' => 'color:#A0A0A0',
'public' => 'color:#FFFFFF',
'protected' => 'color:#FFFFFF',
'private' => 'color:#FFFFFF',
'meta' => 'color:#B729D9',
'key' => 'color:#56DB3A',
'index' => 'color:#1299DA',
);
/**
* {@inheritdoc}
*/
public function setOutput($output)
{
if ($output !== $prev = parent::setOutput($output)) {
$this->headerIsDumped = false;
}
return $prev;
}
/**
* {@inheritdoc}
*/
public function setStyles(array $styles)
{
$this->headerIsDumped = false;
$this->styles = $styles + $this->styles;
}
/**
* Sets an HTML header that will be dumped once in the output stream.
*
* @param string $header An HTML string.
*/
public function setDumpHeader($header)
{
$this->dumpHeader = $header;
}
/**
* Sets an HTML prefix and suffix that will encapse every single dump.
*
* @param string $prefix The prepended HTML string.
* @param string $suffix The appended HTML string.
*/
public function setDumpBoundaries($prefix, $suffix)
{
$this->dumpPrefix = $prefix;
$this->dumpSuffix = $suffix;
}
/**
* {@inheritdoc}
*/
public function dump(Data $data, $output = null)
{
$this->dumpId = 'sf-dump-'.mt_rand();
parent::dump($data, $output);
}
/**
* Dumps the HTML header.
*/
protected function getDumpHeader()
{
$this->headerIsDumped = true;
if (null !== $this->dumpHeader) {
return $this->dumpHeader;
}
$line = <<<'EOHTML'
<script>
Sfdump = window.Sfdump || (function (doc) {
var refStyle = doc.createElement('style'),
rxEsc = /([.*+?^${}()|\[\]\/\\])/g,
idRx = /\bsf-dump-\d+-ref[012]\w+\b/;
doc.documentElement.firstChild.appendChild(refStyle);
function toggle(a) {
var s = a.nextSibling || {};
if ('sf-dump-compact' == s.className) {
a.lastChild.innerHTML = '';
s.className = 'sf-dump-expanded';
} else if ('sf-dump-expanded' == s.className) {
a.lastChild.innerHTML = '';
s.className = 'sf-dump-compact';
} else {
return false;
}
return true;
};
return function (root) {
root = doc.getElementById(root);
function a(e, f) {
root.addEventListener(e, function (e) {
if ('A' == e.target.tagName) {
f(e.target, e);
} else if ('A' == e.target.parentNode.tagName) {
f(e.target.parentNode, e);
}
});
};
root.addEventListener('mouseover', function (e) {
if ('' != refStyle.innerHTML) {
refStyle.innerHTML = '';
}
});
a('mouseover', function (a) {
if (a = idRx.exec(a.className)) {
refStyle.innerHTML = 'pre.sf-dump .'+a[0]+'{background-color: #B729D9; color: #FFF !important; border-radius: 2px}';
}
});
a('click', function (a, e) {
if (/\bsf-dump-toggle\b/.test(a.className)) {
e.preventDefault();
if (!toggle(a)) {
var r = doc.getElementById(a.getAttribute('href').substr(1)),
s = r.previousSibling,
f = r.parentNode,
t = a.parentNode;
t.replaceChild(r, a);
f.replaceChild(a, s);
t.insertBefore(s, r);
f = f.firstChild.nodeValue.match(indentRx);
t = t.firstChild.nodeValue.match(indentRx);
if (f && t && f[0] !== t[0]) {
r.innerHTML = r.innerHTML.replace(new RegExp('^'+f[0].replace(rxEsc, '\\$1'), 'mg'), t[0]);
}
if ('sf-dump-compact' == r.className) {
toggle(s);
}
}
}
});
var indentRx = new RegExp('^('+(root.getAttribute('data-indent-pad') || ' ').replace(rxEsc, '\\$1')+')+', 'm'),
elt = root.<API key>('A'),
len = elt.length,
i = 0,
t = [];
while (i < len) t.push(elt[i++]);
elt = root.<API key>('SAMP');
len = elt.length;
i = 0;
while (i < len) t.push(elt[i++]);
root = t;
len = t.length;
i = t = 0;
while (i < len) {
elt = root[i];
if ("SAMP" == elt.tagName) {
elt.className = "sf-dump-expanded";
a = elt.previousSibling || {};
if ('A' != a.tagName) {
a = doc.createElement('A');
a.className = 'sf-dump-ref';
elt.parentNode.insertBefore(a, elt);
} else {
a.innerHTML += ' ';
}
a.innerHTML += '<span></span>';
a.className += ' sf-dump-toggle';
if ('sf-dump' != elt.parentNode.className) {
toggle(a);
}
} else if ("sf-dump-ref" == elt.className && (a = elt.getAttribute('href'))) {
a = a.substr(1);
elt.className += ' '+a;
if (/[\[{]$/.test(elt.previousSibling.nodeValue)) {
a = a != elt.nextSibling.id && doc.getElementById(a);
try {
t = a.nextSibling;
elt.appendChild(a);
t.parentNode.insertBefore(a, t);
if (/^[@#]/.test(elt.innerHTML)) {
elt.innerHTML += ' <span></span>';
} else {
elt.innerHTML = '<span></span>';
elt.className = 'sf-dump-ref';
}
elt.className += ' sf-dump-toggle';
} catch (e) {
if ('&' == elt.innerHTML.charAt(0)) {
elt.innerHTML = '…';
elt.className = 'sf-dump-ref';
}
}
}
}
++i;
}
};
})(document);
</script>
<style>
pre.sf-dump {
display: block;
white-space: pre;
padding: 5px;
}
pre.sf-dump span {
display: inline;
}
pre.sf-dump .sf-dump-compact {
display: none;
}
pre.sf-dump abbr {
text-decoration: none;
border: none;
cursor: help;
}
pre.sf-dump a {
text-decoration: none;
cursor: pointer;
border: 0;
outline: none;
}
EOHTML;
foreach ($this->styles as $class => $style) {
$line .= 'pre.sf-dump'.('default' !== $class ? ' .sf-dump-'.$class : '').'{'.$style.'}';
}
return $this->dumpHeader = preg_replace('/\s+/', ' ', $line).'</style>'.$this->dumpHeader;
}
/**
* {@inheritdoc}
*/
public function enterHash(Cursor $cursor, $type, $class, $hasChild)
{
parent::enterHash($cursor, $type, $class, false);
if ($hasChild) {
if ($cursor->refIndex) {
$r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2;
$r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex;
$this->line .= sprintf('<samp id=%s-ref%s>', $this->dumpId, $r);
} else {
$this->line .= '<samp>';
}
$this->dumpLine($cursor->depth);
}
}
/**
* {@inheritdoc}
*/
public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut)
{
$this->dumpEllipsis($cursor, $hasChild, $cut);
if ($hasChild) {
$this->line .= '</samp>';
}
parent::leaveHash($cursor, $type, $class, $hasChild, 0);
}
/**
* {@inheritdoc}
*/
protected function style($style, $value, $attr = array())
{
if ('' === $value) {
return '';
}
$v = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
$v = <API key>(self::$controlCharsRx, function ($r) {
return sprintf('<span class=sf-dump-cchr title=\\x%02X>&#%d;</span>', ord($r[0]), "\x7F" !== $r[0] ? 0x2400 + ord($r[0]) : 0x2421);
}, $v);
if ('ref' === $style) {
if (empty($attr['count'])) {
return sprintf('<a class=sf-dump-ref>%s</a>', $v);
}
$r = ('#' !== $v[0] ? 1 - ('@' !== $v[0]) : 2).substr($value, 1);
return sprintf('<a class=sf-dump-ref href=#%s-ref%s title="%d occurrences">%s</a>', $this->dumpId, $r, 1 + $attr['count'], $v);
}
if ('const' === $style && array_key_exists('value', $attr)) {
$style .= sprintf(' title="%s"', htmlspecialchars(json_encode($attr['value']), ENT_QUOTES, 'UTF-8'));
} elseif ('public' === $style) {
$style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
} elseif ('str' === $style && 1 < $attr['length']) {
$style .= sprintf(' title="%s%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : '');
} elseif ('note' === $style) {
if (false !== $c = strrpos($v, '\\')) {
return sprintf('<abbr title="%s" class=sf-dump-%s>%s</abbr>', $v, $style, substr($v, $c+1));
} elseif (':' === $v[0]) {
return sprintf('<abbr title="`%s` resource" class=sf-dump-%s>%s</abbr>', substr($v, 1), $style, $v);
}
} elseif ('protected' === $style) {
$style .= ' title="Protected property"';
} elseif ('private' === $style) {
$style .= sprintf(' title="Private property defined in class: `%s`"', $attr['class']);
}
return "<span class=sf-dump-$style>$v</span>";
}
/**
* {@inheritdoc}
*/
protected function dumpLine($depth)
{
if (-1 === $this->lastDepth) {
$this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line;
}
if (!$this->headerIsDumped) {
$this->line = $this->getDumpHeader().$this->line;
}
if (-1 === $depth) {
$this->line .= sprintf($this->dumpSuffix, $this->dumpId);
}
$this->lastDepth = $depth;
// Replaces non-ASCII UTF-8 chars by numeric HTML entities
$this->line = <API key>(
'/[\x80-\xFF]+/',
function ($m) {
$m = unpack('C*', $m[0]);
$i = 1;
$entities = '';
while (isset($m[$i])) {
if (0xF0 <= $m[$i]) {
$c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
} elseif (0xE0 <= $m[$i]) {
$c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
} else {
$c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80;
}
$entities .= '&
}
return $entities;
},
$this->line
);
if (-1 === $depth) {
AbstractDumper::dumpLine(0);
}
AbstractDumper::dumpLine($depth);
}
} |
/*jshint unused:false */
/*global tinymce:true */
/**
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list,
* with the list loaded in order. plugins in this list will be initialised when this plugin is initialized. (before the
* init method is called). plugins in a depends list should typically be specified using the short name). If necessary
* this can be done with an object which has the url to the plugin and the shortname.
*/
tinymce.PluginManager.add('example_dependency', function() {
// Example logic here
}, ['example']); |
# Makefile for the kernel mmc core.
obj-$(CONFIG_MMC) += mmc_core.o
mmc_core-y := core.o bus.o host.o \
mmc.o mmc_ops.o sd.o sd_ops.o \
sdio.o sdio_ops.o sdio_bus.o \
sdio_cis.o sdio_io.o sdio_irq.o \
quirks.o
mmc_core-$(CONFIG_DEBUG_FS) += debugfs.o |
#include "fsl_dmamux.h"
/*!
* @brief Get instance number for DMAMUX.
*
* @param base DMAMUX peripheral base address.
*/
static uint32_t DMAMUX_GetInstance(DMAMUX_Type *base);
/*! @brief Array to map DMAMUX instance number to base pointer. */
static DMAMUX_Type *const s_dmamuxBases[] = DMAMUX_BASE_PTRS;
#if !(defined(<API key>) && <API key>)
/*! @brief Array to map DMAMUX instance number to clock name. */
static const clock_ip_name_t s_dmamuxClockName[] = DMAMUX_CLOCKS;
#endif /* <API key> */
static uint32_t DMAMUX_GetInstance(DMAMUX_Type *base)
{
uint32_t instance;
/* Find the instance index from base address mappings. */
for (instance = 0; instance < ARRAY_SIZE(s_dmamuxBases); instance++)
{
if (s_dmamuxBases[instance] == base)
{
break;
}
}
assert(instance < ARRAY_SIZE(s_dmamuxBases));
return instance;
}
void DMAMUX_Init(DMAMUX_Type *base)
{
#if !(defined(<API key>) && <API key>)
CLOCK_EnableClock(s_dmamuxClockName[DMAMUX_GetInstance(base)]);
#endif /* <API key> */
}
void DMAMUX_Deinit(DMAMUX_Type *base)
{
#if !(defined(<API key>) && <API key>)
CLOCK_DisableClock(s_dmamuxClockName[DMAMUX_GetInstance(base)]);
#endif /* <API key> */
} |
<?php
namespace Symfony\Component\HttpFoundation\Session\Storage;
/**
* <API key> is used to mock sessions for
* functional testing when done in a single PHP process.
*
* No PHP session is actually started since a session can be initialized
* and shutdown only once per PHP execution cycle and this class does
* not pollute any session related globals, including session_*() functions
* or session.* PHP ini directives.
*
* @author Drak <drak@zikula.org>
*/
class <API key> extends <API key>
{
/**
* @var string
*/
private $savePath;
/**
* @var array
*/
private $sessionData;
/**
* Constructor.
*
* @param string $savePath Path of directory to save session files.
* @param string $name Session name.
* @param MetadataBag $metaBag MetadataBag instance.
*/
public function __construct($savePath = null, $name = 'MOCKSESSID', MetadataBag $metaBag = null)
{
if (null === $savePath) {
$savePath = sys_get_temp_dir();
}
if (!is_dir($savePath)) {
mkdir($savePath, 0777, true);
}
$this->savePath = $savePath;
parent::__construct($name, $metaBag);
}
/**
* {@inheritdoc}
*/
public function start()
{
if ($this->started) {
return true;
}
if (!$this->id) {
$this->id = $this->generateId();
}
$this->read();
$this->started = true;
return true;
}
/**
* {@inheritdoc}
*/
public function regenerate($destroy = false, $lifetime = null)
{
if (!$this->started) {
$this->start();
}
if ($destroy) {
$this->destroy();
}
return parent::regenerate($destroy, $lifetime);
}
/**
* {@inheritdoc}
*/
public function save()
{
if (!$this->started) {
throw new \RuntimeException("Trying to save a session that was not started yet or was already closed");
}
file_put_contents($this->getFilePath(), serialize($this->data));
// this is needed for Silex, where the session object is re-used across requests
// in functional tests. In Symfony, the container is rebooted, so we don't have
// this issue
$this->started = false;
}
/**
* Deletes a session from persistent storage.
* Deliberately leaves session data in memory intact.
*/
private function destroy()
{
if (is_file($this->getFilePath())) {
unlink($this->getFilePath());
}
}
/**
* Calculate path to file.
*
* @return string File path
*/
private function getFilePath()
{
return $this->savePath.'/'.$this->id.'.mocksess';
}
/**
* Reads session from storage and loads session.
*/
private function read()
{
$filePath = $this->getFilePath();
$this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : array();
$this->loadSession();
}
} |
/**
* General-purpose jQuery wrapper. Simply pass the plugin name as the expression.
*
* It is possible to specify a default set of parameters for each jQuery plugin.
* Under the jq key, namespace each plugin by that which will be passed to ui-jq.
* Unfortunately, at this time you can only pre-define the first parameter.
* @example { jq : { datepicker : { showOn:'click' } } }
*
* @param ui-jq {string} The $elm.[pluginName]() to call.
* @param [ui-options] {mixed} Expression to be evaluated and passed as options to the function
* Multiple parameters can be separated by commas
* @param [ui-refresh] {expression} Watch expression and refire plugin on changes
*
* @example <input ui-jq="datepicker" ui-options="{showOn:'click'},secondParameter,thirdParameter" ui-refresh="iChange">
*/
angular.module('ui.jq',[]).
value('uiJqConfig',{}).
directive('uiJq', ['uiJqConfig', '$timeout', function <API key>(uiJqConfig, $timeout) {
return {
restrict: 'A',
compile: function <API key>(tElm, tAttrs) {
if (!angular.isFunction(tElm[tAttrs.uiJq])) {
throw new Error('ui-jq: The "' + tAttrs.uiJq + '" function does not exist');
}
var options = uiJqConfig && uiJqConfig[tAttrs.uiJq];
return function uiJqLinkingFunction(scope, elm, attrs) {
var linkOptions = [];
// If ui-options are passed, merge (or override) them onto global defaults and pass to the jQuery method
if (attrs.uiOptions) {
linkOptions = scope.$eval('[' + attrs.uiOptions + ']');
if (angular.isObject(options) && angular.isObject(linkOptions[0])) {
linkOptions[0] = angular.extend({}, options, linkOptions[0]);
}
} else if (options) {
linkOptions = [options];
}
// If change compatibility is enabled, the form input's "change" event will trigger an "input" event
if (attrs.ngModel && elm.is('select,input,textarea')) {
elm.bind('change', function() {
elm.trigger('input');
});
}
// Call jQuery method and pass relevant options
function callPlugin() {
$timeout(function() {
elm[attrs.uiJq].apply(elm, linkOptions);
}, 0, false);
}
// If ui-refresh is used, re-fire the the method upon every change
if (attrs.uiRefresh) {
scope.$watch(attrs.uiRefresh, function(newVal) {
callPlugin();
});
}
callPlugin();
};
}
};
}]); |
# DO NOT WRITE ANY MAGIC COMMENT HERE.
def <API key>
return __ENCODING__
end |
#include "msm_fb.h"
#include "mipi_dsi.h"
#include "mipi_NT35510.h"
static struct msm_panel_info pinfo;
static struct mipi_dsi_phy_ctrl <API key> = {
{0x03, 0x01, 0x01, 0x00},
{0xb9, 0x8e, 0x1f, 0x00, 0x98, 0x9c, 0x22, 0x90,
0x18, 0x03, 0x04},
{0x7f, 0x00, 0x00, 0x00},
{0xbb, 0x02, 0x06, 0x00},
{0x00, 0xec, 0x31, 0xd2, 0x00, 0x40, 0x37, 0x62,
0x01, 0x0f, 0x07,
0x05, 0x14, 0x03, 0x0, 0x0, 0x0, 0x20, 0x0, 0x02, 0x0},
};
static int <API key>(void)
{
int ret;
if (<API key>("<API key>"))
return 0;
pinfo.xres = 480;
pinfo.yres = 800;
pinfo.type = MIPI_VIDEO_PANEL;
pinfo.pdest = DISPLAY_1;
pinfo.wait_cycle = 0;
pinfo.bpp = 24;
pinfo.lcdc.h_back_porch = 100;
pinfo.lcdc.h_front_porch = 100;
pinfo.lcdc.h_pulse_width = 8;
pinfo.lcdc.v_back_porch = 20;
pinfo.lcdc.v_front_porch = 20;
pinfo.lcdc.v_pulse_width = 1;
pinfo.lcdc.border_clr = 0;
pinfo.lcdc.underflow_clr = 0xff;
pinfo.lcdc.hsync_skew = 0;
pinfo.clk_rate = 499000000;
pinfo.bl_max = 255;
pinfo.bl_min = 1;
pinfo.fb_num = 2;
pinfo.mipi.mode = DSI_VIDEO_MODE;
pinfo.mipi.pulse_mode_hsa_he = TRUE;
pinfo.mipi.hfp_power_stop = TRUE;
pinfo.mipi.hbp_power_stop = TRUE;
pinfo.mipi.hsa_power_stop = TRUE;
pinfo.mipi.eof_bllp_power_stop = TRUE;
pinfo.mipi.bllp_power_stop = TRUE;
pinfo.mipi.traffic_mode = DSI_BURST_MODE;
pinfo.mipi.dst_format = <API key>;
pinfo.mipi.vc = 0;
pinfo.mipi.rgb_swap = DSI_RGB_SWAP_RGB;
pinfo.mipi.data_lane0 = TRUE;
pinfo.mipi.data_lane1 = TRUE;
pinfo.mipi.t_clk_post = 0x20;
pinfo.mipi.t_clk_pre = 0x2f;
pinfo.mipi.stream = 0;
pinfo.mipi.mdp_trigger = <API key>;
pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
pinfo.mipi.frame_rate = 60;
pinfo.mipi.dsi_phy_db = &<API key>;
pinfo.mipi.dlane_swap = 0x01;
pinfo.mipi.tx_eot_append = 0x01;
ret = <API key>(&pinfo, MIPI_DSI_PRIM,
<API key>);
if (ret)
pr_err("%s: failed to register device!\n", __func__);
return ret;
}
module_init(<API key>); |
.cm-s-eclipse span.cm-meta { color: #FF1717; }
.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
.cm-s-eclipse span.cm-atom { color: #219; }
.cm-s-eclipse span.cm-number { color: #164; }
.cm-s-eclipse span.cm-def { color: #00f; }
.cm-s-eclipse span.cm-variable { color: black; }
.cm-s-eclipse span.cm-variable-2 { color: #0000C0; }
.cm-s-eclipse span.cm-variable-3 { color: #0000C0; }
.cm-s-eclipse span.cm-property { color: black; }
.cm-s-eclipse span.cm-operator { color: black; }
.cm-s-eclipse span.cm-comment { color: #3F7F5F; }
.cm-s-eclipse span.cm-string { color: #2A00FF; }
.cm-s-eclipse span.cm-string-2 { color: #f50; }
.cm-s-eclipse span.cm-qualifier { color: #555; }
.cm-s-eclipse span.cm-builtin { color: #30a; }
.cm-s-eclipse span.cm-bracket { color: #cc7; }
.cm-s-eclipse span.cm-tag { color: #170; }
.cm-s-eclipse span.cm-attribute { color: #00c; }
.cm-s-eclipse span.cm-link { color: #219; }
.cm-s-eclipse span.cm-error { color: #f00; }
.cm-s-eclipse .<API key> { background: #e8f2ff; }
.cm-s-eclipse .<API key> { outline:1px solid grey; color:black !important; } |
// Use of this source code is governed by a BSD-style
// Defensive debug-only utility to track that functions run on the
// goroutine that they're supposed to.
package http2
import (
"bytes"
"errors"
"fmt"
"os"
"runtime"
"strconv"
"sync"
)
var DebugGoroutines = os.Getenv("<API key>") == "1"
type goroutineLock uint64
func newGoroutineLock() goroutineLock {
if !DebugGoroutines {
return 0
}
return goroutineLock(curGoroutineID())
}
func (g goroutineLock) check() {
if !DebugGoroutines {
return
}
if curGoroutineID() != uint64(g) {
panic("running on the wrong goroutine")
}
}
func (g goroutineLock) checkNotOn() {
if !DebugGoroutines {
return
}
if curGoroutineID() == uint64(g) {
panic("running on the wrong goroutine")
}
}
var goroutineSpace = []byte("goroutine ")
func curGoroutineID() uint64 {
bp := littleBuf.Get().(*[]byte)
defer littleBuf.Put(bp)
b := *bp
b = b[:runtime.Stack(b, false)]
// Parse the 4707 out of "goroutine 4707 ["
b = bytes.TrimPrefix(b, goroutineSpace)
i := bytes.IndexByte(b, ' ')
if i < 0 {
panic(fmt.Sprintf("No space found in %q", b))
}
b = b[:i]
n, err := parseUintBytes(b, 10, 64)
if err != nil {
panic(fmt.Sprintf("Failed to parse goroutine ID out of %q: %v", b, err))
}
return n
}
var littleBuf = sync.Pool{
New: func() interface{} {
buf := make([]byte, 64)
return &buf
},
}
// parseUintBytes is like strconv.ParseUint, but using a []byte.
func parseUintBytes(s []byte, base int, bitSize int) (n uint64, err error) {
var cutoff, maxVal uint64
if bitSize == 0 {
bitSize = int(strconv.IntSize)
}
s0 := s
switch {
case len(s) < 1:
err = strconv.ErrSyntax
goto Error
case 2 <= base && base <= 36:
// valid base; nothing to do
case base == 0:
// Look for octal, hex prefix.
switch {
case s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'):
base = 16
s = s[2:]
if len(s) < 1 {
err = strconv.ErrSyntax
goto Error
}
case s[0] == '0':
base = 8
default:
base = 10
}
default:
err = errors.New("invalid base " + strconv.Itoa(base))
goto Error
}
n = 0
cutoff = cutoff64(base)
maxVal = 1<<uint(bitSize) - 1
for i := 0; i < len(s); i++ {
var v byte
d := s[i]
switch {
case '0' <= d && d <= '9':
v = d - '0'
case 'a' <= d && d <= 'z':
v = d - 'a' + 10
case 'A' <= d && d <= 'Z':
v = d - 'A' + 10
default:
n = 0
err = strconv.ErrSyntax
goto Error
}
if int(v) >= base {
n = 0
err = strconv.ErrSyntax
goto Error
}
if n >= cutoff {
// n*base overflows
n = 1<<64 - 1
err = strconv.ErrRange
goto Error
}
n *= uint64(base)
n1 := n + uint64(v)
if n1 < n || n1 > maxVal {
// n+v overflows
n = 1<<64 - 1
err = strconv.ErrRange
goto Error
}
n = n1
}
return n, nil
Error:
return n, &strconv.NumError{Func: "ParseUint", Num: string(s0), Err: err}
}
// Return the first number n such that n*base >= 1<<64.
func cutoff64(base int) uint64 {
if base < 2 {
return 0
}
return (1<<64-1)/uint64(base) + 1
} |
/* The gc library uses this file for system defines, and generates it
automatically using the godefs program. The logical thing to put
here for gccgo would be #include statements for system header
files. We can't do that, though, because runtime.h #define's the
standard types. So we #include the system headers from runtime.h
instead. */ |
static const UVersionInfo <API key>={6,0,0,0};
static const int32_t ucase_props_indexes[UCASE_IX_TOP]={0x10,0x5654,0x4918,0x50c,0x172,0,0,0,0,0,0,0,0,0,0,3};
static const uint16_t <API key>[9348]={
0x2c2,0x2ca,0x2d2,0x2da,0x2e8,0x2f0,0x2f8,0x300,0x308,0x310,0x317,0x31f,0x327,0x32f,0x337,0x33f,
0x345,0x34d,0x355,0x35d,0x365,0x36d,0x375,0x37d,0x385,0x38d,0x395,0x39d,0x3a5,0x3ad,0x3b5,0x3bd,
0x3c5,0x3cd,0x3d1,0x3d9,0x3e1,0x3e9,0x3f1,0x3f9,0x3f7,0x3ff,0x404,0x40c,0x413,0x41b,0x423,0x42b,
0x433,0x43b,0x443,0x44b,0x2e1,0x2e9,0x450,0x458,0x45d,0x465,0x46d,0x475,0x474,0x47c,0x481,0x489,
0x490,0x497,0x49b,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x4a3,0x4a5,0x4ad,0x4b5,0x4b9,0x4ba,0x4c2,0x4ca,
0x4d2,0x4ba,0x4da,0x4df,0x4d2,0x4ba,0x4e7,0x4ca,0x4b9,0x4eb,0x4f3,0x4ca,0x4f8,0x2e1,0x500,0x2e1,
0x2e1,0x476,0x508,0x4ca,0x2e1,0x4eb,0x50f,0x4ca,0x2e1,0x2e1,0x4c2,0x4ca,0x2e1,0x2e1,0x515,0x2e1,
0x2e1,0x51b,0x522,0x2e1,0x2e1,0x526,0x52e,0x2e1,0x532,0x539,0x2e1,0x540,0x548,0x54f,0x557,0x2e1,
0x2e1,0x55c,0x564,0x56c,0x574,0x57c,0x584,0x429,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x586,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x58e,0x58e,0x4c6,0x4c6,0x2e1,0x594,0x59c,0x2e1,
0x5a4,0x2e1,0x5ac,0x2e1,0x2e1,0x5b2,0x2e1,0x2e1,0x2e1,0x5ba,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x5c1,0x2e1,0x5c8,0x5d0,0x2e1,0x5ab,0x2e1,0x2e1,0x5d8,0x5db,0x5e3,0x5e9,0x5f1,0x5f9,0x2e1,0x600,
0x2e1,0x605,0x2e1,0x60b,0x2e1,0x2e1,0x613,0x61b,0x623,0x628,0x62b,0x633,0x63b,0x642,0x64a,0x651,
0x308,0x659,0x308,0x661,0x664,0x308,0x66c,0x308,0x674,0x67c,0x684,0x68c,0x694,0x69c,0x6a4,0x6ac,
0x6b4,0x6bb,0x2e1,0x6c3,0x6cb,0x2e1,0x6d3,0x6db,0x6e3,0x6eb,0x6f3,0x6fb,0x703,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x706,0x70c,0x712,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x71a,0x71f,0x723,0x72b,0x308,0x308,0x308,0x733,0x73b,0x743,0x2e1,0x748,0x2e1,0x2e1,0x2e1,0x750,
0x2e1,0x5a9,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x4b8,0x758,0x2e1,0x2e1,0x75f,0x2e1,0x2e1,0x767,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x76f,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x60b,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x775,0x2e1,0x308,0x77d,0x3fb,0x2e1,0x2e1,0x785,0x78d,0x795,0x308,0x79a,0x7a2,0x7aa,0x2e1,0x7ad,
0x7b5,0x4d1,0x2e1,0x2e1,0x2e1,0x2e1,0x7bc,0x7c4,0x2e1,0x7cb,0x7d2,0x2e1,0x4a3,0x7d7,0x7df,0x2e1,
0x2e1,0x7e5,0x7ed,0x7f1,0x2e1,0x7f6,0x7fe,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x804,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x80c,0x2e1,0x2e1,0x2e1,0x2e1,0x814,0x5f1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x819,0x821,0x825,0x2e1,0x2e1,0x2e1,0x2e1,0x2c4,0x2ca,0x82d,0x835,0x7f1,0x476,0x2e1,0x2e1,0x83d,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0xb88,0xb88,0xba0,0xbe0,0xc20,0xc5c,0xc9c,0xcdc,0xd14,0xd54,0xd94,0xdd4,0xe14,0xe54,0xe94,0xed4,
0xf14,0xf44,0xf84,0xfc4,0xfdc,0x1010,0x104c,0x108c,0x10cc,0x110c,0xb84,0x1140,0x1174,0x11b4,0x11d0,0x1204,
0x9e1,0xa11,0xa51,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xa86,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0xac6,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x5ad,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x845,0x84b,0x84f,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x857,0x85b,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x4b9,0x863,0x86a,0x2e1,0x5f1,0x86e,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x876,0x87e,0x884,0x2e1,0x2e1,0x2e1,0x2e1,0x88c,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x894,0x89c,0x8a1,0x8a7,0x8af,0x8b7,0x8bf,0x898,0x8c7,0x8cf,
0x8d7,0x8de,0x899,0x894,0x89c,0x897,0x8a7,0x89a,0x895,0x8e6,0x898,0x8ee,0x8f6,0x8fe,0x905,0x8f1,
0x8f9,0x901,0x908,0x8f4,0x910,0x2e1,0x4b9,0x78d,0x78d,0x78d,0x2e1,0x2e1,0x2e1,0x2e1,0x78d,0x78d,
0x78d,0x78d,0x78d,0x78d,0x78d,0x918,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,
0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2e1,0x2c1,0x2c1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0,0,0,0,0,0,0x40,0,0,0,0,0,0,0,0,0,
0,0,0x40,0,0,0,0,0,0,0x806,0x806,0x806,0x806,0x806,0x806,0x806,
0x806,0xe,0x5e,0x7e,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0xbe,0x806,0x806,0x806,0x806,
0x806,0x806,0x806,0,0,0,0x40,0,0x40,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,
0xf805,0xfd,0xf815,0x14d,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0x18d,0xf805,0xf805,0xf805,0xf805,
0xf805,0xf805,0xf805,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x40,0,1,0,0,0x40,0,0x40,
0,0,0,0,0x40,0x1cd,0,0x40,0x40,0,1,0,0,0,0,0,
0x806,0x806,0x806,0x806,0x806,0x1fe,0x806,0x806,0x806,0x806,0x806,0x806,0x23e,0x25e,0x806,0x806,
0x806,0x806,0x806,0x806,0x806,0x806,0x806,0,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x27d,
0xf805,0xf805,0xf805,0xf805,0xf805,0x31d,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,
0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0x1e45,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x35e,0xffc5,0x46,0xffc5,0x46,0xffc5,0x37e,0xffd5,
0x39e,0x3ed,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,1,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,
0xffc5,0x46,0xffc5,0x46,0xffc5,0x43d,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0xe1c6,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x4bd,0x30c5,0x3486,0x46,0xffc5,
0x46,0xffc5,0x3386,0x46,0xffc5,0x3346,0x3346,0x46,0xffc5,1,0x13c6,0x3286,0x32c6,0x46,0xffc5,0x3346,
0x33c6,0x1845,0x34c6,0x3446,0x46,0xffc5,0x28c5,1,0x34c6,0x3546,0x2085,0x3586,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x3686,0x46,0xffc5,0x3686,1,1,0x46,0xffc5,0x3686,0x46,0xffc5,0x3646,0x3646,0x46,
0xffc5,0x46,0xffc5,0x36c6,0x46,0xffc5,1,0,0x46,0xffc5,1,0xe05,0,0,0,0,
0x4ee,0x51f,0x55d,0x58e,0x5bf,0x5fd,0x62e,0x65f,0x69d,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,
0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0xec45,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x6cd,0x74e,0x77f,0x7bd,
0x46,0xffc5,0xe7c6,0xf206,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0xdf86,1,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,1,1,1,1,1,1,0x7ee,0x46,
0xffc5,0xd746,0x80e,0x82d,0x84d,0x46,0xffc5,0xcf46,0x1146,0x11c6,0x46,0xffc5,0x46,0xffd5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x86d,0x88d,0x8ad,0xcb85,0xcc85,1,0xccc5,0xccc5,1,0xcd85,1,0xcd45,
1,1,1,1,0xccc5,1,1,0xcc45,1,0x8cd,1,1,0xcbd5,0xcb45,1,0x8ed,
1,1,1,0xcb45,1,0x90d,0xcac5,1,1,0xca85,1,1,1,1,1,1,
1,0x92d,1,1,0xc985,1,1,0xc985,1,1,1,1,0xc985,0xeec5,0xc9c5,0xc9c5,
0xee45,1,1,1,1,1,0xc945,1,0,1,1,1,1,1,1,1,
1,0x11,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,0x949,0x949,0x959,0x949,0x949,0x949,0x949,0x949,0x949,0x40,0x40,0x40,
0x44,0x40,0x44,0x40,0x949,0x949,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x949,0x949,0x949,0x949,0x949,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x64,0x64,0x60,0x60,0x60,0x60,0x60,0x96c,0x64,0x60,0x64,0x60,
0x64,0x60,0x60,0x60,0x60,0x60,0x60,0x64,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x74,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x60,0x60,0x60,0x60,0x60,0x64,0x60,0x60,0x97d,0x60,0x70,0x70,0x70,0x60,0x60,
0x60,0x70,0x70,0x40,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x60,0x70,0x70,0x70,0x60,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x46,0xffc5,0x46,0xffc5,0x40,0x40,0x46,0xffc5,0,0,0x949,0x2085,
0x2085,0x2085,0,0,0,0,0,0,0x40,0x40,0x986,0x40,0x946,0x946,0x946,0,
0x1006,0,0xfc6,0xfc6,0x9cd,0x806,0xa9e,0x806,0x806,0xade,0x806,0x806,0xb1e,0xb6e,0xbbe,0x806,
0xbfe,0x806,0x806,0x806,0xc3e,0xc7e,0,0xcbe,0x806,0x806,0xcfe,0x806,0x806,0xd3e,0x806,0x806,
0xf685,0xf6c5,0xf6c5,0xf6c5,0xd7d,0xf805,0xe4d,0xf805,0xf805,0xe8d,0xf805,0xf805,0xecd,0xf1d,0xf6d,0xf805,
0xfad,0xf805,0xf805,0xf805,0xfed,0x102d,0x106d,0x109d,0xf805,0xf805,0x10dd,0xf805,0xf805,0x111d,0xf805,0xf805,
0xf005,0xf045,0xf045,0x206,0x115d,0x118d,2,2,2,0x11dd,0x120d,0xfe05,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x123d,0x126d,0x1c5,0x11,0x129e,0x12ed,0,0x46,0xffc5,0xfe46,0x46,0xffc5,
1,0xdf86,0xdf86,0xdf86,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,
0x1406,0x1406,0x1406,0x1406,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,
0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,
0x806,0x806,0x806,0x806,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,
0xf805,0xf805,0xf805,0xf805,0xec05,0xec05,0xec05,0xec05,0xec05,0xec05,0xec15,0xec05,0xec15,0xec05,0xec05,0xec05,
0xec05,0xec05,0xec05,0xec05,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0,0x60,0x60,0x60,0x60,0x60,0x40,0x40,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x3c6,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,
0xffc5,0x46,0xffc5,0xfc45,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0,0,0,0,0,0,0,0,0,0xc06,0xc06,0xc06,
0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,
0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0,0,0x40,0,0,0,0,0,0,
0,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,
0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,
0xf405,0xf405,0xf405,0x131d,0,0,0,0,0,0,0,0,0,0x70,0x60,0x60,
0x60,0x60,0x70,0x60,0x60,0x60,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,
0x70,0x70,0x70,0x70,0x60,0x60,0x70,0x60,0x60,0x70,0x70,0x60,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0,0x70,0,0x70,0x70,0,
0x60,0x70,0,0x70,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40,
0,0,0,0,0,0,0,0,0,0,0,0,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x70,0x70,0x70,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,0,
0,0,0,0,0,0,0,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x60,
0x60,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x70,0x60,0x60,0x70,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x70,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x40,0,0x60,
0x60,0x60,0x60,0x70,0x60,0x40,0x40,0x60,0x60,0,0x70,0x60,0x60,0x70,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0x40,0,0x70,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x60,0x70,0x60,0x60,0x70,0x60,0x60,0x70,0x70,0x70,0x60,0x70,
0x70,0x60,0x70,0x60,0x60,0x60,0x70,0x60,0x70,0x60,0x70,0x60,0x70,0x60,0x60,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x60,
0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x60,0x40,0x40,0,0,0,0,0x40,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x60,0x60,0x60,0x60,0x40,0x60,0x60,0x60,0x60,0x60,
0x40,0x60,0x60,0x60,0x40,0x60,0x60,0x60,0x60,0x60,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x70,0x70,0x70,0,0,0,0,0x40,0x40,0x40,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,
0x70,0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0,0,
0,0x70,0,0,0,0x60,0x70,0x60,0x60,0x40,0x40,0x40,0,0,0,0,
0,0,0,0,0,0,0x40,0x40,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x40,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x70,0,0,0,0,0x40,0x40,0x40,0x40,0,0,0,
0,0,0,0,0,0x70,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x40,0x40,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0x40,0x40,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0x40,0x40,0,0,0,0,0x40,
0x40,0,0,0x40,0x40,0x70,0,0,0,0x40,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0,0,
0,0x40,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,
0x40,0x40,0,0x40,0x40,0,0,0,0,0x70,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x70,0,0,0x40,0,0x40,0x40,0x40,
0x40,0,0,0,0,0,0,0,0,0x70,0,0,0,0,0,0,
0,0,0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0,0,0,0,0,0,0,0,0,0,0,0,0x70,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0,0,0,0,0,0x40,0x40,0x40,0,0x40,0x40,0x40,0x70,0,0,
0,0,0,0,0,0x70,0x70,0,0,0,0,0,0,0,0,0,
0,0,0x40,0,0,0,0,0,0x40,0x70,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x70,0,
0,0,0,0,0,0,0x40,0x40,0x40,0,0x40,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,
0x40,0x40,0x40,0x40,0x70,0x70,0x70,0,0,0,0,0,0,0,0x40,0x40,
0x70,0x70,0x70,0x70,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0x40,0,0,0x40,0x40,0x40,0x40,
0x70,0x70,0,0x40,0x40,0,0,0,0,0,0,0,0,0,0x40,0,
0x70,0x70,0x70,0x70,0x40,0x40,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x70,0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0x70,0,0x70,0,0x70,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0x70,0x70,0x40,0x70,0x40,0x40,0x40,0x40,0x40,0x70,0x70,0x70,0x70,0x40,0,
0x70,0x40,0x60,0x60,0x70,0,0x60,0x60,0,0,0,0,0,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,
0,0,0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,
0x40,0,0x40,0x40,0x40,0x40,0x40,0x70,0,0x70,0x70,0,0,0x40,0x40,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x40,0x40,0,0,0,0,0x40,0x40,
0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x40,0,0,0x40,0x40,0,0,0,0,0,0,0x70,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,
0x139e,0x13be,0x13de,0x13fe,0x141e,0x143e,0x145e,0x147e,0x149e,0x14be,0x14de,0x14fe,0x151e,0x153e,0x155e,0x157e,
0x159e,0x15be,0x15de,0x15fe,0x161e,0x163e,0x165e,0x167e,0x169e,0x16be,0x16de,0x16fe,0x171e,0x173e,0x175e,0x177e,
0x179e,0x17be,0x17de,0x17fe,0x181e,0x183e,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x60,0x60,0x60,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x70,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0x40,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0,
0,0,0,0,0,0,0x40,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x70,0x40,0,0,0,0x40,0,0,0,0,0,0x60,0,0,
0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0x40,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x40,0x40,0x40,0,0,0,0,0x40,
0x40,0,0,0,0,0,0,0,0,0,0x40,0,0,0,0,0,
0,0x70,0x60,0x70,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0x60,0x70,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x40,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,
0x70,0,0x40,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0,0,
0,0,0,0x40,0x40,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0,0,0x70,
0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x70,0,0x40,0x40,0x40,0x40,0x40,0,0x40,0,0,0,0,0,0x40,0,
0x30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x60,
0x70,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0x40,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x40,0x40,0x40,0x40,0,0,0x40,0x40,0x30,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x70,0,0x40,0x40,0,0,0,0x40,0,0x40,
0x40,0x40,0x30,0x30,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0,0x40,0x70,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x60,0x60,0x60,0,
0x70,0x70,0x70,0x70,0x70,0x70,0x60,0x60,0x70,0x70,0x70,0x70,0x60,0,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0,0,0,0,0x70,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,0x949,0x949,0x949,0x949,
0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,
0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x11,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,0x949,0x185d,1,1,1,0x187d,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0x11,1,1,1,1,0x949,0x949,0x949,0x949,0x949,0x959,0x949,0x949,0x949,
0x959,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,
0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x949,0x60,0x60,0x70,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x70,0x60,0x60,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x70,0x70,0x60,0x70,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffd5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x189e,0x18dd,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x191d,0x199d,0x1a1d,0x1a9d,0x1b1d,0x1b9d,1,1,0x1bce,1,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffd5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x205,0x205,0x205,0x205,0x205,0x205,0x205,0x205,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,
0x205,0x205,0x205,0x205,0x205,0x205,0,0,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0,0,
0x205,0x205,0x205,0x205,0x205,0x205,0x205,0x205,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,
0x205,0x205,0x205,0x205,0x205,0x205,0x205,0x205,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,
0x205,0x205,0x205,0x205,0x205,0x205,0,0,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0,0,
0x1c1d,0x205,0x1c9d,0x205,0x1d4d,0x205,0x1dfd,0x205,0,0xfe06,0,0xfe06,0,0xfe06,0,0xfe06,
0x205,0x205,0x205,0x205,0x205,0x205,0x205,0x205,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,0xfe06,
0x1285,0x1285,0x1585,0x1585,0x1585,0x1585,0x1905,0x1905,0x2005,0x2005,0x1c05,0x1c05,0x1f85,0x1f85,0,0,
0x1ead,0x1f1d,0x1f8d,0x1ffd,0x206d,0x20dd,0x214d,0x21bd,0x222f,0x229f,0x230f,0x237f,0x23ef,0x245f,0x24cf,0x253f,
0x25ad,0x261d,0x268d,0x26fd,0x276d,0x27dd,0x284d,0x28bd,0x292f,0x299f,0x2a0f,0x2a7f,0x2aef,0x2b5f,0x2bcf,0x2c3f,
0x2cad,0x2d1d,0x2d8d,0x2dfd,0x2e6d,0x2edd,0x2f4d,0x2fbd,0x302f,0x309f,0x310f,0x317f,0x31ef,0x325f,0x32cf,0x333f,
0x205,0x205,0x33ad,0x342d,0x349d,0,0x351d,0x359d,0xfe06,0xfe06,0xed86,0xed86,0x364f,0x40,0x36bd,0x40,
0x40,0x40,0x370d,0x378d,0x37fd,0,0x387d,0x38fd,0xea86,0xea86,0xea86,0xea86,0x39af,0x40,0x40,0x40,
0x205,0x205,0x3a1d,0x3acd,0,0,0x3b9d,0x3c1d,0xfe06,0xfe06,0xe706,0xe706,0,0x40,0x40,0x40,
0x205,0x205,0x3ccd,0x3d7d,0x3e4d,0x1c5,0x3ecd,0x3f4d,0xfe06,0xfe06,0xe406,0xe406,0xfe46,0x40,0x40,0x40,
0,0,0x3ffd,0x407d,0x40ed,0,0x416d,0x41ed,0xe006,0xe006,0xe086,0xe086,0x429f,0x40,0x40,0,
0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40,0x40,
0,0,0,0,0,0,0,0,0x40,0x40,0,0,0,0,0,0,
0x40,0,0,0x40,0,0,0x40,0x40,0x40,0x40,0x40,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40,
0x40,0,0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0,0x50,0,0,
0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x949,0x949,0x949,0x949,
0x949,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x60,0x60,0x70,0x70,
0x60,0x60,0x60,0x60,0x70,0x70,0x70,0x60,0x60,0x40,0x40,0x40,0x40,0x60,0x40,0x40,
0x40,0x70,0x70,0x60,0x70,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x60,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,
0,0,0,2,0,0,1,2,2,2,1,1,2,2,2,1,
0,2,0,0,0,2,2,2,2,2,0,0,0,0,0,0,
2,0,0x430e,0,2,0,0x434e,0x438e,2,2,0,1,2,2,0x706,2,
1,0,0,0,0,1,0,0,1,1,2,2,0,0,0,0,
0,2,1,1,0x11,0x11,0,0,0,0,0xf905,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x406,0x406,0x406,0x406,
0x406,0x406,0x406,0x406,0x406,0x406,0x406,0x406,0x406,0x406,0x406,0x406,0xfc05,0xfc05,0xfc05,0xfc05,
0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0xfc05,0,0,0,0x46,
0xffc5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x686,0x686,
0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,0x686,
0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,0xf985,
0xf985,0xf985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,
0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,
0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0,0xf405,0xf405,0xf405,0xf405,
0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,
0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0,0x46,0xffc5,0x43ce,0x43ee,
0x440e,0x442d,0x444d,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x446e,0x448e,0x44ae,0x44ce,1,0x46,0xffc5,
1,0x46,0xffc5,1,1,1,1,1,0x11,0x949,0x44ee,0x450e,0x46,0xffc5,0x46,0xffc5,
1,0,0,0,0,0,0,0x46,0xffc5,0x46,0xffc5,0x60,0x60,0x60,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x452d,0x454d,0x456d,0x458d,
0x45ad,0x45cd,0x45ed,0x460d,0x462d,0x464d,0x466d,0x468d,0x46ad,0x46cd,0x46ed,0x470d,0x472d,0x474d,0x476d,0x478d,
0x47ad,0x47cd,0x47ed,0x480d,0x482d,0x484d,0x486d,0x488d,0x48ad,0x48cd,0x48ed,0x490d,0x492d,0x494d,0x496d,0x498d,
0x49ad,0x49cd,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x70,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0,0,0,0,0,0,0,0,0,0,0x70,0x70,0x70,0x70,0x70,0x70,
0,0x40,0x40,0x40,0x40,0x40,0,0,0,0,0,0x40,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x70,0x70,0x40,0x40,0x40,0x40,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x40,0x40,0x40,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0,0x60,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,
0x60,0x60,0,0x40,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x60,0x60,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,1,1,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x949,1,1,1,1,1,1,1,
1,0x46,0xffc5,0x46,0xffc5,0x49ee,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x40,0x40,0x40,0x46,0xffc5,0x4a0e,1,0,0x46,0xffc5,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
0,0,0,0,0,0,0x40,0,0,0,0x70,0,0,0,0,0x40,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x70,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x40,0x40,0x40,0x40,0x40,0x70,0x70,0x70,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0x30,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x70,
0,0,0x40,0x40,0x40,0x40,0,0,0x40,0,0,0,0x30,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,
0x40,0x40,0x40,0,0,0x40,0x40,0,0,0x40,0x40,0,0,0,0,0,
0,0,0,0,0,0,0,0x40,0,0,0,0,0,0,0,0,
0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x60,0,0x60,0x60,0x70,0,0,0x60,
0x60,0,0,0,0,0,0x60,0x60,0,0x60,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x40,0,0,0x40,0,0,0,0,0x70,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x4a2d,0x4aad,0x4b2d,0x4bad,0x4c5d,0x4d0d,0x4dad,0,0,0,0,0,0,0,0,0,
0,0,0,0x4e4d,0x4ecd,0x4f4d,0x4fcd,0x504d,0,0,0,0,0,0,0x70,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0,0,0,0x40,0,0,0,0,0,0,0,0,
0,0,0,0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x40,0,0,0x40,0,0,0,0,0,0,
0,0,0,0,0,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,
0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0,
0,0,0x40,0,0x40,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,
0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0,
0,0,0,0,0,0,0,0x40,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,
0,0,0,0,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,
0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,
0xa06,0xa06,0xa06,0xa06,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,
0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,
0,0x40,0x40,0,0,0,0,0,0x40,0x70,0x40,0x60,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x60,0x70,0x70,0,0,0,0,0x70,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40,0,
0,0x70,0x70,0,0,0x40,0,0,0,0,0,0,0,0x30,0x30,0x70,
0x70,0x70,0,0,0,0x30,0x30,0x30,0x30,0x30,0x30,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0,0,0x60,0x60,0x60,
0x60,0x60,0x70,0x70,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x60,0x60,0x60,0x60,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x60,0x60,0x60,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,
1,1,0x11,0x11,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,1,1,1,1,1,1,1,0,0x11,0x11,1,1,1,1,
1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,
1,1,1,1,1,1,0x11,0x11,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,2,0,2,2,0,0,2,0,
0,2,2,0,0,2,2,2,2,0,2,2,2,2,2,2,
2,2,1,1,1,1,0,1,0,1,0x11,0x11,1,1,1,1,
0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,
2,2,0,2,2,2,2,0,0,2,2,2,2,2,2,2,
2,0,2,2,2,2,2,2,2,0,1,1,1,1,1,1,
1,1,0x11,0x11,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,2,2,0,2,2,2,2,0,2,2,2,2,
2,0,2,0,0,0,2,2,2,2,2,2,2,0,1,1,
1,1,1,1,1,1,0x11,0x11,1,1,1,1,1,1,1,1,
1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,1,1,1,1,1,1,0,0,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,0,1,1,1,1,1,1,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
1,1,1,0,1,1,1,1,1,1,2,1,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0
};
static const uint16_t <API key>[1292]={
0xc041,0x69,2,0x130,0x131,0x4001,0x6a,0x41,0x6b,1,0x212a,0x41,0x73,1,0x17f,0x5044,
0x49,2,0x130,0x131,0x44,0x4b,1,0x212a,0x44,0x53,1,0x17f,6,0x3bc,0x39c,0x41,
0xe5,1,0x212b,0x4001,0xec,0x4001,0xed,0xc0,1,0x2220,0x73,0x73,0x53,0x53,0x53,0x73,
0x1e9e,0x44,0xc5,1,0x212b,0x4001,0x129,0x4001,0x12f,0xc041,0x69,2,0x131,0x49,0x44,0x49,
2,0x69,0x130,0x80,0x2220,0x2bc,0x6e,0x2bc,0x4e,0x2bc,0x4e,6,0x73,0x53,9,0x1c6,
0x1c5,0xd,0x1c6,0x1c4,0x1c5,0xc,0x1c4,0x1c5,9,0x1c9,0x1c8,0xd,0x1c9,0x1c7,0x1c8,0xc,
0x1c7,0x1c8,9,0x1cc,0x1cb,0xd,0x1cc,0x1ca,0x1cb,0xc,0x1ca,0x1cb,0x80,0x2220,0x6a,0x30c,
0x4a,0x30c,0x4a,0x30c,9,0x1f3,0x1f2,0xd,0x1f3,0x1f1,0x1f2,0xc,0x1f1,0x1f2,1,0x2c65,
1,0x2c66,4,0x2c7e,4,0x2c7f,4,0x2c6f,4,0x2c6d,4,0x2c70,4,0xa78d,4,0x2c62,
4,0x2c6e,4,0x2c64,0x800,0x1800,0x6800,0x3846,0x3b9,0x399,1,0x1fbe,0xc0,1,0x3330,0x3b9,
0x308,0x301,0x399,0x308,0x301,0x399,0x308,0x301,0x1fd3,0x41,0x3b2,1,0x3d0,0x41,0x3b5,1,
0x3f5,0x41,0x3b8,2,0x3d1,0x3f4,0x41,0x3b9,2,0x345,0x1fbe,0x41,0x3ba,1,0x3f0,0x41,
0x3bc,1,0xb5,0x41,0x3c0,1,0x3d6,0x41,0x3c1,1,0x3f1,0x4041,0x3c3,1,0x3c2,0x41,
0x3c6,1,0x3d5,0x41,0x3c9,1,0x2126,0xc0,1,0x3330,0x3c5,0x308,0x301,0x3a5,0x308,0x301,
0x3a5,0x308,0x301,0x1fe3,0x44,0x392,1,0x3d0,0x44,0x395,1,0x3f5,0x44,0x398,2,0x3d1,
0x3f4,0x44,0x399,2,0x345,0x1fbe,0x44,0x39a,1,0x3f0,0x44,0x39c,1,0xb5,0x44,0x3a0,
1,0x3d6,0x44,0x3a1,1,0x3f1,6,0x3c3,0x3a3,0x44,0x3a3,1,0x3c2,0x44,0x3a6,1,
0x3d5,0x44,0x3a9,1,0x2126,6,0x3b2,0x392,0x46,0x3b8,0x398,1,0x3f4,6,0x3c6,0x3a6,
6,0x3c0,0x3a0,6,0x3ba,0x39a,6,0x3c1,0x3a1,0x41,0x3b8,2,0x398,0x3d1,6,0x3b5,
0x395,0x80,0x2220,0x565,0x582,0x535,0x552,0x535,0x582,1,0x2d00,1,0x2d01,1,0x2d02,1,
0x2d03,1,0x2d04,1,0x2d05,1,0x2d06,1,0x2d07,1,0x2d08,1,0x2d09,1,0x2d0a,1,
0x2d0b,1,0x2d0c,1,0x2d0d,1,0x2d0e,1,0x2d0f,1,0x2d10,1,0x2d11,1,0x2d12,1,
0x2d13,1,0x2d14,1,0x2d15,1,0x2d16,1,0x2d17,1,0x2d18,1,0x2d19,1,0x2d1a,1,
0x2d1b,1,0x2d1c,1,0x2d1d,1,0x2d1e,1,0x2d1f,1,0x2d20,1,0x2d21,1,0x2d22,1,
0x2d23,1,0x2d24,1,0x2d25,4,0xa77d,4,0x2c63,0x41,0x1e61,1,0x1e9b,0x44,0x1e60,1,
0x1e9b,0x80,0x2220,0x68,0x331,0x48,0x331,0x48,0x331,0x80,0x2220,0x74,0x308,0x54,0x308,0x54,
0x308,0x80,0x2220,0x77,0x30a,0x57,0x30a,0x57,0x30a,0x80,0x2220,0x79,0x30a,0x59,0x30a,0x59,
0x30a,0x80,0x2220,0x61,0x2be,0x41,0x2be,0x41,0x2be,6,0x1e61,0x1e60,0x81,0xdf,0x20,0x73,
0x73,0x80,0x2220,0x3c5,0x313,0x3a5,0x313,0x3a5,0x313,0x80,0x3330,0x3c5,0x313,0x300,0x3a5,0x313,
0x300,0x3a5,0x313,0x300,0x80,0x3330,0x3c5,0x313,0x301,0x3a5,0x313,0x301,0x3a5,0x313,0x301,0x80,
0x3330,0x3c5,0x313,0x342,0x3a5,0x313,0x342,0x3a5,0x313,0x342,0x84,0x1f88,0x220,0x1f00,0x3b9,0x1f08,
0x399,0x84,0x1f89,0x220,0x1f01,0x3b9,0x1f09,0x399,0x84,0x1f8a,0x220,0x1f02,0x3b9,0x1f0a,0x399,0x84,
0x1f8b,0x220,0x1f03,0x3b9,0x1f0b,0x399,0x84,0x1f8c,0x220,0x1f04,0x3b9,0x1f0c,0x399,0x84,0x1f8d,0x220,
0x1f05,0x3b9,0x1f0d,0x399,0x84,0x1f8e,0x220,0x1f06,0x3b9,0x1f0e,0x399,0x84,0x1f8f,0x220,0x1f07,0x3b9,
0x1f0f,0x399,0x81,0x1f80,0x220,0x1f00,0x3b9,0x1f08,0x399,0x81,0x1f81,0x220,0x1f01,0x3b9,0x1f09,0x399,
0x81,0x1f82,0x220,0x1f02,0x3b9,0x1f0a,0x399,0x81,0x1f83,0x220,0x1f03,0x3b9,0x1f0b,0x399,0x81,0x1f84,
0x220,0x1f04,0x3b9,0x1f0c,0x399,0x81,0x1f85,0x220,0x1f05,0x3b9,0x1f0d,0x399,0x81,0x1f86,0x220,0x1f06,
0x3b9,0x1f0e,0x399,0x81,0x1f87,0x220,0x1f07,0x3b9,0x1f0f,0x399,0x84,0x1f98,0x220,0x1f20,0x3b9,0x1f28,
0x399,0x84,0x1f99,0x220,0x1f21,0x3b9,0x1f29,0x399,0x84,0x1f9a,0x220,0x1f22,0x3b9,0x1f2a,0x399,0x84,
0x1f9b,0x220,0x1f23,0x3b9,0x1f2b,0x399,0x84,0x1f9c,0x220,0x1f24,0x3b9,0x1f2c,0x399,0x84,0x1f9d,0x220,
0x1f25,0x3b9,0x1f2d,0x399,0x84,0x1f9e,0x220,0x1f26,0x3b9,0x1f2e,0x399,0x84,0x1f9f,0x220,0x1f27,0x3b9,
0x1f2f,0x399,0x81,0x1f90,0x220,0x1f20,0x3b9,0x1f28,0x399,0x81,0x1f91,0x220,0x1f21,0x3b9,0x1f29,0x399,
0x81,0x1f92,0x220,0x1f22,0x3b9,0x1f2a,0x399,0x81,0x1f93,0x220,0x1f23,0x3b9,0x1f2b,0x399,0x81,0x1f94,
0x220,0x1f24,0x3b9,0x1f2c,0x399,0x81,0x1f95,0x220,0x1f25,0x3b9,0x1f2d,0x399,0x81,0x1f96,0x220,0x1f26,
0x3b9,0x1f2e,0x399,0x81,0x1f97,0x220,0x1f27,0x3b9,0x1f2f,0x399,0x84,0x1fa8,0x220,0x1f60,0x3b9,0x1f68,
0x399,0x84,0x1fa9,0x220,0x1f61,0x3b9,0x1f69,0x399,0x84,0x1faa,0x220,0x1f62,0x3b9,0x1f6a,0x399,0x84,
0x1fab,0x220,0x1f63,0x3b9,0x1f6b,0x399,0x84,0x1fac,0x220,0x1f64,0x3b9,0x1f6c,0x399,0x84,0x1fad,0x220,
0x1f65,0x3b9,0x1f6d,0x399,0x84,0x1fae,0x220,0x1f66,0x3b9,0x1f6e,0x399,0x84,0x1faf,0x220,0x1f67,0x3b9,
0x1f6f,0x399,0x81,0x1fa0,0x220,0x1f60,0x3b9,0x1f68,0x399,0x81,0x1fa1,0x220,0x1f61,0x3b9,0x1f69,0x399,
0x81,0x1fa2,0x220,0x1f62,0x3b9,0x1f6a,0x399,0x81,0x1fa3,0x220,0x1f63,0x3b9,0x1f6b,0x399,0x81,0x1fa4,
0x220,0x1f64,0x3b9,0x1f6c,0x399,0x81,0x1fa5,0x220,0x1f65,0x3b9,0x1f6d,0x399,0x81,0x1fa6,0x220,0x1f66,
0x3b9,0x1f6e,0x399,0x81,0x1fa7,0x220,0x1f67,0x3b9,0x1f6f,0x399,0x80,0x2220,0x1f70,0x3b9,0x1fba,0x399,
0x1fba,0x345,0x84,0x1fbc,0x220,0x3b1,0x3b9,0x391,0x399,0x80,0x2220,0x3ac,0x3b9,0x386,0x399,0x386,
0x345,0x80,0x2220,0x3b1,0x342,0x391,0x342,0x391,0x342,0x80,0x3330,0x3b1,0x342,0x3b9,0x391,0x342,
0x399,0x391,0x342,0x345,0x81,0x1fb3,0x220,0x3b1,0x3b9,0x391,0x399,0x46,0x3b9,0x399,1,0x345,
0x80,0x2220,0x1f74,0x3b9,0x1fca,0x399,0x1fca,0x345,0x84,0x1fcc,0x220,0x3b7,0x3b9,0x397,0x399,0x80,
0x2220,0x3ae,0x3b9,0x389,0x399,0x389,0x345,0x80,0x2220,0x3b7,0x342,0x397,0x342,0x397,0x342,0x80,
0x3330,0x3b7,0x342,0x3b9,0x397,0x342,0x399,0x397,0x342,0x345,0x81,0x1fc3,0x220,0x3b7,0x3b9,0x397,
0x399,0x80,0x3330,0x3b9,0x308,0x300,0x399,0x308,0x300,0x399,0x308,0x300,0xc0,1,0x3330,0x3b9,
0x308,0x301,0x399,0x308,0x301,0x399,0x308,0x301,0x390,0x80,0x2220,0x3b9,0x342,0x399,0x342,0x399,
0x342,0x80,0x3330,0x3b9,0x308,0x342,0x399,0x308,0x342,0x399,0x308,0x342,0x80,0x3330,0x3c5,0x308,
0x300,0x3a5,0x308,0x300,0x3a5,0x308,0x300,0xc0,1,0x3330,0x3c5,0x308,0x301,0x3a5,0x308,0x301,
0x3a5,0x308,0x301,0x3b0,0x80,0x2220,0x3c1,0x313,0x3a1,0x313,0x3a1,0x313,0x80,0x2220,0x3c5,0x342,
0x3a5,0x342,0x3a5,0x342,0x80,0x3330,0x3c5,0x308,0x342,0x3a5,0x308,0x342,0x3a5,0x308,0x342,0x80,
0x2220,0x1f7c,0x3b9,0x1ffa,0x399,0x1ffa,0x345,0x84,0x1ffc,0x220,0x3c9,0x3b9,0x3a9,0x399,0x80,0x2220,
0x3ce,0x3b9,0x38f,0x399,0x38f,0x345,0x80,0x2220,0x3c9,0x342,0x3a9,0x342,0x3a9,0x342,0x80,0x3330,
0x3c9,0x342,0x3b9,0x3a9,0x342,0x399,0x3a9,0x342,0x345,0x81,0x1ff3,0x220,0x3c9,0x3b9,0x3a9,0x399,
0x41,0x3c9,1,0x3a9,0x41,0x6b,1,0x4b,0x41,0xe5,1,0xc5,1,0x26b,1,0x1d7d,
1,0x27d,4,0x23a,4,0x23e,1,0x251,1,0x271,1,0x250,1,0x252,1,0x23f,
1,0x240,4,0x10a0,4,0x10a1,4,0x10a2,4,0x10a3,4,0x10a4,4,0x10a5,4,0x10a6,
4,0x10a7,4,0x10a8,4,0x10a9,4,0x10aa,4,0x10ab,4,0x10ac,4,0x10ad,4,0x10ae,
4,0x10af,4,0x10b0,4,0x10b1,4,0x10b2,4,0x10b3,4,0x10b4,4,0x10b5,4,0x10b6,
4,0x10b7,4,0x10b8,4,0x10b9,4,0x10ba,4,0x10bb,4,0x10bc,4,0x10bd,4,0x10be,
4,0x10bf,4,0x10c0,4,0x10c1,4,0x10c2,4,0x10c3,4,0x10c4,4,0x10c5,1,0x1d79,
1,0x265,0x80,0x2220,0x66,0x66,0x46,0x46,0x46,0x66,0x80,0x2220,0x66,0x69,0x46,0x49,
0x46,0x69,0x80,0x2220,0x66,0x6c,0x46,0x4c,0x46,0x6c,0x80,0x3330,0x66,0x66,0x69,0x46,
0x46,0x49,0x46,0x66,0x69,0x80,0x3330,0x66,0x66,0x6c,0x46,0x46,0x4c,0x46,0x66,0x6c,
0xc0,1,0x2220,0x73,0x74,0x53,0x54,0x53,0x74,0xfb06,0xc0,1,0x2220,0x73,0x74,0x53,
0x54,0x53,0x74,0xfb05,0x80,0x2220,0x574,0x576,0x544,0x546,0x544,0x576,0x80,0x2220,0x574,0x565,
0x544,0x535,0x544,0x565,0x80,0x2220,0x574,0x56b,0x544,0x53b,0x544,0x56b,0x80,0x2220,0x57e,0x576,
0x54e,0x546,0x54e,0x576,0x80,0x2220,0x574,0x56d,0x544,0x53d,0x544,0x56d
};
static const uint16_t ucase_props_unfold[370]={
0x49,5,3,0,0,0x61,0x2be,0,0x1e9a,0,0x66,0x66,0,0xfb00,0,0x66,
0x66,0x69,0xfb03,0,0x66,0x66,0x6c,0xfb04,0,0x66,0x69,0,0xfb01,0,0x66,0x6c,
0,0xfb02,0,0x68,0x331,0,0x1e96,0,0x69,0x307,0,0x130,0,0x6a,0x30c,0,
0x1f0,0,0x73,0x73,0,0xdf,0x1e9e,0x73,0x74,0,0xfb05,0xfb06,0x74,0x308,0,0x1e97,
0,0x77,0x30a,0,0x1e98,0,0x79,0x30a,0,0x1e99,0,0x2bc,0x6e,0,0x149,0,
0x3ac,0x3b9,0,0x1fb4,0,0x3ae,0x3b9,0,0x1fc4,0,0x3b1,0x342,0,0x1fb6,0,0x3b1,
0x342,0x3b9,0x1fb7,0,0x3b1,0x3b9,0,0x1fb3,0x1fbc,0x3b7,0x342,0,0x1fc6,0,0x3b7,0x342,
0x3b9,0x1fc7,0,0x3b7,0x3b9,0,0x1fc3,0x1fcc,0x3b9,0x308,0x300,0x1fd2,0,0x3b9,0x308,0x301,
0x390,0x1fd3,0x3b9,0x308,0x342,0x1fd7,0,0x3b9,0x342,0,0x1fd6,0,0x3c1,0x313,0,0x1fe4,
0,0x3c5,0x308,0x300,0x1fe2,0,0x3c5,0x308,0x301,0x3b0,0x1fe3,0x3c5,0x308,0x342,0x1fe7,0,
0x3c5,0x313,0,0x1f50,0,0x3c5,0x313,0x300,0x1f52,0,0x3c5,0x313,0x301,0x1f54,0,0x3c5,
0x313,0x342,0x1f56,0,0x3c5,0x342,0,0x1fe6,0,0x3c9,0x342,0,0x1ff6,0,0x3c9,0x342,
0x3b9,0x1ff7,0,0x3c9,0x3b9,0,0x1ff3,0x1ffc,0x3ce,0x3b9,0,0x1ff4,0,0x565,0x582,0,
0x587,0,0x574,0x565,0,0xfb14,0,0x574,0x56b,0,0xfb15,0,0x574,0x56d,0,0xfb17,
0,0x574,0x576,0,0xfb13,0,0x57e,0x576,0,0xfb16,0,0x1f00,0x3b9,0,0x1f80,0x1f88,
0x1f01,0x3b9,0,0x1f81,0x1f89,0x1f02,0x3b9,0,0x1f82,0x1f8a,0x1f03,0x3b9,0,0x1f83,0x1f8b,0x1f04,
0x3b9,0,0x1f84,0x1f8c,0x1f05,0x3b9,0,0x1f85,0x1f8d,0x1f06,0x3b9,0,0x1f86,0x1f8e,0x1f07,0x3b9,
0,0x1f87,0x1f8f,0x1f20,0x3b9,0,0x1f90,0x1f98,0x1f21,0x3b9,0,0x1f91,0x1f99,0x1f22,0x3b9,0,
0x1f92,0x1f9a,0x1f23,0x3b9,0,0x1f93,0x1f9b,0x1f24,0x3b9,0,0x1f94,0x1f9c,0x1f25,0x3b9,0,0x1f95,
0x1f9d,0x1f26,0x3b9,0,0x1f96,0x1f9e,0x1f27,0x3b9,0,0x1f97,0x1f9f,0x1f60,0x3b9,0,0x1fa0,0x1fa8,
0x1f61,0x3b9,0,0x1fa1,0x1fa9,0x1f62,0x3b9,0,0x1fa2,0x1faa,0x1f63,0x3b9,0,0x1fa3,0x1fab,0x1f64,
0x3b9,0,0x1fa4,0x1fac,0x1f65,0x3b9,0,0x1fa5,0x1fad,0x1f66,0x3b9,0,0x1fa6,0x1fae,0x1f67,0x3b9,
0,0x1fa7,0x1faf,0x1f70,0x3b9,0,0x1fb2,0,0x1f74,0x3b9,0,0x1fc2,0,0x1f7c,0x3b9,0,
0x1ff2,0
};
static const UCaseProps <API key>={
NULL,
ucase_props_indexes,
<API key>,
ucase_props_unfold,
{
<API key>,
<API key>+2824,
NULL,
2824,
6524,
0x188,
0xb84,
0x0,
0x0,
0xe0800,
0x2480,
NULL, 0, FALSE, FALSE, 0, NULL
},
{ 2,0,0,0 }
}; |
package java.security;
/**
* This exception is thrown whenever a problem related to the management of
* security keys is encountered.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
* @see Key
* @status updated to 1.4
*/
public class <API key> extends KeyException
{
/**
* Compatible with JDK 1.1+.
*/
private static final long serialVersionUID = 947674216157062695L;
/**
* Create a new instance with no descriptive error message.
*/
public <API key>()
{
}
/**
* Create a new instance with a descriptive error message.
*
* @param msg the descriptive error message
*/
public <API key>(String msg)
{
super(msg);
}
/**
* Create a new instance with a descriptive error message and
* a cause.
* @param s the descriptive error message
* @param cause the cause
* @since 1.5
*/
public <API key>(String s, Throwable cause)
{
super(s, cause);
}
/**
* Create a new instance with a cause.
* @param cause the cause
* @since 1.5
*/
public <API key>(Throwable cause)
{
super(cause);
}
} |
#ifndef AD9389B_H
#define AD9389B_H
enum <API key> {
<API key>,
<API key>,
};
/* Platform dependent definitions */
struct <API key> {
enum <API key> tmds_pll_gear ;
/* Differential Data/Clock Output Drive Strength (reg. 0xa2/0xa3) */
u8 <API key>;
u8 <API key>;
};
/* notify events */
#define <API key> 0
#define AD9389B_EDID_DETECT 1
struct <API key> {
int present;
};
struct ad9389b_edid_detect {
int present;
int segment;
};
#endif |
#include <asm/bootinfo.h>
#include <loongson.h>
void __init prom_init_cmdline(void)
{
int prom_argc;
/* pmon passes arguments in 32bit pointers */
int *_prom_argv;
int i;
long l;
/* firmware arguments are initialized in head.S */
prom_argc = fw_arg0;
_prom_argv = (int *)fw_arg1;
/* arg[0] is "g", the rest is boot parameters */
arcs_cmdline[0] = '\0';
for (i = 1; i < prom_argc; i++) {
l = (long)_prom_argv[i];
if (strlen(arcs_cmdline) + strlen(((char *)l) + 1)
>= sizeof(arcs_cmdline))
break;
strcat(arcs_cmdline, ((char *)l));
strcat(arcs_cmdline, " ");
}
if ((strstr(arcs_cmdline, "console=")) == NULL)
strcat(arcs_cmdline, " console=ttyS0,115200");
if ((strstr(arcs_cmdline, "root=")) == NULL)
strcat(arcs_cmdline, " root=/dev/hda1");
prom_init_machtype();
} |
#ifndef <API key>
#define <API key>
#include <libxml/tree.h>
#include "xsltexports.h"
#include "xsltInternals.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Interfaces
*/
extern const xmlChar *xsltExtMarker;
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
xsltDocumentComp (xsltStylesheetPtr style,
xmlNodePtr inst,
<API key> function);
XSLTPUBFUN void XSLTCALL
xsltStylePreCompute (xsltStylesheetPtr style,
xmlNodePtr inst);
XSLTPUBFUN void XSLTCALL
<API key> (xsltStylesheetPtr style);
#ifdef __cplusplus
}
#endif
#endif /* <API key> */ |
var inst = require("../index").getInstance();
module.exports = inst.use("anim-node-plugin"); |
<!DOCTYPE html>
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<title>Side Menus</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
<script src="../../../../dist/js/ionic.bundle.js"></script>
</head>
<body>
<div>
<ion-nav-view></ion-nav-view>
</div>
<script id="event-menu.html" type="text/ng-template">
<ion-side-menus>
<<API key>>
<ion-nav-bar class="bar-positive">
<ion-nav-back-button class="button-icon icon ion-arrow-left-c"></ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>
</<API key>>
<ion-side-menu side="left">
<header class="bar bar-header bar-assertive">
<div class="title">Left Menu</div>
</header>
<ion-content class="has-header">
<div class="list">
<a nav-clear menu-close href="#/event/check-in" class="item">Check-in</a>
<a nav-clear menu-close href="#/event/attendees" class="item">Attendees</a>
<a nav-clear menu-close href="#/event/about" class="item">About</a>
<a nav-clear menu-close href="#/event/contact" class="item">Contact</a>
<a nav-clear menu-close href="#/event/home" class="item">Home</a>
<div class="item item-divider">
Range
</div>
<div class="range">
<i class="icon ion-volume-low"></i>
<input type="range" name="volume">
<i class="icon ion-volume-high"></i>
</div>
</div>
</ion-content>
</ion-side-menu>
<ion-side-menu side="right">
<header class="bar bar-header bar-royal">
<div class="title">Right Menu</div>
</header>
</ion-side-menu>
</ion-side-menus>
</script>
<script id="home.html" type="text/ng-template">
<ion-view title="Welcome">
<ion-nav-buttons side="left">
<button ng-click="toggleLeft()" class="button button-icon ion-navicon"></button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<button ng-click="toggleRight()" class="button button-icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content class="has-header" padding="true">
<p>Swipe to the right to reveal the left menu.</p>
<ion-list>
<div class="item item-input range range-positive">
<span class="input-label">Range</span>
5 km
<input type="range" min="5" max="700">
700 km
</div>
<ion-item item="item" ng-href="#" ng-click="itemClick()" ng-repeat="item in range">
<strong>{{$index}}</strong>
<b>:</b>
<em>
<span># <span>$ <span>W <span>Q</span></span></span></span>
<span>% <span>A <span>H <span>?</span></span></span></span>
<span>& <span>@ <span>* <span>X</span></span></span></span>
<span>j <span>p <span>q <span>y</span></span></span></span>
<span>{ <span>} <span>( <span>)</span></span></span></span>
<span><API key><span><API key></span></span>
</em>
</ion-item>
</ion-list>
<p>(On desktop click and drag from left to right)</p>
</ion-content>
</ion-view>
</script>
<script id="check-in.html" type="text/ng-template">
<ion-view title="Check-in" hide-back-button="true">
<ion-content class="has-header">
<form class="list" ng-show="showForm">
<div class="item item-divider">
Attendee Info
</div>
<label class="item item-input">
<input type="text" placeholder="First Name" ng-model="attendee.firstname">
</label>
<label class="item item-input">
<input type="text" placeholder="Last Name" ng-model="attendee.lastname">
</label>
<div class="item item-divider">
Shirt Size
</div>
<ion-radio ng-repeat="shirtSize in shirtSizes"
ng-value="shirtSize.value"
ng-model="attendee.shirtSize">
{{ shirtSize.text }}
</ion-radio>
<div class="item item-divider">
Lunch
</div>
<ion-toggle ng-model="attendee.vegetarian">
Vegetarian
</ion-toggle>
<div class="padding">
<button class="button button-block" ng-click="submit()">Checkin</button>
</div>
</form>
<div ng-hide="showForm">
<pre ng-bind="attendee | json"></pre>
<a href="#/event/attendees">View attendees</a>
</div>
</ion-content>
</ion-view>
</script>
<script id="attendees.html" type="text/ng-template">
<ion-view title="Attendees">
<ion-content class="has-header">
<div class="list">
<ion-toggle ng-repeat="attendee in attendees | orderBy:'firstname' | orderBy:'lastname'"
ng-model="attendee.arrived"
ng-change="arrivedChange(attendee)">
{{ attendee.firstname }}
{{ attendee.lastname }}
</ion-toggle>
<div class="item item-divider">
Activity
</div>
<div class="item" ng-repeat="msg in activity">
{{ msg }}
</div>
</div>
</ion-content>
</ion-view>
</script>
<script id="about.html" type="text/ng-template">
<ion-view title="About">
<ion-content class="has-header">
<h2>About us</h2>
<div class="list">
<a href="#/event/check-in" class="item">Check-in</a>
<a href="#/event/attendees" class="item">Attendees</a>
<a href="#/event/contact" class="item">Contact</a>
<a href="#/event/home" class="item">Home</a>
</div>
</ion-content>
</ion-view>
</script>
<script id="contact.html" type="text/ng-template">
<ion-view title="Contact">
<ion-content class="has-header">
<h2>Contact us</h2>
<div class="list">
<a href="#/event/check-in" class="item">Check-in</a>
<a href="#/event/attendees" class="item">Attendees</a>
<a href="#/event/about" class="item">About</a>
<a href="#/event/home" class="item">Home</a>
</div>
</ion-content>
</ion-view>
</script>
<script>
angular.module('ionicApp', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('eventmenu', {
url: "/event",
abstract: true,
templateUrl: "event-menu.html",
controller: 'MainCtrl'
})
.state('eventmenu.home', {
url: "/home",
views: {
'menuContent' :{
templateUrl: "home.html"
}
}
})
.state('eventmenu.checkin', {
url: "/check-in",
views: {
'menuContent' :{
templateUrl: "check-in.html",
controller: "CheckinCtrl"
}
}
})
.state('eventmenu.attendees', {
url: "/attendees",
views: {
'menuContent' :{
templateUrl: "attendees.html",
controller: "AttendeesCtrl"
}
}
})
.state('eventmenu.about', {
url: "/about",
views: {
'menuContent' :{
templateUrl: "about.html"
}
}
})
.state('eventmenu.contact', {
url: "/contact",
views: {
'menuContent' :{
templateUrl: "contact.html"
}
}
})
$urlRouterProvider.otherwise("/event/home");
})
.controller('MainCtrl', function($scope, $<API key>) {
$scope.closeMenu = function() {
$<API key>.toggleLeft(false);
};
$scope.toggleLeft = function() {
$<API key>.toggleLeft();
};
$scope.toggleRight = function() {
$<API key>.toggleRight();
};
$scope.range = [];
for (var i=0; i<100; i++) $scope.range.push(i);
$scope.attendees = [
{ firstname: 'Nicolas', lastname: 'Cage' },
{ firstname: 'Jean-Claude', lastname: 'Van Damme' },
{ firstname: 'Keanu', lastname: 'Reeves' },
{ firstname: 'Steven', lastname: 'Seagal' },
{ firstname: 'Jeff', lastname: 'Goldblum' },
{ firstname: 'Brendan', lastname: 'Fraser' }
];
})
.controller('CheckinCtrl', function($scope) {
$scope.showForm = true;
$scope.shirtSizes = [
{ text: 'Large', value: 'L' },
{ text: 'Medium', value: 'M' },
{ text: 'Small', value: 'S' }
];
$scope.attendee = {};
$scope.submit = function() {
if(!$scope.attendee.firstname) {
alert('Info required');
return;
}
$scope.showForm = false;
$scope.attendees.push($scope.attendee);
};
})
.controller('AttendeesCtrl', function($scope) {
$scope.activity = [];
$scope.arrivedChange = function(attendee) {
var msg = attendee.firstname + ' ' + attendee.lastname;
msg += (!attendee.arrived ? ' has arrived, ' : ' just left, ');
msg += new Date().getMilliseconds();
$scope.activity.push(msg);
if($scope.activity.length > 3) {
$scope.activity.splice(0, 1);
}
};
});
</script>
</body>
</html> |
<?php
// no direct access
defined('_JEXEC') or die;
// Include the syndicate functions only once
require_once dirname(__FILE__).'/helper.php';
$link = $params->get('link');
$folder = <API key>::getFolder($params);
$images = <API key>::getImages($params, $folder);
if (!count($images)) {
echo JText::_('<API key>');
return;
}
$image = <API key>::getRandomImage($params, $images);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
require JModuleHelper::getLayoutPath('mod_random_image', $params->get('layout', 'default')); |
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <net/ip.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/timer.h>
#include <linux/socket.h>
#include <linux/ctype.h>
#include <linux/inet.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <asm/system.h>
#include <asm/dma.h>
#include <linux/uaccess.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
#include <linux/igmp.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/smp.h>
#include <linux/if_ether.h>
#include <net/arp.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/if_bonding.h>
#include <linux/jiffies.h>
#include <linux/preempt.h>
#include <net/route.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/pkt_sched.h>
#include "bonding.h"
#include "bond_3ad.h"
#include "bond_alb.h"
/* monitor all links that often (in milliseconds). <=0 disables monitoring */
#define <API key> 0
#define <API key> 0
static int max_bonds = <API key>;
static int tx_queues = <API key>;
static int num_peer_notif = 1;
static int miimon = <API key>;
static int updelay;
static int downdelay;
static int use_carrier = 1;
static char *mode;
static char *primary;
static char *primary_reselect;
static char *lacp_rate;
static char *ad_select;
static char *xmit_hash_policy;
static int arp_interval = <API key>;
static char *arp_ip_target[<API key>];
static char *arp_validate;
static char *fail_over_mac;
static int all_slaves_active = 0;
static struct bond_params bonding_defaults;
static int resend_igmp = <API key>;
module_param(max_bonds, int, 0);
MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
module_param(tx_queues, int, 0);
MODULE_PARM_DESC(tx_queues, "Max number of transmit queues (default = 16)");
module_param_named(num_grat_arp, num_peer_notif, int, 0644);
MODULE_PARM_DESC(num_grat_arp, "Number of peer notifications to send on "
"failover event (alias of num_unsol_na)");
module_param_named(num_unsol_na, num_peer_notif, int, 0644);
MODULE_PARM_DESC(num_unsol_na, "Number of peer notifications to send on "
"failover event (alias of num_grat_arp)");
module_param(miimon, int, 0);
MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
module_param(updelay, int, 0);
MODULE_PARM_DESC(updelay, "Delay before considering link up, in milliseconds");
module_param(downdelay, int, 0);
MODULE_PARM_DESC(downdelay, "Delay before considering link down, "
"in milliseconds");
module_param(use_carrier, int, 0);
MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; "
"0 for off, 1 for on (default)");
module_param(mode, charp, 0);
MODULE_PARM_DESC(mode, "Mode of operation; 0 for balance-rr, "
"1 for active-backup, 2 for balance-xor, "
"3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, "
"6 for balance-alb");
module_param(primary, charp, 0);
MODULE_PARM_DESC(primary, "Primary network device to use");
module_param(primary_reselect, charp, 0);
MODULE_PARM_DESC(primary_reselect, "Reselect primary slave "
"once it comes up; "
"0 for always (default), "
"1 for only if speed of primary is "
"better, "
"2 for only on active slave "
"failure");
module_param(lacp_rate, charp, 0);
MODULE_PARM_DESC(lacp_rate, "LACPDU tx rate to request from 802.3ad partner; "
"0 for slow, 1 for fast");
module_param(ad_select, charp, 0);
MODULE_PARM_DESC(ad_select, "803.ad aggregation selection logic; "
"0 for stable (default), 1 for bandwidth, "
"2 for count");
module_param(xmit_hash_policy, charp, 0);
MODULE_PARM_DESC(xmit_hash_policy, "balance-xor and 802.3ad hashing method; "
"0 for layer 2 (default), 1 for layer 3+4, "
"2 for layer 2+3");
module_param(arp_interval, int, 0);
MODULE_PARM_DESC(arp_interval, "arp interval in milliseconds");
module_param_array(arp_ip_target, charp, NULL, 0);
MODULE_PARM_DESC(arp_ip_target, "arp targets in n.n.n.n form");
module_param(arp_validate, charp, 0);
MODULE_PARM_DESC(arp_validate, "validate src/dst of ARP probes; "
"0 for none (default), 1 for active, "
"2 for backup, 3 for all");
module_param(fail_over_mac, charp, 0);
MODULE_PARM_DESC(fail_over_mac, "For active-backup, do not set all slaves to "
"the same MAC; 0 for none (default), "
"1 for active, 2 for follow");
module_param(all_slaves_active, int, 0);
MODULE_PARM_DESC(all_slaves_active, "Keep all frames received on an interface"
"by setting active flag for all slaves; "
"0 for never (default), 1 for always.");
module_param(resend_igmp, int, 0);
MODULE_PARM_DESC(resend_igmp, "Number of IGMP membership reports to send on "
"link failure");
#ifdef <API key>
atomic_t netpoll_block_tx = ATOMIC_INIT(0);
#endif
int bond_net_id __read_mostly;
static __be32 arp_target[<API key>];
static int arp_ip_count;
static int bond_mode = <API key>;
static int xmit_hashtype = <API key>;
static int lacp_fast;
const struct bond_parm_tbl bond_lacp_tbl[] = {
{ "slow", AD_LACP_SLOW},
{ "fast", AD_LACP_FAST},
{ NULL, -1},
};
const struct bond_parm_tbl bond_mode_tbl[] = {
{ "balance-rr", <API key>},
{ "active-backup", <API key>},
{ "balance-xor", BOND_MODE_XOR},
{ "broadcast", BOND_MODE_BROADCAST},
{ "802.3ad", BOND_MODE_8023AD},
{ "balance-tlb", BOND_MODE_TLB},
{ "balance-alb", BOND_MODE_ALB},
{ NULL, -1},
};
const struct bond_parm_tbl xmit_hashtype_tbl[] = {
{ "layer2", <API key>},
{ "layer3+4", <API key>},
{ "layer2+3", <API key>},
{ NULL, -1},
};
const struct bond_parm_tbl arp_validate_tbl[] = {
{ "none", <API key>},
{ "active", <API key>},
{ "backup", <API key>},
{ "all", <API key>},
{ NULL, -1},
};
const struct bond_parm_tbl fail_over_mac_tbl[] = {
{ "none", BOND_FOM_NONE},
{ "active", BOND_FOM_ACTIVE},
{ "follow", BOND_FOM_FOLLOW},
{ NULL, -1},
};
const struct bond_parm_tbl pri_reselect_tbl[] = {
{ "always", <API key>},
{ "better", <API key>},
{ "failure", <API key>},
{ NULL, -1},
};
struct bond_parm_tbl ad_select_tbl[] = {
{ "stable", BOND_AD_STABLE},
{ "bandwidth", BOND_AD_BANDWIDTH},
{ "count", BOND_AD_COUNT},
{ NULL, -1},
};
static int bond_init(struct net_device *bond_dev);
static void bond_uninit(struct net_device *bond_dev);
const char *bond_mode_name(int mode)
{
static const char *names[] = {
[<API key>] = "load balancing (round-robin)",
[<API key>] = "fault-tolerance (active-backup)",
[BOND_MODE_XOR] = "load balancing (xor)",
[BOND_MODE_BROADCAST] = "fault-tolerance (broadcast)",
[BOND_MODE_8023AD] = "IEEE 802.3ad Dynamic link aggregation",
[BOND_MODE_TLB] = "transmit load balancing",
[BOND_MODE_ALB] = "adaptive load balancing",
};
if (mode < 0 || mode > BOND_MODE_ALB)
return "unknown";
return names[mode];
}
/**
* bond_add_vlan - add a new vlan id on bond
* @bond: bond that got the notification
* @vlan_id: the vlan id to add
*
* Returns -ENOMEM if allocation failed.
*/
static int bond_add_vlan(struct bonding *bond, unsigned short vlan_id)
{
struct vlan_entry *vlan;
pr_debug("bond: %s, vlan id %d\n",
(bond ? bond->dev->name : "None"), vlan_id);
vlan = kzalloc(sizeof(struct vlan_entry), GFP_KERNEL);
if (!vlan)
return -ENOMEM;
INIT_LIST_HEAD(&vlan->vlan_list);
vlan->vlan_id = vlan_id;
write_lock_bh(&bond->lock);
list_add_tail(&vlan->vlan_list, &bond->vlan_list);
write_unlock_bh(&bond->lock);
pr_debug("added VLAN ID %d on bond %s\n", vlan_id, bond->dev->name);
return 0;
}
/**
* bond_del_vlan - delete a vlan id from bond
* @bond: bond that got the notification
* @vlan_id: the vlan id to delete
*
* returns -ENODEV if @vlan_id was not found in @bond.
*/
static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id)
{
struct vlan_entry *vlan;
int res = -ENODEV;
pr_debug("bond: %s, vlan id %d\n", bond->dev->name, vlan_id);
block_netpoll_tx();
write_lock_bh(&bond->lock);
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
if (vlan->vlan_id == vlan_id) {
list_del(&vlan->vlan_list);
if (bond_is_lb(bond))
bond_alb_clear_vlan(bond, vlan_id);
pr_debug("removed VLAN ID %d from bond %s\n",
vlan_id, bond->dev->name);
kfree(vlan);
if (list_empty(&bond->vlan_list) &&
(bond->slave_cnt == 0)) {
/* Last VLAN removed and no slaves, so
* restore block on adding VLANs. This will
* be removed once new slaves that are not
* VLAN challenged will be added.
*/
bond->dev->features |= <API key>;
}
res = 0;
goto out;
}
}
pr_debug("couldn't find VLAN ID %d in bond %s\n",
vlan_id, bond->dev->name);
out:
write_unlock_bh(&bond->lock);
unblock_netpoll_tx();
return res;
}
/**
* bond_next_vlan - safely skip to the next item in the vlans list.
* @bond: the bond we're working on
* @curr: item we're advancing from
*
* Returns %NULL if list is empty, bond->next_vlan if @curr is %NULL,
* or @curr->next otherwise (even if it is @curr itself again).
*
* Caller must hold bond->lock
*/
struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr)
{
struct vlan_entry *next, *last;
if (list_empty(&bond->vlan_list))
return NULL;
if (!curr) {
next = list_entry(bond->vlan_list.next,
struct vlan_entry, vlan_list);
} else {
last = list_entry(bond->vlan_list.prev,
struct vlan_entry, vlan_list);
if (last == curr) {
next = list_entry(bond->vlan_list.next,
struct vlan_entry, vlan_list);
} else {
next = list_entry(curr->vlan_list.next,
struct vlan_entry, vlan_list);
}
}
return next;
}
/**
* bond_dev_queue_xmit - Prepare skb for xmit.
*
* @bond: bond device that got this skb for tx.
* @skb: hw accel VLAN tagged skb to transmit
* @slave_dev: slave that is supposed to xmit this skbuff
*/
int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
struct net_device *slave_dev)
{
skb->dev = slave_dev;
skb->priority = 1;
BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
sizeof(qdisc_skb_cb(skb)->bond_queue_mapping));
skb->queue_mapping = qdisc_skb_cb(skb)->bond_queue_mapping;
if (unlikely(netpoll_tx_running(slave_dev)))
<API key>(<API key>(bond, slave_dev), skb);
else
dev_queue_xmit(skb);
return 0;
}
/*
* In the following 3 functions, <API key>(), <API key>
* and <API key>, We don't protect the slave list iteration with a
* lock because:
* a. This operation is performed in IOCTL context,
* b. The operation is protected by the RTNL semaphore in the 8021q code,
* c. Holding a lock with BH disabled while directly calling a base driver
* entry point is generally a BAD idea.
*
* The design of synchronization/protection for this operation in the 8021q
* module is good for one or more VLAN devices over a single physical device
* and cannot be extended for a teaming solution like bonding, so there is a
* potential race condition here where a net device from the vlan group might
* be referenced (either by a base driver or the 8021q code) while it is being
* removed from the system. However, it turns out we're not making matters
* worse, and if it works for regular VLAN usage it will work here too.
*/
/**
* <API key> - Propagates registration to slaves
* @bond_dev: bonding net device that got called
* @grp: vlan group being registered
*/
static void <API key>(struct net_device *bond_dev,
struct vlan_group *grp)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
int i;
write_lock_bh(&bond->lock);
bond->vlgrp = grp;
write_unlock_bh(&bond->lock);
bond_for_each_slave(bond, slave, i) {
struct net_device *slave_dev = slave->dev;
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
if ((slave_dev->features & NETIF_F_HW_VLAN_RX) &&
slave_ops-><API key>) {
slave_ops-><API key>(slave_dev, grp);
}
}
}
/**
* <API key> - Propagates adding an id to slaves
* @bond_dev: bonding net device that got called
* @vid: vlan id being added
*/
static void <API key>(struct net_device *bond_dev, uint16_t vid)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
int i, res;
bond_for_each_slave(bond, slave, i) {
struct net_device *slave_dev = slave->dev;
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
if ((slave_dev->features & <API key>) &&
slave_ops->ndo_vlan_rx_add_vid) {
slave_ops->ndo_vlan_rx_add_vid(slave_dev, vid);
}
}
res = bond_add_vlan(bond, vid);
if (res) {
pr_err("%s: Error: Failed to add vlan id %d\n",
bond_dev->name, vid);
}
}
/**
* <API key> - Propagates deleting an id to slaves
* @bond_dev: bonding net device that got called
* @vid: vlan id being removed
*/
static void <API key>(struct net_device *bond_dev, uint16_t vid)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
struct net_device *vlan_dev;
int i, res;
bond_for_each_slave(bond, slave, i) {
struct net_device *slave_dev = slave->dev;
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
if ((slave_dev->features & <API key>) &&
slave_ops-><API key>) {
/* Save and then restore vlan_dev in the grp array,
* since the slave's driver might clear it.
*/
vlan_dev = <API key>(bond->vlgrp, vid);
slave_ops-><API key>(slave_dev, vid);
<API key>(bond->vlgrp, vid, vlan_dev);
}
}
res = bond_del_vlan(bond, vid);
if (res) {
pr_err("%s: Error: Failed to remove vlan id %d\n",
bond_dev->name, vid);
}
}
static void <API key>(struct bonding *bond, struct net_device *slave_dev)
{
struct vlan_entry *vlan;
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
if (!bond->vlgrp)
return;
if ((slave_dev->features & NETIF_F_HW_VLAN_RX) &&
slave_ops-><API key>)
slave_ops-><API key>(slave_dev, bond->vlgrp);
if (!(slave_dev->features & <API key>) ||
!(slave_ops->ndo_vlan_rx_add_vid))
return;
list_for_each_entry(vlan, &bond->vlan_list, vlan_list)
slave_ops->ndo_vlan_rx_add_vid(slave_dev, vlan->vlan_id);
}
static void <API key>(struct bonding *bond,
struct net_device *slave_dev)
{
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
struct vlan_entry *vlan;
struct net_device *vlan_dev;
if (!bond->vlgrp)
return;
if (!(slave_dev->features & <API key>) ||
!(slave_ops-><API key>))
goto unreg;
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
if (!vlan->vlan_id)
continue;
/* Save and then restore vlan_dev in the grp array,
* since the slave's driver might clear it.
*/
vlan_dev = <API key>(bond->vlgrp, vlan->vlan_id);
slave_ops-><API key>(slave_dev, vlan->vlan_id);
<API key>(bond->vlgrp, vlan->vlan_id, vlan_dev);
}
unreg:
if ((slave_dev->features & NETIF_F_HW_VLAN_RX) &&
slave_ops-><API key>)
slave_ops-><API key>(slave_dev, NULL);
}
/*
* Set the carrier state for the master according to the state of its
* slaves. If any slaves are up, the master is up. In 802.3ad mode,
* do special 802.3ad magic.
*
* Returns zero if carrier state does not change, nonzero if it does.
*/
static int bond_set_carrier(struct bonding *bond)
{
struct slave *slave;
int i;
if (bond->slave_cnt == 0)
goto down;
if (bond->params.mode == BOND_MODE_8023AD)
return <API key>(bond);
bond_for_each_slave(bond, slave, i) {
if (slave->link == BOND_LINK_UP) {
if (!netif_carrier_ok(bond->dev)) {
netif_carrier_on(bond->dev);
return 1;
}
return 0;
}
}
down:
if (netif_carrier_ok(bond->dev)) {
netif_carrier_off(bond->dev);
return 1;
}
return 0;
}
/*
* Get link speed and duplex from the slave's base driver
* using ethtool. If for some reason the call fails or the
* values are invalid, fake speed and duplex to 100/Full
* and return error.
*/
static int <API key>(struct slave *slave)
{
struct net_device *slave_dev = slave->dev;
struct ethtool_cmd etool = { .cmd = ETHTOOL_GSET };
u32 slave_speed;
int res;
/* Fake speed and duplex */
slave->speed = SPEED_100;
slave->duplex = DUPLEX_FULL;
if (!slave_dev->ethtool_ops || !slave_dev->ethtool_ops->get_settings)
return -1;
res = slave_dev->ethtool_ops->get_settings(slave_dev, &etool);
if (res < 0)
return -1;
slave_speed = ethtool_cmd_speed(&etool);
switch (slave_speed) {
case SPEED_10:
case SPEED_100:
case SPEED_1000:
case SPEED_10000:
break;
default:
return -1;
}
switch (etool.duplex) {
case DUPLEX_FULL:
case DUPLEX_HALF:
break;
default:
return -1;
}
slave->speed = slave_speed;
slave->duplex = etool.duplex;
return 0;
}
/*
* if <dev> supports MII link status reporting, check its link status.
*
* We either do MII/ETHTOOL ioctls, or check netif_carrier_ok(),
* depending upon the setting of the use_carrier parameter.
*
* Return either BMSR_LSTATUS, meaning that the link is up (or we
* can't tell and just pretend it is), or 0, meaning that the link is
* down.
*
* If reporting is non-zero, instead of faking link up, return -1 if
* both ETHTOOL and MII ioctls fail (meaning the device does not
* support them). If use_carrier is set, return whatever it says.
* It'd be nice if there was a good way to tell if a driver supports
* netif_carrier, but there really isn't.
*/
static int bond_check_dev_link(struct bonding *bond,
struct net_device *slave_dev, int reporting)
{
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
int (*ioctl)(struct net_device *, struct ifreq *, int);
struct ifreq ifr;
struct mii_ioctl_data *mii;
if (!reporting && !netif_running(slave_dev))
return 0;
if (bond->params.use_carrier)
return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
/* Try to get link status using Ethtool first. */
if (slave_dev->ethtool_ops) {
if (slave_dev->ethtool_ops->get_link) {
u32 link;
link = slave_dev->ethtool_ops->get_link(slave_dev);
return link ? BMSR_LSTATUS : 0;
}
}
/* Ethtool can't be used, fallback to MII ioctls. */
ioctl = slave_ops->ndo_do_ioctl;
if (ioctl) {
/* TODO: set pointer to correct ioctl on a per team member */
/* bases to make this more efficient. that is, once */
/* we determine the correct ioctl, we will always */
/* call it and not the others for that team */
/* member. */
/*
* We cannot assume that SIOCGMIIPHY will also read a
* register; not all network drivers (e.g., e100)
* support that.
*/
/* Yes, the mii is overlaid on the ifreq.ifr_ifru */
strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
mii = if_mii(&ifr);
if (IOCTL(slave_dev, &ifr, SIOCGMIIPHY) == 0) {
mii->reg_num = MII_BMSR;
if (IOCTL(slave_dev, &ifr, SIOCGMIIREG) == 0)
return mii->val_out & BMSR_LSTATUS;
}
}
/*
* If reporting, report that either there's no dev->do_ioctl,
* or both SIOCGMIIREG and get_link failed (meaning that we
* cannot report link status). If not reporting, pretend
* we're ok.
*/
return reporting ? -1 : BMSR_LSTATUS;
}
/*
* Push the promiscuity flag down to appropriate slaves
*/
static int <API key>(struct bonding *bond, int inc)
{
int err = 0;
if (USES_PRIMARY(bond->params.mode)) {
/* write lock already acquired */
if (bond->curr_active_slave) {
err = dev_set_promiscuity(bond->curr_active_slave->dev,
inc);
}
} else {
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i) {
err = dev_set_promiscuity(slave->dev, inc);
if (err)
return err;
}
}
return err;
}
/*
* Push the allmulti flag down to all slaves
*/
static int bond_set_allmulti(struct bonding *bond, int inc)
{
int err = 0;
if (USES_PRIMARY(bond->params.mode)) {
/* write lock already acquired */
if (bond->curr_active_slave) {
err = dev_set_allmulti(bond->curr_active_slave->dev,
inc);
}
} else {
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i) {
err = dev_set_allmulti(slave->dev, inc);
if (err)
return err;
}
}
return err;
}
/*
* Add a Multicast address to slaves
* according to mode
*/
static void bond_mc_add(struct bonding *bond, void *addr)
{
if (USES_PRIMARY(bond->params.mode)) {
/* write lock already acquired */
if (bond->curr_active_slave)
dev_mc_add(bond->curr_active_slave->dev, addr);
} else {
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i)
dev_mc_add(slave->dev, addr);
}
}
/*
* Remove a multicast address from slave
* according to mode
*/
static void bond_mc_del(struct bonding *bond, void *addr)
{
if (USES_PRIMARY(bond->params.mode)) {
/* write lock already acquired */
if (bond->curr_active_slave)
dev_mc_del(bond->curr_active_slave->dev, addr);
} else {
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i) {
dev_mc_del(slave->dev, addr);
}
}
}
static void <API key>(struct net_device *dev)
{
struct in_device *in_dev;
rcu_read_lock();
in_dev = __in_dev_get_rcu(dev);
if (in_dev)
ip_mc_rejoin_groups(in_dev);
rcu_read_unlock();
}
/*
* Retrieve the list of registered multicast addresses for the bonding
* device and retransmit an IGMP JOIN request to the current active
* slave.
*/
static void <API key>(struct bonding *bond)
{
struct net_device *vlan_dev;
struct vlan_entry *vlan;
read_lock(&bond->lock);
/* rejoin all groups on bond device */
<API key>(bond->dev);
/* rejoin all groups on vlan devices */
if (bond->vlgrp) {
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
vlan_dev = <API key>(bond->vlgrp,
vlan->vlan_id);
if (vlan_dev)
<API key>(vlan_dev);
}
}
if (--bond->igmp_retrans > 0)
queue_delayed_work(bond->wq, &bond->mcast_work, HZ/5);
read_unlock(&bond->lock);
}
static void <API key>(struct work_struct *work)
{
struct bonding *bond = container_of(work, struct bonding,
mcast_work.work);
<API key>(bond);
}
/*
* flush all members of flush->mc_list from device dev->mc_list
*/
static void bond_mc_list_flush(struct net_device *bond_dev,
struct net_device *slave_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct netdev_hw_addr *ha;
<API key>(ha, bond_dev)
dev_mc_del(slave_dev, ha->addr);
if (bond->params.mode == BOND_MODE_8023AD) {
/* del lacpdu mc addr from mc list */
u8 lacpdu_multicast[ETH_ALEN] = <API key>;
dev_mc_del(slave_dev, lacpdu_multicast);
}
}
/*
* Update the mc list and multicast-related flags for the new and
* old active slaves (if any) according to the multicast mode, and
* promiscuous flags unconditionally.
*/
static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
struct slave *old_active)
{
struct netdev_hw_addr *ha;
if (!USES_PRIMARY(bond->params.mode))
/* nothing to do - mc list is already up-to-date on
* all slaves
*/
return;
if (old_active) {
if (bond->dev->flags & IFF_PROMISC)
dev_set_promiscuity(old_active->dev, -1);
if (bond->dev->flags & IFF_ALLMULTI)
dev_set_allmulti(old_active->dev, -1);
<API key>(ha, bond->dev)
dev_mc_del(old_active->dev, ha->addr);
}
if (new_active) {
/* FIXME: Signal errors upstream. */
if (bond->dev->flags & IFF_PROMISC)
dev_set_promiscuity(new_active->dev, 1);
if (bond->dev->flags & IFF_ALLMULTI)
dev_set_allmulti(new_active->dev, 1);
<API key>(ha, bond->dev)
dev_mc_add(new_active->dev, ha->addr);
}
}
/*
* <API key>
*
* Perform special MAC address swapping for fail_over_mac settings
*
* Called with RTNL, bond->lock for read, curr_slave_lock for write_bh.
*/
static void <API key>(struct bonding *bond,
struct slave *new_active,
struct slave *old_active)
__releases(&bond->curr_slave_lock)
__releases(&bond->lock)
__acquires(&bond->lock)
__acquires(&bond->curr_slave_lock)
{
u8 tmp_mac[ETH_ALEN];
struct sockaddr saddr;
int rv;
switch (bond->params.fail_over_mac) {
case BOND_FOM_ACTIVE:
if (new_active)
memcpy(bond->dev->dev_addr, new_active->dev->dev_addr,
new_active->dev->addr_len);
break;
case BOND_FOM_FOLLOW:
/*
* if new_active && old_active, swap them
* if just old_active, do nothing (going to no active slave)
* if just new_active, set new_active to bond's MAC
*/
if (!new_active)
return;
write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);
if (old_active) {
memcpy(tmp_mac, new_active->dev->dev_addr, ETH_ALEN);
memcpy(saddr.sa_data, old_active->dev->dev_addr,
ETH_ALEN);
saddr.sa_family = new_active->dev->type;
} else {
memcpy(saddr.sa_data, bond->dev->dev_addr, ETH_ALEN);
saddr.sa_family = bond->dev->type;
}
rv = dev_set_mac_address(new_active->dev, &saddr);
if (rv) {
pr_err("%s: Error %d setting MAC of slave %s\n",
bond->dev->name, -rv, new_active->dev->name);
goto out;
}
if (!old_active)
goto out;
memcpy(saddr.sa_data, tmp_mac, ETH_ALEN);
saddr.sa_family = old_active->dev->type;
rv = dev_set_mac_address(old_active->dev, &saddr);
if (rv)
pr_err("%s: Error %d setting MAC of slave %s\n",
bond->dev->name, -rv, new_active->dev->name);
out:
read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock);
break;
default:
pr_err("%s: <API key> impossible: bad policy %d\n",
bond->dev->name, bond->params.fail_over_mac);
break;
}
}
static bool <API key>(struct bonding *bond)
{
struct slave *prim = bond->primary_slave;
struct slave *curr = bond->curr_active_slave;
if (!prim || !curr || curr->link != BOND_LINK_UP)
return true;
if (bond->force_primary) {
bond->force_primary = false;
return true;
}
if (bond->params.primary_reselect == <API key> &&
(prim->speed < curr->speed ||
(prim->speed == curr->speed && prim->duplex <= curr->duplex)))
return false;
if (bond->params.primary_reselect == <API key>)
return false;
return true;
}
/**
* find_best_interface - select the best available slave to be the active one
* @bond: our bonding struct
*
* Warning: Caller must hold curr_slave_lock for writing.
*/
static struct slave *<API key>(struct bonding *bond)
{
struct slave *new_active, *old_active;
struct slave *bestslave = NULL;
int mintime = bond->params.updelay;
int i;
new_active = bond->curr_active_slave;
if (!new_active) { /* there were no active slaves left */
if (bond->slave_cnt > 0) /* found one slave */
new_active = bond->first_slave;
else
return NULL; /* still no slave, return NULL */
}
if ((bond->primary_slave) &&
bond->primary_slave->link == BOND_LINK_UP &&
<API key>(bond)) {
new_active = bond->primary_slave;
}
/* remember where to stop iterating over the slaves */
old_active = new_active;
<API key>(bond, new_active, i, old_active) {
if (new_active->link == BOND_LINK_UP) {
return new_active;
} else if (new_active->link == BOND_LINK_BACK &&
IS_UP(new_active->dev)) {
/* link up, but waiting for stabilization */
if (new_active->delay < mintime) {
mintime = new_active->delay;
bestslave = new_active;
}
}
}
return bestslave;
}
static bool <API key>(struct bonding *bond)
{
struct slave *slave = bond->curr_active_slave;
pr_debug("<API key>: bond %s slave %s\n",
bond->dev->name, slave ? slave->dev->name : "NULL");
if (!slave || !bond->send_peer_notif ||
test_bit(<API key>, &slave->dev->state))
return false;
bond->send_peer_notif
return true;
}
/**
* <API key> - change the active slave into the specified one
* @bond: our bonding struct
* @new: the new slave to make the active one
*
* Set the new slave to the bond's settings and unset them on the old
* curr_active_slave.
* Setting include flags, mc-list, promiscuity, allmulti, etc.
*
* If @new's link state is %BOND_LINK_BACK we'll set it to %BOND_LINK_UP,
* because it is apparently the best available slave we have, even though its
* updelay hasn't timed out yet.
*
* If new_active is not NULL, caller must hold bond->lock for read and
* curr_slave_lock for write_bh.
*/
void <API key>(struct bonding *bond, struct slave *new_active)
{
struct slave *old_active = bond->curr_active_slave;
if (old_active == new_active)
return;
if (new_active) {
new_active->jiffies = jiffies;
if (new_active->link == BOND_LINK_BACK) {
if (USES_PRIMARY(bond->params.mode)) {
pr_info("%s: making interface %s the new active one %d ms earlier.\n",
bond->dev->name, new_active->dev->name,
(bond->params.updelay - new_active->delay) * bond->params.miimon);
}
new_active->delay = 0;
new_active->link = BOND_LINK_UP;
if (bond->params.mode == BOND_MODE_8023AD)
<API key>(new_active, BOND_LINK_UP);
if (bond_is_lb(bond))
<API key>(bond, new_active, BOND_LINK_UP);
} else {
if (USES_PRIMARY(bond->params.mode)) {
pr_info("%s: making interface %s the new active one.\n",
bond->dev->name, new_active->dev->name);
}
}
}
if (USES_PRIMARY(bond->params.mode))
bond_mc_swap(bond, new_active, old_active);
if (bond_is_lb(bond)) {
<API key>(bond, new_active);
if (old_active)
<API key>(old_active);
if (new_active)
<API key>(new_active);
} else {
bond->curr_active_slave = new_active;
}
if (bond->params.mode == <API key>) {
if (old_active)
<API key>(old_active);
if (new_active) {
bool should_notify_peers = false;
<API key>(new_active);
if (bond->params.fail_over_mac)
<API key>(bond, new_active,
old_active);
if (netif_running(bond->dev)) {
bond->send_peer_notif =
bond->params.num_peer_notif;
should_notify_peers =
<API key>(bond);
}
write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);
<API key>(bond->dev, <API key>);
if (should_notify_peers)
<API key>(bond->dev,
NETDEV_NOTIFY_PEERS);
read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock);
}
}
/* resend IGMP joins since active slave has changed or
* all were sent on curr_active_slave.
* resend only if bond is brought up with the affected
* bonding modes and the retransmission is enabled */
if (netif_running(bond->dev) && (bond->params.resend_igmp > 0) &&
((USES_PRIMARY(bond->params.mode) && new_active) ||
bond->params.mode == <API key>)) {
bond->igmp_retrans = bond->params.resend_igmp;
queue_delayed_work(bond->wq, &bond->mcast_work, 0);
}
}
/**
* <API key> - select a new active slave, if needed
* @bond: our bonding struct
*
* This functions should be called when one of the following occurs:
* - The old curr_active_slave has been released or lost its link.
* - The primary_slave has got its link back.
* - A slave has got its link back and there's no old curr_active_slave.
*
* Caller must hold bond->lock for read and curr_slave_lock for write_bh.
*/
void <API key>(struct bonding *bond)
{
struct slave *best_slave;
int rv;
best_slave = <API key>(bond);
if (best_slave != bond->curr_active_slave) {
<API key>(bond, best_slave);
rv = bond_set_carrier(bond);
if (!rv)
return;
if (netif_carrier_ok(bond->dev)) {
pr_info("%s: first active interface up!\n",
bond->dev->name);
} else {
pr_info("%s: now running without any active interface !\n",
bond->dev->name);
}
}
}
/*
* This function attaches the slave to the end of list.
*
* bond->lock held for writing by caller.
*/
static void bond_attach_slave(struct bonding *bond, struct slave *new_slave)
{
if (bond->first_slave == NULL) { /* attaching the first slave */
new_slave->next = new_slave;
new_slave->prev = new_slave;
bond->first_slave = new_slave;
} else {
new_slave->next = bond->first_slave;
new_slave->prev = bond->first_slave->prev;
new_slave->next->prev = new_slave;
new_slave->prev->next = new_slave;
}
bond->slave_cnt++;
}
/*
* This function detaches the slave from the list.
* WARNING: no check is made to verify if the slave effectively
* belongs to <bond>.
* Nothing is freed on return, structures are just unchained.
* If any slave pointer in bond was pointing to <slave>,
* it should be changed by the calling function.
*
* bond->lock held for writing by caller.
*/
static void bond_detach_slave(struct bonding *bond, struct slave *slave)
{
if (slave->next)
slave->next->prev = slave->prev;
if (slave->prev)
slave->prev->next = slave->next;
if (bond->first_slave == slave) { /* slave is the first slave */
if (bond->slave_cnt > 1) { /* there are more slave */
bond->first_slave = slave->next;
} else {
bond->first_slave = NULL; /* slave was the last one */
}
}
slave->next = NULL;
slave->prev = NULL;
bond->slave_cnt
}
#ifdef <API key>
static inline int <API key>(struct slave *slave)
{
struct netpoll *np;
int err = 0;
np = kzalloc(sizeof(*np), GFP_KERNEL);
err = -ENOMEM;
if (!np)
goto out;
np->dev = slave->dev;
strlcpy(np->dev_name, slave->dev->name, IFNAMSIZ);
err = __netpoll_setup(np);
if (err) {
kfree(np);
goto out;
}
slave->np = np;
out:
return err;
}
static inline void <API key>(struct slave *slave)
{
struct netpoll *np = slave->np;
if (!np)
return;
slave->np = NULL;
synchronize_rcu_bh();
__netpoll_cleanup(np);
kfree(np);
}
static inline bool <API key>(struct net_device *slave_dev)
{
if (slave_dev->priv_flags & IFF_DISABLE_NETPOLL)
return false;
if (!slave_dev->netdev_ops->ndo_poll_controller)
return false;
return true;
}
static void <API key>(struct net_device *bond_dev)
{
}
static void <API key>(struct bonding *bond)
{
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i)
if (IS_UP(slave->dev))
<API key>(slave);
}
static void <API key>(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
read_lock(&bond->lock);
<API key>(bond);
read_unlock(&bond->lock);
}
static int bond_netpoll_setup(struct net_device *dev, struct netpoll_info *ni)
{
struct bonding *bond = netdev_priv(dev);
struct slave *slave;
int i, err = 0;
read_lock(&bond->lock);
bond_for_each_slave(bond, slave, i) {
err = <API key>(slave);
if (err) {
<API key>(bond);
break;
}
}
read_unlock(&bond->lock);
return err;
}
static struct netpoll_info *bond_netpoll_info(struct bonding *bond)
{
return bond->dev->npinfo;
}
#else
static inline int <API key>(struct slave *slave)
{
return 0;
}
static inline void <API key>(struct slave *slave)
{
}
static void <API key>(struct net_device *bond_dev)
{
}
#endif
static int bond_sethwaddr(struct net_device *bond_dev,
struct net_device *slave_dev)
{
pr_debug("bond_dev=%p\n", bond_dev);
pr_debug("slave_dev=%p\n", slave_dev);
pr_debug("slave_dev->addr_len=%d\n", slave_dev->addr_len);
memcpy(bond_dev->dev_addr, slave_dev->dev_addr, slave_dev->addr_len);
return 0;
}
static u32 bond_fix_features(struct net_device *dev, u32 features)
{
struct slave *slave;
struct bonding *bond = netdev_priv(dev);
u32 mask;
int i;
read_lock(&bond->lock);
if (!bond->first_slave) {
/* Disable adding VLANs to empty bond. But why? --mq */
features |= <API key>;
goto out;
}
mask = features;
features &= ~NETIF_F_ONE_FOR_ALL;
features |= NETIF_F_ALL_FOR_ALL;
bond_for_each_slave(bond, slave, i) {
features = <API key>(features,
slave->dev->features,
mask);
}
out:
read_unlock(&bond->lock);
return features;
}
#define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
NETIF_F_HIGHDMA | NETIF_F_LRO)
static void <API key>(struct bonding *bond)
{
struct slave *slave;
struct net_device *bond_dev = bond->dev;
u32 vlan_features = BOND_VLAN_FEATURES;
unsigned short max_hard_header_len = ETH_HLEN;
unsigned int gso_max_size = GSO_MAX_SIZE;
u16 gso_max_segs = GSO_MAX_SEGS;
int i;
read_lock(&bond->lock);
if (!bond->first_slave)
goto done;
bond_for_each_slave(bond, slave, i) {
vlan_features = <API key>(vlan_features,
slave->dev->vlan_features, BOND_VLAN_FEATURES);
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;
gso_max_size = min(gso_max_size, slave->dev->gso_max_size);
gso_max_segs = min(gso_max_segs, slave->dev->gso_max_segs);
}
done:
bond_dev->vlan_features = vlan_features;
bond_dev->hard_header_len = max_hard_header_len;
bond_dev->gso_max_segs = gso_max_segs;
<API key>(bond_dev, gso_max_size);
read_unlock(&bond->lock);
<API key>(bond_dev);
}
static void bond_setup_by_slave(struct net_device *bond_dev,
struct net_device *slave_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
bond_dev->header_ops = slave_dev->header_ops;
bond_dev->type = slave_dev->type;
bond_dev->hard_header_len = slave_dev->hard_header_len;
bond_dev->addr_len = slave_dev->addr_len;
memcpy(bond_dev->broadcast, slave_dev->broadcast,
slave_dev->addr_len);
bond->setup_by_slave = 1;
}
/* On bonding slaves other than the currently active slave, suppress
* duplicates except for alb non-mcast/bcast.
*/
static bool <API key>(struct sk_buff *skb,
struct slave *slave,
struct bonding *bond)
{
if (<API key>(slave)) {
if (bond->params.mode == BOND_MODE_ALB &&
skb->pkt_type != PACKET_BROADCAST &&
skb->pkt_type != PACKET_MULTICAST)
return false;
return true;
}
return false;
}
static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
{
struct sk_buff *skb = *pskb;
struct slave *slave;
struct bonding *bond;
void (*recv_probe)(struct sk_buff *, struct bonding *,
struct slave *);
skb = skb_share_check(skb, GFP_ATOMIC);
if (unlikely(!skb))
return RX_HANDLER_CONSUMED;
*pskb = skb;
slave = bond_slave_get_rcu(skb->dev);
bond = slave->bond;
if (bond->params.arp_interval)
slave->dev->last_rx = jiffies;
recv_probe = ACCESS_ONCE(bond->recv_probe);
if (recv_probe) {
struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
if (likely(nskb)) {
recv_probe(nskb, bond, slave);
dev_kfree_skb(nskb);
}
}
if (<API key>(skb, slave, bond)) {
return RX_HANDLER_EXACT;
}
skb->dev = bond->dev;
if (bond->params.mode == BOND_MODE_ALB &&
bond->dev->priv_flags & IFF_BRIDGE_PORT &&
skb->pkt_type == PACKET_HOST) {
if (unlikely(skb_cow_head(skb,
skb->data - skb_mac_header(skb)))) {
kfree_skb(skb);
return RX_HANDLER_CONSUMED;
}
memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN);
}
return RX_HANDLER_ANOTHER;
}
/* enslave device <slave> to bond device <master> */
int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
struct slave *new_slave = NULL;
struct netdev_hw_addr *ha;
struct sockaddr addr;
int link_reporting;
int res = 0;
if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL &&
slave_ops->ndo_do_ioctl == NULL) {
pr_warning("%s: Warning: no link monitoring support for %s\n",
bond_dev->name, slave_dev->name);
}
/* already enslaved */
if (slave_dev->flags & IFF_SLAVE) {
pr_debug("Error, Device was already enslaved\n");
return -EBUSY;
}
/* vlan challenged mutual exclusion */
/* no need to lock since we're protected by rtnl_lock */
if (slave_dev->features & <API key>) {
pr_debug("%s: <API key>\n", slave_dev->name);
if (bond->vlgrp) {
pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n",
bond_dev->name, slave_dev->name, bond_dev->name);
return -EPERM;
} else {
pr_warning("%s: Warning: enslaved VLAN challenged slave %s. Adding VLANs will be blocked as long as %s is part of bond %s\n",
bond_dev->name, slave_dev->name,
slave_dev->name, bond_dev->name);
}
} else {
pr_debug("%s: ! <API key>\n", slave_dev->name);
}
/*
* Old ifenslave binaries are no longer supported. These can
* be identified with moderate accuracy by the state of the slave:
* the current ifenslave will set the interface down prior to
* enslaving it; the old ifenslave will not.
*/
if ((slave_dev->flags & IFF_UP)) {
pr_err("%s is up. This may be due to an out of date ifenslave.\n",
slave_dev->name);
res = -EPERM;
goto err_undo_flags;
}
/* set bonding device ether type by slave - bonding netdevices are
* created with ether_setup, so when the slave type is not ARPHRD_ETHER
* there is a need to override some of the type dependent attribs/funcs.
*
* bond ether type mutual exclusion - don't allow slaves of dissimilar
* ether type (eg ARPHRD_ETHER and ARPHRD_INFINIBAND) share the same bond
*/
if (bond->slave_cnt == 0) {
if (bond_dev->type != slave_dev->type) {
pr_debug("%s: change device type from %d to %d\n",
bond_dev->name,
bond_dev->type, slave_dev->type);
res = <API key>(bond_dev,
<API key>);
res = notifier_to_errno(res);
if (res) {
pr_err("%s: refused to change device type\n",
bond_dev->name);
res = -EBUSY;
goto err_undo_flags;
}
/* Flush unicast and multicast addresses */
dev_uc_flush(bond_dev);
dev_mc_flush(bond_dev);
if (slave_dev->type != ARPHRD_ETHER)
bond_setup_by_slave(bond_dev, slave_dev);
else {
ether_setup(bond_dev);
bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
}
<API key>(bond_dev,
<API key>);
}
} else if (bond_dev->type != slave_dev->type) {
pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
slave_dev->name,
slave_dev->type, bond_dev->type);
res = -EINVAL;
goto err_undo_flags;
}
if (slave_ops->ndo_set_mac_address == NULL) {
if (bond->slave_cnt == 0) {
pr_warning("%s: Warning: The first slave device specified does not support setting the MAC address. Setting fail_over_mac to active.",
bond_dev->name);
bond->params.fail_over_mac = BOND_FOM_ACTIVE;
} else if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
pr_err("%s: Error: The slave device specified does not support setting the MAC address, but fail_over_mac is not set to active.\n",
bond_dev->name);
res = -EOPNOTSUPP;
goto err_undo_flags;
}
}
<API key>(NETDEV_JOIN, slave_dev);
/* If this is the first slave, then we need to set the master's hardware
* address to be the same as the slave's. */
if (is_zero_ether_addr(bond->dev->dev_addr))
memcpy(bond->dev->dev_addr, slave_dev->dev_addr,
slave_dev->addr_len);
new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
if (!new_slave) {
res = -ENOMEM;
goto err_undo_flags;
}
/*
* Set the new_slave's queue_id to be zero. Queue ID mapping
* is set via sysfs or module option if desired.
*/
new_slave->queue_id = 0;
/* Save slave's original mtu and then set it to match the bond */
new_slave->original_mtu = slave_dev->mtu;
res = dev_set_mtu(slave_dev, bond->dev->mtu);
if (res) {
pr_debug("Error %d calling dev_set_mtu\n", res);
goto err_free;
}
/*
* Save slave's original ("permanent") mac address for modes
* that need it, and for restoring it upon release, and then
* set it to the master's address
*/
memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN);
if (!bond->params.fail_over_mac) {
/*
* Set slave to master's mac address. The application already
* set the master's mac address to that of the first slave
*/
memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
addr.sa_family = slave_dev->type;
res = dev_set_mac_address(slave_dev, &addr);
if (res) {
pr_debug("Error %d calling set_mac_address\n", res);
goto err_restore_mtu;
}
}
res = <API key>(slave_dev, bond_dev);
if (res) {
pr_debug("Error %d calling <API key>\n", res);
goto err_restore_mac;
}
/* open the slave since the application closed it */
res = dev_open(slave_dev);
if (res) {
pr_debug("Opening slave %s failed\n", slave_dev->name);
goto err_unset_master;
}
new_slave->bond = bond;
new_slave->dev = slave_dev;
slave_dev->priv_flags |= IFF_BONDING;
if (bond_is_lb(bond)) {
/* bond_alb_init_slave() must be called before all other stages since
* it might fail and we do not want to have to undo everything
*/
res = bond_alb_init_slave(bond, new_slave);
if (res)
goto err_close;
}
/* If the mode USES_PRIMARY, then the new slave gets the
* master's promisc (and mc) settings only if it becomes the
* curr_active_slave, and that is taken care of later when calling
* bond_change_active()
*/
if (!USES_PRIMARY(bond->params.mode)) {
/* set promiscuity level to new slave */
if (bond_dev->flags & IFF_PROMISC) {
res = dev_set_promiscuity(slave_dev, 1);
if (res)
goto err_close;
}
/* set allmulti level to new slave */
if (bond_dev->flags & IFF_ALLMULTI) {
res = dev_set_allmulti(slave_dev, 1);
if (res)
goto err_close;
}
netif_addr_lock_bh(bond_dev);
/* upload master's mc_list to new slave */
<API key>(ha, bond_dev)
dev_mc_add(slave_dev, ha->addr);
<API key>(bond_dev);
}
if (bond->params.mode == BOND_MODE_8023AD) {
/* add lacpdu mc addr to mc list */
u8 lacpdu_multicast[ETH_ALEN] = <API key>;
dev_mc_add(slave_dev, lacpdu_multicast);
}
<API key>(bond, slave_dev);
write_lock_bh(&bond->lock);
bond_attach_slave(bond, new_slave);
new_slave->delay = 0;
new_slave->link_failure_count = 0;
write_unlock_bh(&bond->lock);
<API key>(bond);
read_lock(&bond->lock);
new_slave->last_arp_rx = jiffies;
if (bond->params.miimon && !bond->params.use_carrier) {
link_reporting = bond_check_dev_link(bond, slave_dev, 1);
if ((link_reporting == -1) && !bond->params.arp_interval) {
/*
* miimon is set but a bonded network driver
* does not support ETHTOOL/MII and
* arp_interval is not set. Note: if
* use_carrier is enabled, we will never go
* here (because netif_carrier is always
* supported); thus, we don't need to change
* the messages for netif_carrier.
*/
pr_warning("%s: Warning: MII and ETHTOOL support not available for interface %s, and arp_interval/arp_ip_target module parameters not specified, thus bonding will not detect link failures! see bonding.txt for details.\n",
bond_dev->name, slave_dev->name);
} else if (link_reporting == -1) {
/* unable get link status using mii/ethtool */
pr_warning("%s: Warning: can't get link status from interface %s; the network driver associated with this interface does not support MII or ETHTOOL link status reporting, thus miimon has no effect on this interface.\n",
bond_dev->name, slave_dev->name);
}
}
/* check for initial state */
if (!bond->params.miimon ||
(bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) {
if (bond->params.updelay) {
pr_debug("Initial state of slave_dev is BOND_LINK_BACK\n");
new_slave->link = BOND_LINK_BACK;
new_slave->delay = bond->params.updelay;
} else {
pr_debug("Initial state of slave_dev is BOND_LINK_UP\n");
new_slave->link = BOND_LINK_UP;
}
new_slave->jiffies = jiffies;
} else {
pr_debug("Initial state of slave_dev is BOND_LINK_DOWN\n");
new_slave->link = BOND_LINK_DOWN;
}
if (<API key>(new_slave) &&
(new_slave->link != BOND_LINK_DOWN)) {
pr_warning("%s: Warning: failed to get speed and duplex from %s, assumed to be 100Mb/sec and Full.\n",
bond_dev->name, new_slave->dev->name);
if (bond->params.mode == BOND_MODE_8023AD) {
pr_warning("%s: Warning: Operation of 802.3ad mode requires ETHTOOL support in base driver for proper aggregator selection.\n",
bond_dev->name);
}
}
if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) {
/* if there is a primary slave, remember it */
if (strcmp(bond->params.primary, new_slave->dev->name) == 0) {
bond->primary_slave = new_slave;
bond->force_primary = true;
}
}
write_lock_bh(&bond->curr_slave_lock);
switch (bond->params.mode) {
case <API key>:
<API key>(new_slave);
<API key>(bond);
break;
case BOND_MODE_8023AD:
/* in 802.3ad mode, the internal mechanism
* will activate the slaves in the selected
* aggregator
*/
<API key>(new_slave);
/* if this is the first slave */
if (bond->slave_cnt == 1) {
SLAVE_AD_INFO(new_slave).id = 1;
/* Initialize AD with the number of times that the AD timer is called in 1 second
* can be called only after the mac address of the bond is set
*/
bond_3ad_initialize(bond, 1000/AD_TIMER_INTERVAL,
bond->params.lacp_fast);
} else {
SLAVE_AD_INFO(new_slave).id =
SLAVE_AD_INFO(new_slave->prev).id + 1;
}
bond_3ad_bind_slave(new_slave);
break;
case BOND_MODE_TLB:
case BOND_MODE_ALB:
<API key>(new_slave);
<API key>(new_slave);
<API key>(bond);
break;
default:
pr_debug("This slave is always active in trunk mode\n");
/* always active in trunk mode */
<API key>(new_slave);
/* In trunking mode there is little meaning to curr_active_slave
* anyway (it holds no special properties of the bond device),
* so we can change it without calling <API key>()
*/
if (!bond->curr_active_slave)
bond->curr_active_slave = new_slave;
break;
} /* switch(bond_mode) */
write_unlock_bh(&bond->curr_slave_lock);
bond_set_carrier(bond);
#ifdef <API key>
slave_dev->npinfo = bond_netpoll_info(bond);
if (slave_dev->npinfo) {
if (<API key>(new_slave)) {
read_unlock(&bond->lock);
pr_info("Error, %s: master_dev is using netpoll, "
"but new slave device does not support netpoll.\n",
bond_dev->name);
res = -EBUSY;
goto err_detach;
}
}
#endif
read_unlock(&bond->lock);
res = <API key>(bond_dev, slave_dev);
if (res)
goto err_detach;
res = <API key>(slave_dev, bond_handle_frame,
new_slave);
if (res) {
pr_debug("Error %d calling <API key>\n", res);
goto err_dest_symlinks;
}
pr_info("%s: enslaving %s as a%s interface with a%s link.\n",
bond_dev->name, slave_dev->name,
<API key>(new_slave) ? "n active" : " backup",
new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
/* enslave is successful */
return 0;
/* Undo stages on error */
err_dest_symlinks:
<API key>(bond_dev, slave_dev);
err_detach:
write_lock_bh(&bond->lock);
bond_detach_slave(bond, new_slave);
write_unlock_bh(&bond->lock);
err_close:
slave_dev->priv_flags &= ~IFF_BONDING;
dev_close(slave_dev);
err_unset_master:
<API key>(slave_dev, NULL);
err_restore_mac:
if (!bond->params.fail_over_mac) {
/* XXX TODO - fom follow mode needs to change master's
* MAC if this slave's MAC is in use by the bond, or at
* least print a warning.
*/
memcpy(addr.sa_data, new_slave->perm_hwaddr, ETH_ALEN);
addr.sa_family = slave_dev->type;
dev_set_mac_address(slave_dev, &addr);
}
err_restore_mtu:
dev_set_mtu(slave_dev, new_slave->original_mtu);
err_free:
kfree(new_slave);
err_undo_flags:
<API key>(bond);
return res;
}
int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *oldcurrent;
struct sockaddr addr;
int old_flags = bond_dev->flags;
u32 old_features = bond_dev->features;
/* slave is not a slave or master is not master of this slave */
if (!(slave_dev->flags & IFF_SLAVE) ||
(slave_dev->master != bond_dev)) {
pr_err("%s: Error: cannot release %s.\n",
bond_dev->name, slave_dev->name);
return -EINVAL;
}
block_netpoll_tx();
<API key>(bond_dev, NETDEV_RELEASE);
write_lock_bh(&bond->lock);
slave = <API key>(bond, slave_dev);
if (!slave) {
/* not a slave of this bond */
pr_info("%s: %s not enslaved\n",
bond_dev->name, slave_dev->name);
write_unlock_bh(&bond->lock);
unblock_netpoll_tx();
return -EINVAL;
}
write_unlock_bh(&bond->lock);
/* unregister rx_handler early so bond_handle_frame wouldn't be called
* for this slave anymore.
*/
<API key>(slave_dev);
write_lock_bh(&bond->lock);
if (!bond->params.fail_over_mac) {
if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
bond->slave_cnt > 1)
pr_warning("%s: Warning: the permanent HWaddr of %s - %pM - is still in use by %s. Set the HWaddr of %s to a different address to avoid conflicts.\n",
bond_dev->name, slave_dev->name,
slave->perm_hwaddr,
bond_dev->name, slave_dev->name);
}
/* Inform AD package of unbinding of slave. */
if (bond->params.mode == BOND_MODE_8023AD) {
/* must be called before the slave is
* detached from the list
*/
<API key>(slave);
}
pr_info("%s: releasing %s interface %s\n",
bond_dev->name,
<API key>(slave) ? "active" : "backup",
slave_dev->name);
oldcurrent = bond->curr_active_slave;
bond->current_arp_slave = NULL;
/* release the slave from its bond */
bond_detach_slave(bond, slave);
if (bond->primary_slave == slave)
bond->primary_slave = NULL;
if (oldcurrent == slave)
<API key>(bond, NULL);
if (bond_is_lb(bond)) {
/* Must be called only after the slave has been
* detached from the list and the curr_active_slave
* has been cleared (if our_slave == old_current),
* but before a new active slave is selected.
*/
write_unlock_bh(&bond->lock);
<API key>(bond, slave);
write_lock_bh(&bond->lock);
}
if (oldcurrent == slave) {
/*
* Note that we hold RTNL over this sequence, so there
* is no concern that another slave add/remove event
* will interfere.
*/
write_unlock_bh(&bond->lock);
read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock);
<API key>(bond);
write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);
write_lock_bh(&bond->lock);
}
if (bond->slave_cnt == 0) {
bond_set_carrier(bond);
/* if the last slave was removed, zero the mac address
* of the master so it will be set by the application
* to the mac address of the first slave
*/
memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
if (bond->vlgrp) {
pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
bond_dev->name, bond_dev->name);
pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
bond_dev->name);
}
}
write_unlock_bh(&bond->lock);
unblock_netpoll_tx();
<API key>(bond);
if (!(bond_dev->features & <API key>) &&
(old_features & <API key>))
pr_info("%s: last VLAN challenged slave %s left bond %s. VLAN blocking is removed\n",
bond_dev->name, slave_dev->name, bond_dev->name);
/* must do this from outside any spinlocks */
<API key>(bond_dev, slave_dev);
<API key>(bond, slave_dev);
/* If the mode USES_PRIMARY, then we should only remove its
* promisc and mc settings if it was the curr_active_slave, but that was
* already taken care of above when we detached the slave
*/
if (!USES_PRIMARY(bond->params.mode)) {
/* unset promiscuity level from slave
* NOTE: The NETDEV_CHANGEADDR call above may change the value
* of the IFF_PROMISC flag in the bond_dev, but we need the
* value of that flag before that change, as that was the value
* when this slave was attached, so we cache at the start of the
* function and use it here. Same goes for ALLMULTI below
*/
if (old_flags & IFF_PROMISC)
dev_set_promiscuity(slave_dev, -1);
/* unset allmulti level from slave */
if (old_flags & IFF_ALLMULTI)
dev_set_allmulti(slave_dev, -1);
/* flush master's mc_list from slave */
netif_addr_lock_bh(bond_dev);
bond_mc_list_flush(bond_dev, slave_dev);
<API key>(bond_dev);
}
<API key>(slave_dev, NULL);
<API key>(slave);
/* close slave before restoring its mac address */
dev_close(slave_dev);
if (bond->params.fail_over_mac != BOND_FOM_ACTIVE) {
/* restore original ("permanent") mac address */
memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN);
addr.sa_family = slave_dev->type;
dev_set_mac_address(slave_dev, &addr);
}
dev_set_mtu(slave_dev, slave->original_mtu);
slave_dev->priv_flags &= ~IFF_BONDING;
kfree(slave);
return 0; /* deletion OK */
}
/*
* First release a slave and then destroy the bond if no more slaves are left.
* Must be under rtnl_lock when this function is called.
*/
static int <API key>(struct net_device *bond_dev,
struct net_device *slave_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
int ret;
ret = bond_release(bond_dev, slave_dev);
if ((ret == 0) && (bond->slave_cnt == 0)) {
bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
pr_info("%s: destroying bond %s.\n",
bond_dev->name, bond_dev->name);
<API key>(bond_dev);
}
return ret;
}
/*
* This function releases all slaves.
*/
static int bond_release_all(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
struct net_device *slave_dev;
struct sockaddr addr;
write_lock_bh(&bond->lock);
netif_carrier_off(bond_dev);
if (bond->slave_cnt == 0)
goto out;
bond->current_arp_slave = NULL;
bond->primary_slave = NULL;
<API key>(bond, NULL);
while ((slave = bond->first_slave) != NULL) {
/* Inform AD package of unbinding of slave
* before slave is detached from the list.
*/
if (bond->params.mode == BOND_MODE_8023AD)
<API key>(slave);
slave_dev = slave->dev;
bond_detach_slave(bond, slave);
/* now that the slave is detached, unlock and perform
* all the undo steps that should not be called from
* within a lock.
*/
write_unlock_bh(&bond->lock);
/* unregister rx_handler early so bond_handle_frame wouldn't
* be called for this slave anymore.
*/
<API key>(slave_dev);
synchronize_net();
if (bond_is_lb(bond)) {
/* must be called only after the slave
* has been detached from the list
*/
<API key>(bond, slave);
}
<API key>(bond_dev, slave_dev);
<API key>(bond, slave_dev);
/* If the mode USES_PRIMARY, then we should only remove its
* promisc and mc settings if it was the curr_active_slave, but that was
* already taken care of above when we detached the slave
*/
if (!USES_PRIMARY(bond->params.mode)) {
/* unset promiscuity level from slave */
if (bond_dev->flags & IFF_PROMISC)
dev_set_promiscuity(slave_dev, -1);
/* unset allmulti level from slave */
if (bond_dev->flags & IFF_ALLMULTI)
dev_set_allmulti(slave_dev, -1);
/* flush master's mc_list from slave */
netif_addr_lock_bh(bond_dev);
bond_mc_list_flush(bond_dev, slave_dev);
<API key>(bond_dev);
}
<API key>(slave_dev, NULL);
<API key>(slave);
/* close slave before restoring its mac address */
dev_close(slave_dev);
if (!bond->params.fail_over_mac) {
/* restore original ("permanent") mac address*/
memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN);
addr.sa_family = slave_dev->type;
dev_set_mac_address(slave_dev, &addr);
}
kfree(slave);
/* re-acquire the lock before getting the next slave */
write_lock_bh(&bond->lock);
}
/* zero the mac address of the master so it will be
* set by the application to the mac address of the
* first slave
*/
memset(bond_dev->dev_addr, 0, bond_dev->addr_len);
if (bond->vlgrp) {
pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
bond_dev->name, bond_dev->name);
pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
bond_dev->name);
}
pr_info("%s: released all slaves\n", bond_dev->name);
out:
write_unlock_bh(&bond->lock);
<API key>(bond);
return 0;
}
/*
* This function changes the active slave to slave <slave_dev>.
* It returns -EINVAL in the following cases.
* - <slave_dev> is not found in the list.
* - There is not active slave now.
* - <slave_dev> is already active.
* - The link state of <slave_dev> is not BOND_LINK_UP.
* - <slave_dev> is not running.
* In these cases, this function does nothing.
* In the other cases, current_slave pointer is changed and 0 is returned.
*/
static int <API key>(struct net_device *bond_dev, struct net_device *slave_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *old_active = NULL;
struct slave *new_active = NULL;
int res = 0;
if (!USES_PRIMARY(bond->params.mode))
return -EINVAL;
/* Verify that master_dev is indeed the master of slave_dev */
if (!(slave_dev->flags & IFF_SLAVE) || (slave_dev->master != bond_dev))
return -EINVAL;
read_lock(&bond->lock);
read_lock(&bond->curr_slave_lock);
old_active = bond->curr_active_slave;
read_unlock(&bond->curr_slave_lock);
new_active = <API key>(bond, slave_dev);
/*
* Changing to the current active: do nothing; return success.
*/
if (new_active && (new_active == old_active)) {
read_unlock(&bond->lock);
return 0;
}
if ((new_active) &&
(old_active) &&
(new_active->link == BOND_LINK_UP) &&
IS_UP(new_active->dev)) {
block_netpoll_tx();
write_lock_bh(&bond->curr_slave_lock);
<API key>(bond, new_active);
write_unlock_bh(&bond->curr_slave_lock);
unblock_netpoll_tx();
} else
res = -EINVAL;
read_unlock(&bond->lock);
return res;
}
static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
{
struct bonding *bond = netdev_priv(bond_dev);
info->bond_mode = bond->params.mode;
info->miimon = bond->params.miimon;
read_lock(&bond->lock);
info->num_slaves = bond->slave_cnt;
read_unlock(&bond->lock);
return 0;
}
static int <API key>(struct net_device *bond_dev, struct ifslave *info)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
int i, res = -ENODEV;
read_lock(&bond->lock);
bond_for_each_slave(bond, slave, i) {
if (i == (int)info->slave_id) {
res = 0;
strcpy(info->slave_name, slave->dev->name);
info->link = slave->link;
info->state = bond_slave_state(slave);
info->link_failure_count = slave->link_failure_count;
break;
}
}
read_unlock(&bond->lock);
return res;
}
static int bond_miimon_inspect(struct bonding *bond)
{
struct slave *slave;
int i, link_state, commit = 0;
bool ignore_updelay;
ignore_updelay = !bond->curr_active_slave ? true : false;
bond_for_each_slave(bond, slave, i) {
slave->new_link = BOND_LINK_NOCHANGE;
link_state = bond_check_dev_link(bond, slave->dev, 0);
switch (slave->link) {
case BOND_LINK_UP:
if (link_state)
continue;
slave->link = BOND_LINK_FAIL;
slave->delay = bond->params.downdelay;
if (slave->delay) {
pr_info("%s: link status down for %sinterface %s, disabling it in %d ms.\n",
bond->dev->name,
(bond->params.mode ==
<API key>) ?
(<API key>(slave) ?
"active " : "backup ") : "",
slave->dev->name,
bond->params.downdelay * bond->params.miimon);
}
/*FALLTHRU*/
case BOND_LINK_FAIL:
if (link_state) {
/*
* recovered before downdelay expired
*/
slave->link = BOND_LINK_UP;
slave->jiffies = jiffies;
pr_info("%s: link status up again after %d ms for interface %s.\n",
bond->dev->name,
(bond->params.downdelay - slave->delay) *
bond->params.miimon,
slave->dev->name);
continue;
}
if (slave->delay <= 0) {
slave->new_link = BOND_LINK_DOWN;
commit++;
continue;
}
slave->delay
break;
case BOND_LINK_DOWN:
if (!link_state)
continue;
slave->link = BOND_LINK_BACK;
slave->delay = bond->params.updelay;
if (slave->delay) {
pr_info("%s: link status up for interface %s, enabling it in %d ms.\n",
bond->dev->name, slave->dev->name,
ignore_updelay ? 0 :
bond->params.updelay *
bond->params.miimon);
}
/*FALLTHRU*/
case BOND_LINK_BACK:
if (!link_state) {
slave->link = BOND_LINK_DOWN;
pr_info("%s: link status down again after %d ms for interface %s.\n",
bond->dev->name,
(bond->params.updelay - slave->delay) *
bond->params.miimon,
slave->dev->name);
continue;
}
if (ignore_updelay)
slave->delay = 0;
if (slave->delay <= 0) {
slave->new_link = BOND_LINK_UP;
commit++;
ignore_updelay = false;
continue;
}
slave->delay
break;
}
}
return commit;
}
static void bond_miimon_commit(struct bonding *bond)
{
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i) {
switch (slave->new_link) {
case BOND_LINK_NOCHANGE:
continue;
case BOND_LINK_UP:
slave->link = BOND_LINK_UP;
slave->jiffies = jiffies;
if (bond->params.mode == BOND_MODE_8023AD) {
/* prevent it from being the active one */
<API key>(slave);
} else if (bond->params.mode != <API key>) {
/* make it immediately active */
<API key>(slave);
} else if (slave != bond->primary_slave) {
/* prevent it from being the active one */
<API key>(slave);
}
<API key>(slave);
pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex.\n",
bond->dev->name, slave->dev->name,
slave->speed, slave->duplex ? "full" : "half");
/* notify ad that the link status has changed */
if (bond->params.mode == BOND_MODE_8023AD)
<API key>(slave, BOND_LINK_UP);
if (bond_is_lb(bond))
<API key>(bond, slave,
BOND_LINK_UP);
if (!bond->curr_active_slave ||
(slave == bond->primary_slave))
goto do_failover;
continue;
case BOND_LINK_DOWN:
if (slave->link_failure_count < UINT_MAX)
slave->link_failure_count++;
slave->link = BOND_LINK_DOWN;
if (bond->params.mode == <API key> ||
bond->params.mode == BOND_MODE_8023AD)
<API key>(slave);
pr_info("%s: link status definitely down for interface %s, disabling it\n",
bond->dev->name, slave->dev->name);
if (bond->params.mode == BOND_MODE_8023AD)
<API key>(slave,
BOND_LINK_DOWN);
if (bond_is_lb(bond))
<API key>(bond, slave,
BOND_LINK_DOWN);
if (slave == bond->curr_active_slave)
goto do_failover;
continue;
default:
pr_err("%s: invalid new link %d on slave %s\n",
bond->dev->name, slave->new_link,
slave->dev->name);
slave->new_link = BOND_LINK_NOCHANGE;
continue;
}
do_failover:
ASSERT_RTNL();
block_netpoll_tx();
write_lock_bh(&bond->curr_slave_lock);
<API key>(bond);
write_unlock_bh(&bond->curr_slave_lock);
unblock_netpoll_tx();
}
bond_set_carrier(bond);
}
/*
* bond_mii_monitor
*
* Really a wrapper that splits the mii monitor into two phases: an
* inspection, then (if inspection indicates something needs to be done)
* an acquisition of appropriate locks followed by a commit phase to
* implement whatever link state changes are indicated.
*/
void bond_mii_monitor(struct work_struct *work)
{
struct bonding *bond = container_of(work, struct bonding,
mii_work.work);
bool should_notify_peers = false;
read_lock(&bond->lock);
if (bond->kill_timers)
goto out;
if (bond->slave_cnt == 0)
goto re_arm;
should_notify_peers = <API key>(bond);
if (bond_miimon_inspect(bond)) {
read_unlock(&bond->lock);
rtnl_lock();
read_lock(&bond->lock);
bond_miimon_commit(bond);
read_unlock(&bond->lock);
rtnl_unlock(); /* might sleep, hold no other locks */
read_lock(&bond->lock);
}
re_arm:
if (bond->params.miimon)
queue_delayed_work(bond->wq, &bond->mii_work,
msecs_to_jiffies(bond->params.miimon));
out:
read_unlock(&bond->lock);
if (should_notify_peers) {
rtnl_lock();
<API key>(bond->dev, NETDEV_NOTIFY_PEERS);
rtnl_unlock();
}
}
static __be32 bond_glean_dev_ip(struct net_device *dev)
{
struct in_device *idev;
struct in_ifaddr *ifa;
__be32 addr = 0;
if (!dev)
return 0;
rcu_read_lock();
idev = __in_dev_get_rcu(dev);
if (!idev)
goto out;
ifa = idev->ifa_list;
if (!ifa)
goto out;
addr = ifa->ifa_local;
out:
rcu_read_unlock();
return addr;
}
static int bond_has_this_ip(struct bonding *bond, __be32 ip)
{
struct vlan_entry *vlan;
if (ip == bond->master_ip)
return 1;
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
if (ip == vlan->vlan_ip)
return 1;
}
return 0;
}
/*
* We go to the (large) trouble of VLAN tagging ARP frames because
* switches in VLAN mode (especially if ports are configured as
* "native" to a VLAN) might not pass non-tagged frames.
*/
static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_ip, __be32 src_ip, unsigned short vlan_id)
{
struct sk_buff *skb;
pr_debug("arp %d on slave %s: dst %x src %x vid %d\n", arp_op,
slave_dev->name, dest_ip, src_ip, vlan_id);
skb = arp_create(arp_op, ETH_P_ARP, dest_ip, slave_dev, src_ip,
NULL, slave_dev->dev_addr, NULL);
if (!skb) {
pr_err("ARP packet allocation failed\n");
return;
}
if (vlan_id) {
skb = vlan_put_tag(skb, vlan_id);
if (!skb) {
pr_err("failed to insert VLAN tag\n");
return;
}
}
arp_xmit(skb);
}
static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
{
int i, vlan_id;
__be32 *targets = bond->params.arp_targets;
struct vlan_entry *vlan;
struct net_device *vlan_dev;
struct rtable *rt;
for (i = 0; (i < <API key>); i++) {
if (!targets[i])
break;
pr_debug("basa: target %x\n", targets[i]);
if (!bond->vlgrp) {
pr_debug("basa: empty vlan: arp_send\n");
bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
bond->master_ip, 0);
continue;
}
/*
* If VLANs are configured, we do a route lookup to
* determine which VLAN interface would be used, so we
* can tag the ARP with the proper VLAN tag.
*/
rt = ip_route_output(dev_net(bond->dev), targets[i], 0,
RTO_ONLINK, 0);
if (IS_ERR(rt)) {
if (net_ratelimit()) {
pr_warning("%s: no route to arp_ip_target %pI4\n",
bond->dev->name, &targets[i]);
}
continue;
}
/*
* This target is not on a VLAN
*/
if (rt->dst.dev == bond->dev) {
ip_rt_put(rt);
pr_debug("basa: rtdev == bond->dev: arp_send\n");
bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
bond->master_ip, 0);
continue;
}
vlan_id = 0;
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
vlan_dev = <API key>(bond->vlgrp, vlan->vlan_id);
if (vlan_dev == rt->dst.dev) {
vlan_id = vlan->vlan_id;
pr_debug("basa: vlan match on %s %d\n",
vlan_dev->name, vlan_id);
break;
}
}
if (vlan_id) {
ip_rt_put(rt);
bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
vlan->vlan_ip, vlan_id);
continue;
}
if (net_ratelimit()) {
pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
bond->dev->name, &targets[i],
rt->dst.dev ? rt->dst.dev->name : "NULL");
}
ip_rt_put(rt);
}
}
static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 sip, __be32 tip)
{
int i;
__be32 *targets = bond->params.arp_targets;
for (i = 0; (i < <API key>) && targets[i]; i++) {
pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
&sip, &tip, i, &targets[i],
bond_has_this_ip(bond, tip));
if (sip == targets[i]) {
if (bond_has_this_ip(bond, tip))
slave->last_arp_rx = jiffies;
return;
}
}
}
static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
struct slave *slave)
{
struct arphdr *arp;
unsigned char *arp_ptr;
__be32 sip, tip;
if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
return;
read_lock(&bond->lock);
pr_debug("bond_arp_rcv: bond %s skb->dev %s\n",
bond->dev->name, skb->dev->name);
if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
goto out_unlock;
arp = arp_hdr(skb);
if (arp->ar_hln != bond->dev->addr_len ||
skb->pkt_type == PACKET_OTHERHOST ||
skb->pkt_type == PACKET_LOOPBACK ||
arp->ar_hrd != htons(ARPHRD_ETHER) ||
arp->ar_pro != htons(ETH_P_IP) ||
arp->ar_pln != 4)
goto out_unlock;
arp_ptr = (unsigned char *)(arp + 1);
arp_ptr += bond->dev->addr_len;
memcpy(&sip, arp_ptr, 4);
arp_ptr += 4 + bond->dev->addr_len;
memcpy(&tip, arp_ptr, 4);
pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n",
bond->dev->name, slave->dev->name, bond_slave_state(slave),
bond->params.arp_validate, <API key>(bond, slave),
&sip, &tip);
/*
* Backup slaves won't see the ARP reply, but do come through
* here for each ARP probe (so we swap the sip/tip to validate
* the probe). In a "redundant switch, common router" type of
* configuration, the ARP probe will (hopefully) travel from
* the active, through one switch, the router, then the other
* switch before reaching the backup.
*/
if (<API key>(slave))
bond_validate_arp(bond, slave, sip, tip);
else
bond_validate_arp(bond, slave, tip, sip);
out_unlock:
read_unlock(&bond->lock);
}
/*
* this function is called regularly to monitor each slave's link
* ensuring that traffic is being sent and received when arp monitoring
* is used in load-balancing mode. if the adapter has been dormant, then an
* arp is transmitted to generate traffic. see <API key> for
* arp monitoring in active backup mode.
*/
void <API key>(struct work_struct *work)
{
struct bonding *bond = container_of(work, struct bonding,
arp_work.work);
struct slave *slave, *oldcurrent;
int do_failover = 0;
int delta_in_ticks;
int i;
read_lock(&bond->lock);
delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval);
if (bond->kill_timers)
goto out;
if (bond->slave_cnt == 0)
goto re_arm;
read_lock(&bond->curr_slave_lock);
oldcurrent = bond->curr_active_slave;
read_unlock(&bond->curr_slave_lock);
/* see if any of the previous devices are up now (i.e. they have
* xmt and rcv traffic). the curr_active_slave does not come into
* the picture unless it is null. also, slave->jiffies is not needed
* here because we send an arp on each slave and give a slave as
* long as it needs to get the tx/rx within the delta.
* TODO: what about up/down delay in arp mode? it wasn't here before
* so it can wait
*/
bond_for_each_slave(bond, slave, i) {
unsigned long trans_start = dev_trans_start(slave->dev);
if (slave->link != BOND_LINK_UP) {
if (time_in_range(jiffies,
trans_start - delta_in_ticks,
trans_start + delta_in_ticks) &&
time_in_range(jiffies,
slave->dev->last_rx - delta_in_ticks,
slave->dev->last_rx + delta_in_ticks)) {
slave->link = BOND_LINK_UP;
<API key>(slave);
/* primary_slave has no meaning in round-robin
* mode. the window of a slave being up and
* curr_active_slave being null after enslaving
* is closed.
*/
if (!oldcurrent) {
pr_info("%s: link status definitely up for interface %s, ",
bond->dev->name,
slave->dev->name);
do_failover = 1;
} else {
pr_info("%s: interface %s is now up\n",
bond->dev->name,
slave->dev->name);
}
}
} else {
/* slave->link == BOND_LINK_UP */
/* not all switches will respond to an arp request
* when the source ip is 0, so don't take the link down
* if we don't know our ip yet
*/
if (!time_in_range(jiffies,
trans_start - delta_in_ticks,
trans_start + 2 * delta_in_ticks) ||
!time_in_range(jiffies,
slave->dev->last_rx - delta_in_ticks,
slave->dev->last_rx + 2 * delta_in_ticks)) {
slave->link = BOND_LINK_DOWN;
<API key>(slave);
if (slave->link_failure_count < UINT_MAX)
slave->link_failure_count++;
pr_info("%s: interface %s is now down.\n",
bond->dev->name,
slave->dev->name);
if (slave == oldcurrent)
do_failover = 1;
}
}
/* note: if switch is in round-robin mode, all links
* must tx arp to ensure all links rx an arp - otherwise
* links may oscillate or not come up at all; if switch is
* in something like xor mode, there is nothing we can
* do - all replies will be rx'ed on same link causing slaves
* to be unstable during low/no traffic periods
*/
if (IS_UP(slave->dev))
bond_arp_send_all(bond, slave);
}
if (do_failover) {
block_netpoll_tx();
write_lock_bh(&bond->curr_slave_lock);
<API key>(bond);
write_unlock_bh(&bond->curr_slave_lock);
unblock_netpoll_tx();
}
re_arm:
if (bond->params.arp_interval)
queue_delayed_work(bond->wq, &bond->arp_work, delta_in_ticks);
out:
read_unlock(&bond->lock);
}
/*
* Called to inspect slaves for active-backup mode ARP monitor link state
* changes. Sets new_link in slaves to specify what action should take
* place for the slave. Returns 0 if no changes are found, >0 if changes
* to link states must be committed.
*
* Called with bond->lock held for read.
*/
static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
{
struct slave *slave;
int i, commit = 0;
unsigned long trans_start;
bond_for_each_slave(bond, slave, i) {
slave->new_link = BOND_LINK_NOCHANGE;
if (slave->link != BOND_LINK_UP) {
if (time_in_range(jiffies,
slave_last_rx(bond, slave) - delta_in_ticks,
slave_last_rx(bond, slave) + delta_in_ticks)) {
slave->new_link = BOND_LINK_UP;
commit++;
}
continue;
}
/*
* Give slaves 2*delta after being enslaved or made
* active. This avoids bouncing, as the last receive
* times need a full ARP monitor cycle to be updated.
*/
if (time_in_range(jiffies,
slave->jiffies - delta_in_ticks,
slave->jiffies + 2 * delta_in_ticks))
continue;
/*
* Backup slave is down if:
* - No current_arp_slave AND
* - more than 3*delta since last receive AND
* - the bond has an IP address
*
* Note: a non-null current_arp_slave indicates
* the curr_active_slave went down and we are
* searching for a new one; under this condition
* we only take the curr_active_slave down - this
* gives each slave a chance to tx/rx traffic
* before being taken out
*/
if (!<API key>(slave) &&
!bond->current_arp_slave &&
!time_in_range(jiffies,
slave_last_rx(bond, slave) - delta_in_ticks,
slave_last_rx(bond, slave) + 3 * delta_in_ticks)) {
slave->new_link = BOND_LINK_DOWN;
commit++;
}
/*
* Active slave is down if:
* - more than 2*delta since transmitting OR
* - (more than 2*delta since receive AND
* the bond has an IP address)
*/
trans_start = dev_trans_start(slave->dev);
if (<API key>(slave) &&
(!time_in_range(jiffies,
trans_start - delta_in_ticks,
trans_start + 2 * delta_in_ticks) ||
!time_in_range(jiffies,
slave_last_rx(bond, slave) - delta_in_ticks,
slave_last_rx(bond, slave) + 2 * delta_in_ticks))) {
slave->new_link = BOND_LINK_DOWN;
commit++;
}
}
return commit;
}
/*
* Called to commit link state changes noted by inspection step of
* active-backup mode ARP monitor.
*
* Called with RTNL and bond->lock for read.
*/
static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
{
struct slave *slave;
int i;
unsigned long trans_start;
bond_for_each_slave(bond, slave, i) {
switch (slave->new_link) {
case BOND_LINK_NOCHANGE:
continue;
case BOND_LINK_UP:
trans_start = dev_trans_start(slave->dev);
if ((!bond->curr_active_slave &&
time_in_range(jiffies,
trans_start - delta_in_ticks,
trans_start + delta_in_ticks)) ||
bond->curr_active_slave != slave) {
slave->link = BOND_LINK_UP;
if (bond->current_arp_slave) {
<API key>(
bond->current_arp_slave);
bond->current_arp_slave = NULL;
}
pr_info("%s: link status definitely up for interface %s.\n",
bond->dev->name, slave->dev->name);
if (!bond->curr_active_slave ||
(slave == bond->primary_slave))
goto do_failover;
}
continue;
case BOND_LINK_DOWN:
if (slave->link_failure_count < UINT_MAX)
slave->link_failure_count++;
slave->link = BOND_LINK_DOWN;
<API key>(slave);
pr_info("%s: link status definitely down for interface %s, disabling it\n",
bond->dev->name, slave->dev->name);
if (slave == bond->curr_active_slave) {
bond->current_arp_slave = NULL;
goto do_failover;
}
continue;
default:
pr_err("%s: impossible: new_link %d on slave %s\n",
bond->dev->name, slave->new_link,
slave->dev->name);
continue;
}
do_failover:
ASSERT_RTNL();
block_netpoll_tx();
write_lock_bh(&bond->curr_slave_lock);
<API key>(bond);
write_unlock_bh(&bond->curr_slave_lock);
unblock_netpoll_tx();
}
bond_set_carrier(bond);
}
/*
* Send ARP probes for active-backup mode ARP monitor.
*
* Called with bond->lock held for read.
*/
static void bond_ab_arp_probe(struct bonding *bond)
{
struct slave *slave;
int i;
read_lock(&bond->curr_slave_lock);
if (bond->current_arp_slave && bond->curr_active_slave)
pr_info("PROBE: c_arp %s && cas %s BAD\n",
bond->current_arp_slave->dev->name,
bond->curr_active_slave->dev->name);
if (bond->curr_active_slave) {
bond_arp_send_all(bond, bond->curr_active_slave);
read_unlock(&bond->curr_slave_lock);
return;
}
read_unlock(&bond->curr_slave_lock);
/* if we don't have a curr_active_slave, search for the next available
* backup slave from the current_arp_slave and make it the candidate
* for becoming the curr_active_slave
*/
if (!bond->current_arp_slave) {
bond->current_arp_slave = bond->first_slave;
if (!bond->current_arp_slave)
return;
}
<API key>(bond->current_arp_slave);
/* search for next candidate */
<API key>(bond, slave, i, bond->current_arp_slave->next) {
if (IS_UP(slave->dev)) {
slave->link = BOND_LINK_BACK;
<API key>(slave);
bond_arp_send_all(bond, slave);
slave->jiffies = jiffies;
bond->current_arp_slave = slave;
break;
}
/* if the link state is up at this point, we
* mark it down - this can happen if we have
* simultaneous link failures and
* <API key> doesn't make this
* one the current slave so it is still marked
* up when it is actually down
*/
if (slave->link == BOND_LINK_UP) {
slave->link = BOND_LINK_DOWN;
if (slave->link_failure_count < UINT_MAX)
slave->link_failure_count++;
<API key>(slave);
pr_info("%s: backup interface %s is now down.\n",
bond->dev->name, slave->dev->name);
}
}
}
void <API key>(struct work_struct *work)
{
struct bonding *bond = container_of(work, struct bonding,
arp_work.work);
bool should_notify_peers = false;
int delta_in_ticks;
read_lock(&bond->lock);
if (bond->kill_timers)
goto out;
delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval);
if (bond->slave_cnt == 0)
goto re_arm;
should_notify_peers = <API key>(bond);
if (bond_ab_arp_inspect(bond, delta_in_ticks)) {
read_unlock(&bond->lock);
rtnl_lock();
read_lock(&bond->lock);
bond_ab_arp_commit(bond, delta_in_ticks);
read_unlock(&bond->lock);
rtnl_unlock();
read_lock(&bond->lock);
}
bond_ab_arp_probe(bond);
re_arm:
if (bond->params.arp_interval)
queue_delayed_work(bond->wq, &bond->arp_work, delta_in_ticks);
out:
read_unlock(&bond->lock);
if (should_notify_peers) {
rtnl_lock();
<API key>(bond->dev, NETDEV_NOTIFY_PEERS);
rtnl_unlock();
}
}
/*
* Change device name
*/
static int <API key>(struct bonding *bond)
{
<API key>(bond);
<API key>(bond);
<API key>(bond);
return NOTIFY_DONE;
}
static int <API key>(unsigned long event,
struct net_device *bond_dev)
{
struct bonding *event_bond = netdev_priv(bond_dev);
switch (event) {
case NETDEV_CHANGENAME:
return <API key>(event_bond);
default:
break;
}
return NOTIFY_DONE;
}
static int <API key>(unsigned long event,
struct net_device *slave_dev)
{
struct net_device *bond_dev = slave_dev->master;
struct bonding *bond = netdev_priv(bond_dev);
switch (event) {
case NETDEV_UNREGISTER:
if (bond_dev) {
if (bond->setup_by_slave)
<API key>(bond_dev, slave_dev);
else
bond_release(bond_dev, slave_dev);
}
break;
case NETDEV_CHANGE:
if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) {
struct slave *slave;
slave = <API key>(bond, slave_dev);
if (slave) {
u32 old_speed = slave->speed;
u8 old_duplex = slave->duplex;
<API key>(slave);
if (bond_is_lb(bond))
break;
if (old_speed != slave->speed)
<API key>(slave);
if (old_duplex != slave->duplex)
<API key>(slave);
}
}
break;
case NETDEV_DOWN:
/*
* ... Or is it this?
*/
break;
case NETDEV_CHANGEMTU:
/*
* TODO: Should slaves be allowed to
* independently alter their MTU? For
* an active-backup bond, slaves need
* not be the same type of device, so
* MTUs may vary. For other modes,
* slaves arguably should have the
* same MTUs. To do this, we'd need to
* take over the slave's change_mtu
* function for the duration of their
* servitude.
*/
break;
case NETDEV_CHANGENAME:
/*
* TODO: handle changing the primary's name
*/
break;
case NETDEV_FEAT_CHANGE:
<API key>(bond);
break;
default:
break;
}
return NOTIFY_DONE;
}
/*
* bond_netdev_event: handle netdev notifier chain events.
*
* This function receives events for the netdev chain. The caller (an
* ioctl handler calling <API key>) holds the necessary
* locks for us to safely manipulate the slave devices (RTNL lock,
* dev_probe_lock).
*/
static int bond_netdev_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
struct net_device *event_dev = (struct net_device *)ptr;
pr_debug("event_dev: %s, event: %lx\n",
event_dev ? event_dev->name : "None",
event);
if (!(event_dev->priv_flags & IFF_BONDING))
return NOTIFY_DONE;
if (event_dev->flags & IFF_MASTER) {
pr_debug("IFF_MASTER\n");
return <API key>(event, event_dev);
}
if (event_dev->flags & IFF_SLAVE) {
pr_debug("IFF_SLAVE\n");
return <API key>(event, event_dev);
}
return NOTIFY_DONE;
}
/*
* bond_inetaddr_event: handle inetaddr notifier chain events.
*
* We keep track of device IPs primarily to use as source addresses in
* ARP monitor probes (rather than spewing out broadcasts all the time).
*
* We track one IP for the main device (if it has one), plus one per VLAN.
*/
static int bond_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
{
struct in_ifaddr *ifa = ptr;
struct net_device *vlan_dev, *event_dev = ifa->ifa_dev->dev;
struct bond_net *bn = net_generic(dev_net(event_dev), bond_net_id);
struct bonding *bond;
struct vlan_entry *vlan;
list_for_each_entry(bond, &bn->dev_list, bond_list) {
if (bond->dev == event_dev) {
switch (event) {
case NETDEV_UP:
bond->master_ip = ifa->ifa_local;
return NOTIFY_OK;
case NETDEV_DOWN:
bond->master_ip = bond_glean_dev_ip(bond->dev);
return NOTIFY_OK;
default:
return NOTIFY_DONE;
}
}
list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
if (!bond->vlgrp)
continue;
vlan_dev = <API key>(bond->vlgrp, vlan->vlan_id);
if (vlan_dev == event_dev) {
switch (event) {
case NETDEV_UP:
vlan->vlan_ip = ifa->ifa_local;
return NOTIFY_OK;
case NETDEV_DOWN:
vlan->vlan_ip =
bond_glean_dev_ip(vlan_dev);
return NOTIFY_OK;
default:
return NOTIFY_DONE;
}
}
}
}
return NOTIFY_DONE;
}
static struct notifier_block <API key> = {
.notifier_call = bond_netdev_event,
};
static struct notifier_block <API key> = {
.notifier_call = bond_inetaddr_event,
};
/*
* Hash for the output device based upon layer 2 and layer 3 data. If
* the packet is not IP mimic <API key>()
*/
static int <API key>(struct sk_buff *skb, int count)
{
struct ethhdr *data = (struct ethhdr *)skb->data;
struct iphdr *iph = ip_hdr(skb);
if (skb->protocol == htons(ETH_P_IP)) {
return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^
(data->h_dest[5] ^ data->h_source[5])) % count;
}
return (data->h_dest[5] ^ data->h_source[5]) % count;
}
/*
* Hash for the output device based upon layer 3 and layer 4 data. If
* the packet is a frag or not TCP or UDP, just use layer 3 data. If it is
* altogether not IP, mimic <API key>()
*/
static int <API key>(struct sk_buff *skb, int count)
{
struct ethhdr *data = (struct ethhdr *)skb->data;
struct iphdr *iph = ip_hdr(skb);
__be16 *layer4hdr = (__be16 *)((u32 *)iph + iph->ihl);
int layer4_xor = 0;
if (skb->protocol == htons(ETH_P_IP)) {
if (!(iph->frag_off & htons(IP_MF|IP_OFFSET)) &&
(iph->protocol == IPPROTO_TCP ||
iph->protocol == IPPROTO_UDP)) {
layer4_xor = ntohs((*layer4hdr ^ *(layer4hdr + 1)));
}
return (layer4_xor ^
((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count;
}
return (data->h_dest[5] ^ data->h_source[5]) % count;
}
/*
* Hash for the output device based upon layer 2 data
*/
static int <API key>(struct sk_buff *skb, int count)
{
struct ethhdr *data = (struct ethhdr *)skb->data;
return (data->h_dest[5] ^ data->h_source[5]) % count;
}
static int bond_open(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
bond->kill_timers = 0;
INIT_DELAYED_WORK(&bond->mcast_work, <API key>);
if (bond_is_lb(bond)) {
/* bond_alb_initialize must be called before the timer
* is started.
*/
if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) {
/* something went wrong - fail the open operation */
return -ENOMEM;
}
INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
queue_delayed_work(bond->wq, &bond->alb_work, 0);
}
if (bond->params.miimon) { /* link check interval, in milliseconds. */
INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
queue_delayed_work(bond->wq, &bond->mii_work, 0);
}
if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
if (bond->params.mode == <API key>)
INIT_DELAYED_WORK(&bond->arp_work,
<API key>);
else
INIT_DELAYED_WORK(&bond->arp_work,
<API key>);
queue_delayed_work(bond->wq, &bond->arp_work, 0);
if (bond->params.arp_validate)
bond->recv_probe = bond_arp_rcv;
}
if (bond->params.mode == BOND_MODE_8023AD) {
INIT_DELAYED_WORK(&bond->ad_work, <API key>);
queue_delayed_work(bond->wq, &bond->ad_work, 0);
/* register to receive LACPDUs */
bond->recv_probe = <API key>;
<API key>(bond, 1);
}
return 0;
}
static int bond_close(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
write_lock_bh(&bond->lock);
bond->send_peer_notif = 0;
/* signal timers not to re-arm */
bond->kill_timers = 1;
write_unlock_bh(&bond->lock);
if (bond->params.miimon) { /* link check interval, in milliseconds. */
cancel_delayed_work(&bond->mii_work);
}
if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
cancel_delayed_work(&bond->arp_work);
}
switch (bond->params.mode) {
case BOND_MODE_8023AD:
cancel_delayed_work(&bond->ad_work);
break;
case BOND_MODE_TLB:
case BOND_MODE_ALB:
cancel_delayed_work(&bond->alb_work);
break;
default:
break;
}
if (<API key>(&bond->mcast_work))
cancel_delayed_work(&bond->mcast_work);
if (bond_is_lb(bond)) {
/* Must be called only after all
* slaves have been released
*/
<API key>(bond);
}
bond->recv_probe = NULL;
return 0;
}
static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
struct rtnl_link_stats64 *stats)
{
struct bonding *bond = netdev_priv(bond_dev);
struct rtnl_link_stats64 temp;
struct slave *slave;
int i;
memset(stats, 0, sizeof(*stats));
read_lock_bh(&bond->lock);
bond_for_each_slave(bond, slave, i) {
const struct rtnl_link_stats64 *sstats =
dev_get_stats(slave->dev, &temp);
stats->rx_packets += sstats->rx_packets;
stats->rx_bytes += sstats->rx_bytes;
stats->rx_errors += sstats->rx_errors;
stats->rx_dropped += sstats->rx_dropped;
stats->tx_packets += sstats->tx_packets;
stats->tx_bytes += sstats->tx_bytes;
stats->tx_errors += sstats->tx_errors;
stats->tx_dropped += sstats->tx_dropped;
stats->multicast += sstats->multicast;
stats->collisions += sstats->collisions;
stats->rx_length_errors += sstats->rx_length_errors;
stats->rx_over_errors += sstats->rx_over_errors;
stats->rx_crc_errors += sstats->rx_crc_errors;
stats->rx_frame_errors += sstats->rx_frame_errors;
stats->rx_fifo_errors += sstats->rx_fifo_errors;
stats->rx_missed_errors += sstats->rx_missed_errors;
stats->tx_aborted_errors += sstats->tx_aborted_errors;
stats->tx_carrier_errors += sstats->tx_carrier_errors;
stats->tx_fifo_errors += sstats->tx_fifo_errors;
stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
stats->tx_window_errors += sstats->tx_window_errors;
}
read_unlock_bh(&bond->lock);
return stats;
}
static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd)
{
struct net_device *slave_dev = NULL;
struct ifbond k_binfo;
struct ifbond __user *u_binfo = NULL;
struct ifslave k_sinfo;
struct ifslave __user *u_sinfo = NULL;
struct mii_ioctl_data *mii = NULL;
int res = 0;
pr_debug("bond_ioctl: master=%s, cmd=%d\n", bond_dev->name, cmd);
switch (cmd) {
case SIOCGMIIPHY:
mii = if_mii(ifr);
if (!mii)
return -EINVAL;
mii->phy_id = 0;
/* Fall Through */
case SIOCGMIIREG:
/*
* We do this again just in case we were called by SIOCGMIIREG
* instead of SIOCGMIIPHY.
*/
mii = if_mii(ifr);
if (!mii)
return -EINVAL;
if (mii->reg_num == 1) {
struct bonding *bond = netdev_priv(bond_dev);
mii->val_out = 0;
read_lock(&bond->lock);
read_lock(&bond->curr_slave_lock);
if (netif_carrier_ok(bond->dev))
mii->val_out = BMSR_LSTATUS;
read_unlock(&bond->curr_slave_lock);
read_unlock(&bond->lock);
}
return 0;
case BOND_INFO_QUERY_OLD:
case SIOCBONDINFOQUERY:
u_binfo = (struct ifbond __user *)ifr->ifr_data;
if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond)))
return -EFAULT;
res = bond_info_query(bond_dev, &k_binfo);
if (res == 0 &&
copy_to_user(u_binfo, &k_binfo, sizeof(ifbond)))
return -EFAULT;
return res;
case <API key>:
case <API key>:
u_sinfo = (struct ifslave __user *)ifr->ifr_data;
if (copy_from_user(&k_sinfo, u_sinfo, sizeof(ifslave)))
return -EFAULT;
res = <API key>(bond_dev, &k_sinfo);
if (res == 0 &&
copy_to_user(u_sinfo, &k_sinfo, sizeof(ifslave)))
return -EFAULT;
return res;
default:
/* Go on */
break;
}
if (!capable(CAP_NET_ADMIN))
return -EPERM;
slave_dev = dev_get_by_name(dev_net(bond_dev), ifr->ifr_slave);
pr_debug("slave_dev=%p:\n", slave_dev);
if (!slave_dev)
res = -ENODEV;
else {
pr_debug("slave_dev->name=%s:\n", slave_dev->name);
switch (cmd) {
case BOND_ENSLAVE_OLD:
case SIOCBONDENSLAVE:
res = bond_enslave(bond_dev, slave_dev);
break;
case BOND_RELEASE_OLD:
case SIOCBONDRELEASE:
res = bond_release(bond_dev, slave_dev);
break;
case BOND_SETHWADDR_OLD:
case SIOCBONDSETHWADDR:
res = bond_sethwaddr(bond_dev, slave_dev);
break;
case <API key>:
case <API key>:
res = <API key>(bond_dev, slave_dev);
break;
default:
res = -EOPNOTSUPP;
}
dev_put(slave_dev);
}
return res;
}
static bool <API key>(unsigned char *addr,
struct netdev_hw_addr_list *list,
int addrlen)
{
struct netdev_hw_addr *ha;
<API key>(ha, list)
if (!memcmp(ha->addr, addr, addrlen))
return true;
return false;
}
static void <API key>(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct netdev_hw_addr *ha;
bool found;
/*
* Do promisc before checking multicast_mode
*/
if ((bond_dev->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC))
/*
* FIXME: Need to handle the error when one of the multi-slaves
* encounters error.
*/
<API key>(bond, 1);
if (!(bond_dev->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC))
<API key>(bond, -1);
/* set allmulti flag to slaves */
if ((bond_dev->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI))
/*
* FIXME: Need to handle the error when one of the multi-slaves
* encounters error.
*/
bond_set_allmulti(bond, 1);
if (!(bond_dev->flags & IFF_ALLMULTI) && (bond->flags & IFF_ALLMULTI))
bond_set_allmulti(bond, -1);
read_lock(&bond->lock);
bond->flags = bond_dev->flags;
/* looking for addresses to add to slaves' mc list */
<API key>(ha, bond_dev) {
found = <API key>(ha->addr, &bond->mc_list,
bond_dev->addr_len);
if (!found)
bond_mc_add(bond, ha->addr);
}
/* looking for addresses to delete from slaves' list */
<API key>(ha, &bond->mc_list) {
found = <API key>(ha->addr, &bond_dev->mc,
bond_dev->addr_len);
if (!found)
bond_mc_del(bond, ha->addr);
}
/* save master's multicast list */
__hw_addr_flush(&bond->mc_list);
<API key>(&bond->mc_list, &bond_dev->mc,
bond_dev->addr_len, <API key>);
read_unlock(&bond->lock);
}
static int bond_neigh_setup(struct net_device *dev, struct neigh_parms *parms)
{
struct bonding *bond = netdev_priv(dev);
struct slave *slave = bond->first_slave;
if (slave) {
const struct net_device_ops *slave_ops
= slave->dev->netdev_ops;
if (slave_ops->ndo_neigh_setup)
return slave_ops->ndo_neigh_setup(slave->dev, parms);
}
return 0;
}
/*
* Change the MTU of all of a master's slaves to match the master
*/
static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *stop_at;
int res = 0;
int i;
pr_debug("bond=%p, name=%s, new_mtu=%d\n", bond,
(bond_dev ? bond_dev->name : "None"), new_mtu);
/* Can't hold bond->lock with bh disabled here since
* some base drivers panic. On the other hand we can't
* hold bond->lock without bh disabled because we'll
* deadlock. The only solution is to rely on the fact
* that we're under rtnl_lock here, and the slaves
* list won't change. This doesn't solve the problem
* of setting the slave's MTU while it is
* transmitting, but the assumption is that the base
* driver can handle that.
*
* TODO: figure out a way to safely iterate the slaves
* list, but without holding a lock around the actual
* call to the base driver.
*/
bond_for_each_slave(bond, slave, i) {
pr_debug("s %p s->p %p c_m %p\n",
slave,
slave->prev,
slave->dev->netdev_ops->ndo_change_mtu);
res = dev_set_mtu(slave->dev, new_mtu);
if (res) {
/* If we failed to set the slave's mtu to the new value
* we must abort the operation even in ACTIVE_BACKUP
* mode, because if we allow the backup slaves to have
* different mtu values than the active slave we'll
* need to change their mtu when doing a failover. That
* means changing their mtu from timer context, which
* is probably not a good idea.
*/
pr_debug("err %d %s\n", res, slave->dev->name);
goto unwind;
}
}
bond_dev->mtu = new_mtu;
return 0;
unwind:
/* unwind from head to the slave that failed */
stop_at = slave;
<API key>(bond, slave, i, bond->first_slave, stop_at) {
int tmp_res;
tmp_res = dev_set_mtu(slave->dev, bond_dev->mtu);
if (tmp_res) {
pr_debug("unwind err %d dev %s\n",
tmp_res, slave->dev->name);
}
}
return res;
}
/*
* Change HW address
*
* Note that many devices must be down to change the HW address, and
* downing the master releases all slaves. We can make bonds full of
* bonding devices to test this, however.
*/
static int <API key>(struct net_device *bond_dev, void *addr)
{
struct bonding *bond = netdev_priv(bond_dev);
struct sockaddr *sa = addr, tmp_sa;
struct slave *slave, *stop_at;
int res = 0;
int i;
if (bond->params.mode == BOND_MODE_ALB)
return <API key>(bond_dev, addr);
pr_debug("bond=%p, name=%s\n",
bond, bond_dev ? bond_dev->name : "None");
/*
* If fail_over_mac is set to active, do nothing and return
* success. Returning an error causes ifenslave to fail.
*/
if (bond->params.fail_over_mac == BOND_FOM_ACTIVE)
return 0;
if (!is_valid_ether_addr(sa->sa_data))
return -EADDRNOTAVAIL;
/* Can't hold bond->lock with bh disabled here since
* some base drivers panic. On the other hand we can't
* hold bond->lock without bh disabled because we'll
* deadlock. The only solution is to rely on the fact
* that we're under rtnl_lock here, and the slaves
* list won't change. This doesn't solve the problem
* of setting the slave's hw address while it is
* transmitting, but the assumption is that the base
* driver can handle that.
*
* TODO: figure out a way to safely iterate the slaves
* list, but without holding a lock around the actual
* call to the base driver.
*/
bond_for_each_slave(bond, slave, i) {
const struct net_device_ops *slave_ops = slave->dev->netdev_ops;
pr_debug("slave %p %s\n", slave, slave->dev->name);
if (slave_ops->ndo_set_mac_address == NULL) {
res = -EOPNOTSUPP;
pr_debug("EOPNOTSUPP %s\n", slave->dev->name);
goto unwind;
}
res = dev_set_mac_address(slave->dev, addr);
if (res) {
/* TODO: consider downing the slave
* and retry ?
* User should expect communications
* breakage anyway until ARP finish
* updating, so...
*/
pr_debug("err %d %s\n", res, slave->dev->name);
goto unwind;
}
}
/* success */
memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
return 0;
unwind:
memcpy(tmp_sa.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
tmp_sa.sa_family = bond_dev->type;
/* unwind from head to the slave that failed */
stop_at = slave;
<API key>(bond, slave, i, bond->first_slave, stop_at) {
int tmp_res;
tmp_res = dev_set_mac_address(slave->dev, &tmp_sa);
if (tmp_res) {
pr_debug("unwind err %d dev %s\n",
tmp_res, slave->dev->name);
}
}
return res;
}
static int <API key>(struct sk_buff *skb, struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *start_at;
int i, slave_no, res = 1;
struct iphdr *iph = ip_hdr(skb);
/*
* Start with the curr_active_slave that joined the bond as the
* default for sending IGMP traffic. For failover purposes one
* needs to maintain some consistency for the interface that will
* send the join/membership reports. The curr_active_slave found
* will send all of this type of traffic.
*/
if ((iph->protocol == IPPROTO_IGMP) &&
(skb->protocol == htons(ETH_P_IP))) {
read_lock(&bond->curr_slave_lock);
slave = bond->curr_active_slave;
read_unlock(&bond->curr_slave_lock);
if (!slave)
goto out;
} else {
/*
* Concurrent TX may collide on rr_tx_counter; we accept
* that as being rare enough not to justify using an
* atomic op here.
*/
slave_no = bond->rr_tx_counter++ % bond->slave_cnt;
bond_for_each_slave(bond, slave, i) {
slave_no
if (slave_no < 0)
break;
}
}
start_at = slave;
<API key>(bond, slave, i, start_at) {
if (IS_UP(slave->dev) &&
(slave->link == BOND_LINK_UP) &&
<API key>(slave)) {
res = bond_dev_queue_xmit(bond, skb, slave->dev);
break;
}
}
out:
if (res) {
/* no suitable interface, frame not sent */
dev_kfree_skb(skb);
}
return NETDEV_TX_OK;
}
/*
* in active-backup mode, we know that bond->curr_active_slave is always valid if
* the bond has a usable interface.
*/
static int <API key>(struct sk_buff *skb, struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
int res = 1;
read_lock(&bond->curr_slave_lock);
if (bond->curr_active_slave)
res = bond_dev_queue_xmit(bond, skb,
bond->curr_active_slave->dev);
if (res)
/* no suitable interface, frame not sent */
dev_kfree_skb(skb);
read_unlock(&bond->curr_slave_lock);
return NETDEV_TX_OK;
}
/*
* In bond_xmit_xor() , we determine the output device by using a pre-
* determined xmit_hash_policy(), If the selected device is not enabled,
* find the next active slave.
*/
static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *start_at;
int slave_no;
int i;
int res = 1;
slave_no = bond->xmit_hash_policy(skb, bond->slave_cnt);
bond_for_each_slave(bond, slave, i) {
slave_no
if (slave_no < 0)
break;
}
start_at = slave;
<API key>(bond, slave, i, start_at) {
if (IS_UP(slave->dev) &&
(slave->link == BOND_LINK_UP) &&
<API key>(slave)) {
res = bond_dev_queue_xmit(bond, skb, slave->dev);
break;
}
}
if (res) {
/* no suitable interface, frame not sent */
dev_kfree_skb(skb);
}
return NETDEV_TX_OK;
}
/*
* in broadcast mode, we send everything to all usable interfaces.
*/
static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *start_at;
struct net_device *tx_dev = NULL;
int i;
int res = 1;
read_lock(&bond->curr_slave_lock);
start_at = bond->curr_active_slave;
read_unlock(&bond->curr_slave_lock);
if (!start_at)
goto out;
<API key>(bond, slave, i, start_at) {
if (IS_UP(slave->dev) &&
(slave->link == BOND_LINK_UP) &&
<API key>(slave)) {
if (tx_dev) {
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
if (!skb2) {
pr_err("%s: Error: bond_xmit_broadcast(): skb_clone() failed\n",
bond_dev->name);
continue;
}
res = bond_dev_queue_xmit(bond, skb2, tx_dev);
if (res) {
dev_kfree_skb(skb2);
continue;
}
}
tx_dev = slave->dev;
}
}
if (tx_dev)
res = bond_dev_queue_xmit(bond, skb, tx_dev);
out:
if (res)
/* no suitable interface, frame not sent */
dev_kfree_skb(skb);
/* frame sent to all suitable interfaces */
return NETDEV_TX_OK;
}
static void <API key>(struct bonding *bond)
{
switch (bond->params.xmit_policy) {
case <API key>:
bond->xmit_hash_policy = <API key>;
break;
case <API key>:
bond->xmit_hash_policy = <API key>;
break;
case <API key>:
default:
bond->xmit_hash_policy = <API key>;
break;
}
}
/*
* Lookup the slave that corresponds to a qid
*/
static inline int bond_slave_override(struct bonding *bond,
struct sk_buff *skb)
{
int i, res = 1;
struct slave *slave = NULL;
struct slave *check_slave;
if (!skb->queue_mapping)
return 1;
/* Find out if any slaves have the same mapping as this skb. */
bond_for_each_slave(bond, check_slave, i) {
if (check_slave->queue_id == skb->queue_mapping) {
slave = check_slave;
break;
}
}
/* If the slave isn't UP, use default transmit policy. */
if (slave && slave->queue_id && IS_UP(slave->dev) &&
(slave->link == BOND_LINK_UP)) {
res = bond_dev_queue_xmit(bond, skb, slave->dev);
}
return res;
}
static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb)
{
/*
* This helper function exists to help dev_pick_tx get the correct
* destination queue. Using a helper function skips a call to
* skb_tx_hash and will put the skbs in the queue we expect on their
* way down to the bonding driver.
*/
u16 txq = <API key>(skb) ? skb_get_rx_queue(skb) : 0;
/*
* Save the original txq to restore before passing to the driver
*/
qdisc_skb_cb(skb)->bond_queue_mapping = skb->queue_mapping;
if (unlikely(txq >= dev->real_num_tx_queues)) {
do {
txq -= dev->real_num_tx_queues;
} while (txq >= dev->real_num_tx_queues);
}
return txq;
}
static netdev_tx_t __bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct bonding *bond = netdev_priv(dev);
if (TX_QUEUE_OVERRIDE(bond->params.mode)) {
if (!bond_slave_override(bond, skb))
return NETDEV_TX_OK;
}
switch (bond->params.mode) {
case <API key>:
return <API key>(skb, dev);
case <API key>:
return <API key>(skb, dev);
case BOND_MODE_XOR:
return bond_xmit_xor(skb, dev);
case BOND_MODE_BROADCAST:
return bond_xmit_broadcast(skb, dev);
case BOND_MODE_8023AD:
return bond_3ad_xmit_xor(skb, dev);
case BOND_MODE_ALB:
case BOND_MODE_TLB:
return bond_alb_xmit(skb, dev);
default:
/* Should never happen, mode already checked */
pr_err("%s: Error: Unknown bonding mode %d\n",
dev->name, bond->params.mode);
WARN_ON_ONCE(1);
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
}
static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct bonding *bond = netdev_priv(dev);
netdev_tx_t ret = NETDEV_TX_OK;
/*
* If we risk deadlock from transmitting this in the
* netpoll path, tell netpoll to queue the frame for later tx
*/
if (<API key>(dev))
return NETDEV_TX_BUSY;
read_lock(&bond->lock);
if (bond->slave_cnt)
ret = __bond_start_xmit(skb, dev);
else
dev_kfree_skb(skb);
read_unlock(&bond->lock);
return ret;
}
/*
* set bond mode specific net device operations
*/
void bond_set_mode_ops(struct bonding *bond, int mode)
{
struct net_device *bond_dev = bond->dev;
switch (mode) {
case <API key>:
break;
case <API key>:
break;
case BOND_MODE_XOR:
<API key>(bond);
break;
case BOND_MODE_BROADCAST:
break;
case BOND_MODE_8023AD:
<API key>(bond);
break;
case BOND_MODE_ALB:
/* FALLTHRU */
case BOND_MODE_TLB:
break;
default:
/* Should never happen, mode already checked */
pr_err("%s: Error: Unknown bonding mode %d\n",
bond_dev->name, mode);
break;
}
}
static void <API key>(struct net_device *bond_dev,
struct ethtool_drvinfo *drvinfo)
{
strncpy(drvinfo->driver, DRV_NAME, 32);
strncpy(drvinfo->version, DRV_VERSION, 32);
snprintf(drvinfo->fw_version, 32, "%d", BOND_ABI_VERSION);
}
static const struct ethtool_ops bond_ethtool_ops = {
.get_drvinfo = <API key>,
.get_link = ethtool_op_get_link,
};
static const struct net_device_ops bond_netdev_ops = {
.ndo_init = bond_init,
.ndo_uninit = bond_uninit,
.ndo_open = bond_open,
.ndo_stop = bond_close,
.ndo_start_xmit = bond_start_xmit,
.ndo_select_queue = bond_select_queue,
.ndo_get_stats64 = bond_get_stats,
.ndo_do_ioctl = bond_do_ioctl,
.<API key> = <API key>,
.ndo_change_mtu = bond_change_mtu,
.ndo_set_mac_address = <API key>,
.ndo_neigh_setup = bond_neigh_setup,
.<API key> = <API key>,
.ndo_vlan_rx_add_vid = <API key>,
.<API key> = <API key>,
#ifdef <API key>
.ndo_netpoll_setup = bond_netpoll_setup,
.ndo_netpoll_cleanup = <API key>,
.ndo_poll_controller = <API key>,
#endif
.ndo_add_slave = bond_enslave,
.ndo_del_slave = bond_release,
.ndo_fix_features = bond_fix_features,
};
static void bond_destructor(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
if (bond->wq)
destroy_workqueue(bond->wq);
free_netdev(bond_dev);
}
static void bond_setup(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
/* initialize rwlocks */
rwlock_init(&bond->lock);
rwlock_init(&bond->curr_slave_lock);
bond->params = bonding_defaults;
/* Initialize pointers */
bond->dev = bond_dev;
INIT_LIST_HEAD(&bond->vlan_list);
/* Initialize the device entry points */
ether_setup(bond_dev);
bond_dev->netdev_ops = &bond_netdev_ops;
bond_dev->ethtool_ops = &bond_ethtool_ops;
bond_set_mode_ops(bond, bond->params.mode);
bond_dev->destructor = bond_destructor;
/* Initialize the device options */
bond_dev->tx_queue_len = 0;
bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
bond_dev->priv_flags |= IFF_BONDING;
bond_dev->priv_flags &= ~(<API key> | IFF_TX_SKB_SHARING);
/* At first, we block adding VLANs. That's the only way to
* prevent problems that occur when adding VLANs over an
* empty bond. The block will be removed once non-challenged
* slaves are enslaved.
*/
bond_dev->features |= <API key>;
/* don't acquire bond device's netif_tx_lock when
* transmitting */
bond_dev->features |= NETIF_F_LLTX;
/* By default, we declare the bond to be fully
* VLAN hardware accelerated capable. Special
* care is taken in the various xmit functions
* when there are slaves that are not hw accel
* capable
*/
bond_dev->hw_features = BOND_VLAN_FEATURES |
NETIF_F_HW_VLAN_TX |
NETIF_F_HW_VLAN_RX |
<API key>;
bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_NO_CSUM);
bond_dev->features |= bond_dev->hw_features;
}
static void <API key>(struct bonding *bond)
{
write_lock_bh(&bond->lock);
bond->kill_timers = 1;
write_unlock_bh(&bond->lock);
if (bond->params.miimon && <API key>(&bond->mii_work))
cancel_delayed_work(&bond->mii_work);
if (bond->params.arp_interval && <API key>(&bond->arp_work))
cancel_delayed_work(&bond->arp_work);
if (bond->params.mode == BOND_MODE_ALB &&
<API key>(&bond->alb_work))
cancel_delayed_work(&bond->alb_work);
if (bond->params.mode == BOND_MODE_8023AD &&
<API key>(&bond->ad_work))
cancel_delayed_work(&bond->ad_work);
if (<API key>(&bond->mcast_work))
cancel_delayed_work(&bond->mcast_work);
}
/*
* Destroy a bonding device.
* Must be under rtnl_lock when this function is called.
*/
static void bond_uninit(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct vlan_entry *vlan, *tmp;
<API key>(bond_dev);
/* Release the bonded slaves */
bond_release_all(bond_dev);
list_del(&bond->bond_list);
<API key>(bond);
<API key>(bond);
<API key>(bond);
__hw_addr_flush(&bond->mc_list);
<API key>(vlan, tmp, &bond->vlan_list, vlan_list) {
list_del(&vlan->vlan_list);
kfree(vlan);
}
}
/*
* Convert string input module parms. Accept either the
* number of the mode or its string name. A bit complicated because
* some mode names are substrings of other names, and calls from sysfs
* may have whitespace in the name (trailing newlines, for example).
*/
int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl)
{
int modeint = -1, i, rv;
char *p, modestr[<API key> + 1] = { 0, };
for (p = (char *)buf; *p; p++)
if (!(isdigit(*p) || isspace(*p)))
break;
if (*p)
rv = sscanf(buf, "%20s", modestr);
else
rv = sscanf(buf, "%d", &modeint);
if (!rv)
return -1;
for (i = 0; tbl[i].modename; i++) {
if (modeint == tbl[i].mode)
return tbl[i].mode;
if (strcmp(modestr, tbl[i].modename) == 0)
return tbl[i].mode;
}
return -1;
}
static int bond_check_params(struct bond_params *params)
{
int arp_validate_value, fail_over_mac_value, <API key>;
/*
* Convert string parameters.
*/
if (mode) {
bond_mode = bond_parse_parm(mode, bond_mode_tbl);
if (bond_mode == -1) {
pr_err("Error: Invalid bonding mode \"%s\"\n",
mode == NULL ? "NULL" : mode);
return -EINVAL;
}
}
if (xmit_hash_policy) {
if ((bond_mode != BOND_MODE_XOR) &&
(bond_mode != BOND_MODE_8023AD)) {
pr_info("xmit_hash_policy param is irrelevant in mode %s\n",
bond_mode_name(bond_mode));
} else {
xmit_hashtype = bond_parse_parm(xmit_hash_policy,
xmit_hashtype_tbl);
if (xmit_hashtype == -1) {
pr_err("Error: Invalid xmit_hash_policy \"%s\"\n",
xmit_hash_policy == NULL ? "NULL" :
xmit_hash_policy);
return -EINVAL;
}
}
}
if (lacp_rate) {
if (bond_mode != BOND_MODE_8023AD) {
pr_info("lacp_rate param is irrelevant in mode %s\n",
bond_mode_name(bond_mode));
} else {
lacp_fast = bond_parse_parm(lacp_rate, bond_lacp_tbl);
if (lacp_fast == -1) {
pr_err("Error: Invalid lacp rate \"%s\"\n",
lacp_rate == NULL ? "NULL" : lacp_rate);
return -EINVAL;
}
}
}
if (ad_select) {
params->ad_select = bond_parse_parm(ad_select, ad_select_tbl);
if (params->ad_select == -1) {
pr_err("Error: Invalid ad_select \"%s\"\n",
ad_select == NULL ? "NULL" : ad_select);
return -EINVAL;
}
if (bond_mode != BOND_MODE_8023AD) {
pr_warning("ad_select param only affects 802.3ad mode\n");
}
} else {
params->ad_select = BOND_AD_STABLE;
}
if (max_bonds < 0) {
pr_warning("Warning: max_bonds (%d) not in range %d-%d, so it was reset to <API key> (%d)\n",
max_bonds, 0, INT_MAX, <API key>);
max_bonds = <API key>;
}
if (miimon < 0) {
pr_warning("Warning: miimon module parameter (%d), not in range 0-%d, so it was reset to %d\n",
miimon, INT_MAX, <API key>);
miimon = <API key>;
}
if (updelay < 0) {
pr_warning("Warning: updelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
updelay, INT_MAX);
updelay = 0;
}
if (downdelay < 0) {
pr_warning("Warning: downdelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
downdelay, INT_MAX);
downdelay = 0;
}
if ((use_carrier != 0) && (use_carrier != 1)) {
pr_warning("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
use_carrier);
use_carrier = 1;
}
if (num_peer_notif < 0 || num_peer_notif > 255) {
pr_warning("Warning: num_grat_arp/num_unsol_na (%d) not in range 0-255 so it was reset to 1\n",
num_peer_notif);
num_peer_notif = 1;
}
/* reset values for 802.3ad */
if (bond_mode == BOND_MODE_8023AD) {
if (!miimon) {
pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
pr_warning("Forcing miimon to 100msec\n");
miimon = 100;
}
}
if (tx_queues < 1 || tx_queues > 255) {
pr_warning("Warning: tx_queues (%d) should be between "
"1 and 255, resetting to %d\n",
tx_queues, <API key>);
tx_queues = <API key>;
}
if ((all_slaves_active != 0) && (all_slaves_active != 1)) {
pr_warning("Warning: all_slaves_active module parameter (%d), "
"not of valid value (0/1), so it was set to "
"0\n", all_slaves_active);
all_slaves_active = 0;
}
if (resend_igmp < 0 || resend_igmp > 255) {
pr_warning("Warning: resend_igmp (%d) should be between "
"0 and 255, resetting to %d\n",
resend_igmp, <API key>);
resend_igmp = <API key>;
}
/* reset values for TLB/ALB */
if ((bond_mode == BOND_MODE_TLB) ||
(bond_mode == BOND_MODE_ALB)) {
if (!miimon) {
pr_warning("Warning: miimon must be specified, otherwise bonding will not detect link failure and link speed which are essential for TLB/ALB load balancing\n");
pr_warning("Forcing miimon to 100msec\n");
miimon = 100;
}
}
if (bond_mode == BOND_MODE_ALB) {
pr_notice("In ALB mode you might experience client disconnections upon reconnection of a link if the bonding module updelay parameter (%d msec) is incompatible with the forwarding delay time of the switch\n",
updelay);
}
if (!miimon) {
if (updelay || downdelay) {
/* just warn the user the up/down delay will have
* no effect since miimon is zero...
*/
pr_warning("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n",
updelay, downdelay);
}
} else {
/* don't allow arp monitoring */
if (arp_interval) {
pr_warning("Warning: miimon (%d) and arp_interval (%d) can't be used simultaneously, disabling ARP monitoring\n",
miimon, arp_interval);
arp_interval = 0;
}
if ((updelay % miimon) != 0) {
pr_warning("Warning: updelay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
updelay, miimon,
(updelay / miimon) * miimon);
}
updelay /= miimon;
if ((downdelay % miimon) != 0) {
pr_warning("Warning: downdelay (%d) is not a multiple of miimon (%d), downdelay rounded to %d ms\n",
downdelay, miimon,
(downdelay / miimon) * miimon);
}
downdelay /= miimon;
}
if (arp_interval < 0) {
pr_warning("Warning: arp_interval module parameter (%d) , not in range 0-%d, so it was reset to %d\n",
arp_interval, INT_MAX, <API key>);
arp_interval = <API key>;
}
for (arp_ip_count = 0;
(arp_ip_count < <API key>) && arp_ip_target[arp_ip_count];
arp_ip_count++) {
/* not complete check, but should be good enough to
catch mistakes */
if (!isdigit(arp_ip_target[arp_ip_count][0])) {
pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
arp_ip_target[arp_ip_count]);
arp_interval = 0;
} else {
__be32 ip = in_aton(arp_ip_target[arp_ip_count]);
arp_target[arp_ip_count] = ip;
}
}
if (arp_interval && !arp_ip_count) {
/* don't allow arping if no arp_ip_target given... */
pr_warning("Warning: arp_interval module parameter (%d) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n",
arp_interval);
arp_interval = 0;
}
if (arp_validate) {
if (bond_mode != <API key>) {
pr_err("arp_validate only supported in active-backup mode\n");
return -EINVAL;
}
if (!arp_interval) {
pr_err("arp_validate requires arp_interval\n");
return -EINVAL;
}
arp_validate_value = bond_parse_parm(arp_validate,
arp_validate_tbl);
if (arp_validate_value == -1) {
pr_err("Error: invalid arp_validate \"%s\"\n",
arp_validate == NULL ? "NULL" : arp_validate);
return -EINVAL;
}
} else
arp_validate_value = 0;
if (miimon) {
pr_info("MII link monitoring set to %d ms\n", miimon);
} else if (arp_interval) {
int i;
pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):",
arp_interval,
arp_validate_tbl[arp_validate_value].modename,
arp_ip_count);
for (i = 0; i < arp_ip_count; i++)
pr_info(" %s", arp_ip_target[i]);
pr_info("\n");
} else if (max_bonds) {
/* miimon and arp_interval not set, we need one so things
* work as expected, see bonding.txt for details
*/
pr_warning("Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details.\n");
}
if (primary && !USES_PRIMARY(bond_mode)) {
/* currently, using a primary only makes sense
* in active backup, TLB or ALB modes
*/
pr_warning("Warning: %s primary device specified but has no effect in %s mode\n",
primary, bond_mode_name(bond_mode));
primary = NULL;
}
if (primary && primary_reselect) {
<API key> = bond_parse_parm(primary_reselect,
pri_reselect_tbl);
if (<API key> == -1) {
pr_err("Error: Invalid primary_reselect \"%s\"\n",
primary_reselect ==
NULL ? "NULL" : primary_reselect);
return -EINVAL;
}
} else {
<API key> = <API key>;
}
if (fail_over_mac) {
fail_over_mac_value = bond_parse_parm(fail_over_mac,
fail_over_mac_tbl);
if (fail_over_mac_value == -1) {
pr_err("Error: invalid fail_over_mac \"%s\"\n",
arp_validate == NULL ? "NULL" : arp_validate);
return -EINVAL;
}
if (bond_mode != <API key>)
pr_warning("Warning: fail_over_mac only affects active-backup mode.\n");
} else {
fail_over_mac_value = BOND_FOM_NONE;
}
/* fill params struct with the proper values */
params->mode = bond_mode;
params->xmit_policy = xmit_hashtype;
params->miimon = miimon;
params->num_peer_notif = num_peer_notif;
params->arp_interval = arp_interval;
params->arp_validate = arp_validate_value;
params->updelay = updelay;
params->downdelay = downdelay;
params->use_carrier = use_carrier;
params->lacp_fast = lacp_fast;
params->primary[0] = 0;
params->primary_reselect = <API key>;
params->fail_over_mac = fail_over_mac_value;
params->tx_queues = tx_queues;
params->all_slaves_active = all_slaves_active;
params->resend_igmp = resend_igmp;
if (primary) {
strncpy(params->primary, primary, IFNAMSIZ);
params->primary[IFNAMSIZ - 1] = 0;
}
memcpy(params->arp_targets, arp_target, sizeof(arp_target));
return 0;
}
static struct lock_class_key <API key>;
static struct lock_class_key <API key>;
static void <API key>(struct net_device *dev,
struct netdev_queue *txq,
void *_unused)
{
lockdep_set_class(&txq->_xmit_lock,
&<API key>);
}
static void <API key>(struct net_device *dev)
{
lockdep_set_class(&dev->addr_list_lock,
&<API key>);
<API key>(dev, <API key>, NULL);
}
/*
* Called from registration process
*/
static int bond_init(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct bond_net *bn = net_generic(dev_net(bond_dev), bond_net_id);
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
pr_debug("Begin bond_init for %s\n", bond_dev->name);
/*
* Initialize locks that may be required during
* en/deslave operations. All of the bond_open work
* (of which this is part) should really be moved to
* a phase prior to dev_open
*/
spin_lock_init(&(bond_info->tx_hashtbl_lock));
spin_lock_init(&(bond_info->rx_hashtbl_lock));
bond->wq = <API key>(bond_dev->name);
if (!bond->wq)
return -ENOMEM;
<API key>(bond_dev);
<API key>(bond);
list_add_tail(&bond->bond_list, &bn->dev_list);
<API key>(bond);
bond_debug_register(bond);
__hw_addr_init(&bond->mc_list);
return 0;
}
static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
{
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
return 0;
}
static struct rtnl_link_ops bond_link_ops __read_mostly = {
.kind = "bond",
.priv_size = sizeof(struct bonding),
.setup = bond_setup,
.validate = bond_validate,
};
/* Create a new bond based on the specified name and bonding parameters.
* If name is NULL, obtain a suitable "bond%d" name for us.
* Caller must NOT hold rtnl_lock; we need to release it here before we
* set up our sysfs entries.
*/
int bond_create(struct net *net, const char *name)
{
struct net_device *bond_dev;
int res;
rtnl_lock();
bond_dev = alloc_netdev_mq(sizeof(struct bonding),
name ? name : "bond%d",
bond_setup, tx_queues);
if (!bond_dev) {
pr_err("%s: eek! can't alloc netdev!\n", name);
rtnl_unlock();
return -ENOMEM;
}
dev_net_set(bond_dev, net);
bond_dev->rtnl_link_ops = &bond_link_ops;
res = register_netdevice(bond_dev);
netif_carrier_off(bond_dev);
rtnl_unlock();
if (res < 0)
bond_destructor(bond_dev);
return res;
}
static int __net_init bond_net_init(struct net *net)
{
struct bond_net *bn = net_generic(net, bond_net_id);
bn->net = net;
INIT_LIST_HEAD(&bn->dev_list);
<API key>(bn);
return 0;
}
static void __net_exit bond_net_exit(struct net *net)
{
struct bond_net *bn = net_generic(net, bond_net_id);
<API key>(bn);
}
static struct pernet_operations bond_net_ops = {
.init = bond_net_init,
.exit = bond_net_exit,
.id = &bond_net_id,
.size = sizeof(struct bond_net),
};
static int __init bonding_init(void)
{
int i;
int res;
pr_info("%s", bond_version);
res = bond_check_params(&bonding_defaults);
if (res)
goto out;
res = <API key>(&bond_net_ops);
if (res)
goto out;
res = rtnl_link_register(&bond_link_ops);
if (res)
goto err_link;
bond_create_debugfs();
for (i = 0; i < max_bonds; i++) {
res = bond_create(&init_net, NULL);
if (res)
goto err;
}
res = bond_create_sysfs();
if (res)
goto err;
<API key>(&<API key>);
<API key>(&<API key>);
out:
return res;
err:
<API key>(&bond_link_ops);
err_link:
<API key>(&bond_net_ops);
goto out;
}
static void __exit bonding_exit(void)
{
<API key>(&<API key>);
<API key>(&<API key>);
bond_destroy_sysfs();
<API key>();
<API key>(&bond_link_ops);
<API key>(&bond_net_ops);
#ifdef <API key>
/*
* Make sure we don't have an imbalance on our netpoll blocking
*/
WARN_ON(atomic_read(&netpoll_block_tx));
#endif
}
module_init(bonding_init);
module_exit(bonding_exit);
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
MODULE_DESCRIPTION(DRV_DESCRIPTION ", v" DRV_VERSION);
MODULE_AUTHOR("Thomas Davis, tadavis@lbl.gov and many others");
<API key>("bond"); |
/* <API key>: GPL-2.0 */
#ifndef _VIDEOBUF2_DVB_H_
#define _VIDEOBUF2_DVB_H_
#include <media/dvbdev.h>
#include <media/dmxdev.h>
#include <media/dvb_demux.h>
#include <media/dvb_net.h>
#include <media/dvb_frontend.h>
#include <media/videobuf2-v4l2.h>
/* We don't actually need to include media-device.h here */
struct media_device;
/*
* TODO: This header file should be replaced with videobuf2-core.h
* Currently, vb2_thread is not a stuff of videobuf2-core,
* since vb2_thread has many dependencies on videobuf2-v4l2.
*/
struct vb2_dvb {
/* filling that the job of the driver */
char *name;
struct dvb_frontend *frontend;
struct vb2_queue dvbq;
/* video-buf-dvb state info */
struct mutex lock;
int nfeeds;
/* vb2_dvb_(un)register manages this */
struct dvb_demux demux;
struct dmxdev dmxdev;
struct dmx_frontend fe_hw;
struct dmx_frontend fe_mem;
struct dvb_net net;
};
struct vb2_dvb_frontend {
struct list_head felist;
int id;
struct vb2_dvb dvb;
};
struct vb2_dvb_frontends {
struct list_head felist;
struct mutex lock;
struct dvb_adapter adapter;
int active_fe_id; /* Indicates which frontend in the felist is in use */
int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
};
int <API key>(struct vb2_dvb_frontends *f,
struct module *module,
void *adapter_priv,
struct device *device,
struct media_device *mdev,
short *adapter_nr,
int mfe_shared);
void <API key>(struct vb2_dvb_frontends *f);
struct vb2_dvb_frontend *<API key>(struct vb2_dvb_frontends *f, int id);
void <API key>(struct vb2_dvb_frontends *f);
struct vb2_dvb_frontend *<API key>(struct vb2_dvb_frontends *f, int id);
int <API key>(struct vb2_dvb_frontends *f, struct dvb_frontend *p);
#endif /* _VIDEOBUF2_DVB_H_ */ |
<?php
/**
* @file
* Contains \Drupal\content_translation\Access\<API key>.
*/
namespace Drupal\content_translation\Access;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\<API key>;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\<API key>;
use Drupal\Core\Routing\Access\AccessInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\Routing\Route;
/**
* Access check for entity translation CRUD operation.
*/
class <API key> implements AccessInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\<API key>
*/
protected $entityManager;
/**
* The language manager.
*
* @var \Drupal\Core\Language\<API key>
*/
protected $languageManager;
/**
* Constructs a <API key> object.
*
* @param \Drupal\Core\Entity\<API key> $manager
* The entity type manager.
* @param \Drupal\Core\Language\<API key> $language_manager
* The language manager.
*/
public function __construct(<API key> $manager, <API key> $language_manager) {
$this->entityManager = $manager;
$this->languageManager = $language_manager;
}
/**
* Checks translation access for the entity and operation on the given route.
*
* @param \Symfony\Component\Routing\Route $route
* The route to check against.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The parametrized route.
* @param \Drupal\Core\Session\AccountInterface $account
* The currently logged in account.
* @param string $source
* (optional) For a create operation, the language code of the source.
* @param string $target
* (optional) For a create operation, the language code of the translation.
* @param string $language
* (optional) For an update or delete operation, the language code of the
* translation being updated or deleted.
* @param string $entity_type_id
* (optional) The entity type ID.
*
* @return \Drupal\Core\Access\<API key>
* The access result.
*/
public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account, $source = NULL, $target = NULL, $language = NULL, $entity_type_id = NULL) {
/* @var \Drupal\Core\Entity\<API key> $entity */
if ($entity = $route_match->getParameter($entity_type_id)) {
$operation = $route->getRequirement('<API key>');
$language = $this->languageManager->getLanguage($language) ?: $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT);
$entity_type = $this->entityManager->getDefinition($entity_type_id);
if (in_array($operation, ['update', 'delete'])) {
// Translation operations cannot be performed on the default
// translation.
if ($language->getId() == $entity->getUntranslated()->language()->getId()) {
return AccessResult::forbidden()-><API key>($entity);
}
// Editors have no access to the translation operations, as entity
// access already grants them an equal or greater access level.
$templates = ['update' => 'edit-form', 'delete' => 'delete-form'];
if ($entity->access($operation) && $entity_type->hasLinkTemplate($templates[$operation])) {
return AccessResult::forbidden()->cachePerPermissions();
}
}
if ($account->hasPermission('translate any entity')) {
return AccessResult::allowed()->cachePerPermissions();
}
/* @var \Drupal\content_translation\<API key> $handler */
$handler = $this->entityManager->getHandler($entity->getEntityTypeId(), 'translation');
// Load translation.
$translations = $entity-><API key>();
$languages = $this->languageManager->getLanguages();
switch ($operation) {
case 'create':
$source_language = $this->languageManager->getLanguage($source) ?: $entity->language();
$target_language = $this->languageManager->getLanguage($target) ?: $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT);
$is_new_translation = ($source_language->getId() != $target_language->getId()
&& isset($languages[$source_language->getId()])
&& isset($languages[$target_language->getId()])
&& !isset($translations[$target_language->getId()]));
return AccessResult::allowedIf($is_new_translation)->cachePerPermissions()-><API key>($entity)
->andIf($handler-><API key>($entity, $operation));
case 'delete':
case 'update':
$has_translation = isset($languages[$language->getId()])
&& $language->getId() != $entity->getUntranslated()->language()->getId()
&& isset($translations[$language->getId()]);
return AccessResult::allowedIf($has_translation)->cachePerPermissions()-><API key>($entity)
->andIf($handler-><API key>($entity, $operation));
}
}
// No opinion.
return AccessResult::neutral();
}
} |
// JSLint options:
/*global Effect, Class, Event, Element, $, $$, $A */
// Adapter interface between prototype and the Highcharts charting library
var HighchartsAdapter = (function () {
var hasEffect = typeof Effect !== 'undefined';
return {
/**
* Initialize the adapter. This is run once as Highcharts is first run.
* @param {Object} pathAnim The helper object to do animations across adapters.
*/
init: function (pathAnim) {
if (hasEffect) {
/**
* Animation for Highcharts SVG element wrappers only
* @param {Object} element
* @param {Object} attribute
* @param {Object} to
* @param {Object} options
*/
Effect.<API key> = Class.create(Effect.Base, {
initialize: function (element, attr, to, options) {
var from,
opts;
this.element = element;
this.key = attr;
from = element.attr ? element.attr(attr) : $(element).getStyle(attr);
// special treatment for paths
if (attr === 'd') {
this.paths = pathAnim.init(
element,
element.d,
to
);
this.toD = to;
// fake values in order to read relative position as a float in update
from = 0;
to = 1;
}
opts = Object.extend((options || {}), {
from: from,
to: to,
attribute: attr
});
this.start(opts);
},
setup: function () {
HighchartsAdapter._extend(this.element);
// If this is the first animation on this object, create the <API key> helper that
// contain pointers to the animation objects.
if (!this.element.<API key>) {
this.element.<API key> = {};
}
// Store a reference to this animation instance.
this.element.<API key>[this.key] = this;
},
update: function (position) {
var paths = this.paths,
element = this.element,
obj;
if (paths) {
position = pathAnim.step(paths[0], paths[1], position, this.toD);
}
if (element.attr) { // SVGElement
if (element.element) { // If not, it has been destroyed (#1405)
element.attr(this.options.attribute, position);
}
} else { // HTML, #409
obj = {};
obj[this.options.attribute] = position;
$(element).setStyle(obj);
}
},
finish: function () {
// Delete the property that holds this animation now that it is finished.
// Both canceled animations and complete ones gets a 'finish' call.
if (this.element && this.element.<API key>) { // #1405
delete this.element.<API key>[this.key];
}
}
});
}
},
/**
* Run a general method on the framework, following jQuery syntax
* @param {Object} el The HTML element
* @param {String} method Which method to run on the wrapped element
*/
adapterRun: function (el, method) {
// This currently works for getting inner width and height. If adding
// more methods later, we need a conditional implementation for each.
return parseInt($(el).getStyle(method), 10);
},
/**
* Downloads a script and executes a callback when done.
* @param {String} scriptLocation
* @param {Function} callback
*/
getScript: function (scriptLocation, callback) {
var head = $$('head')[0]; // Returns an array, so pick the first element.
if (head) {
// Append a new 'script' element, set its type and src attributes, add a 'load' handler that calls the callback
head.appendChild(new Element('script', { type: 'text/javascript', src: scriptLocation}).observe('load', callback));
}
},
/**
* Custom events in prototype needs to be namespaced. This method adds a namespace 'h:' in front of
* events that are not recognized as native.
*/
addNS: function (eventName) {
var HTMLEvents = /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
MouseEvents = /^(?:click|mouse(?:down|up|over|move|out))$/;
return (HTMLEvents.test(eventName) || MouseEvents.test(eventName)) ?
eventName :
'h:' + eventName;
},
// el needs an event to be attached. el is not necessarily a dom element
addEvent: function (el, event, fn) {
if (el.addEventListener || el.attachEvent) {
Event.observe($(el), HighchartsAdapter.addNS(event), fn);
} else {
HighchartsAdapter._extend(el);
el._highcharts_observe(event, fn);
}
},
// motion makes things pretty. use it if effects is loaded, if not... still get to the end result.
animate: function (el, params, options) {
var key,
fx;
// default options
options = options || {};
options.delay = 0;
options.duration = (options.duration || 500) / 1000;
options.afterFinish = options.complete;
// animate wrappers and DOM elements
if (hasEffect) {
for (key in params) {
// The fx variable is seemingly thrown away here, but the Effect.setup will add itself to the <API key> object
// on the element itself so its not really lost.
fx = new Effect.<API key>($(el), key, params[key], options);
}
} else {
if (el.attr) { // #409 without effects
for (key in params) {
el.attr(key, params[key]);
}
}
if (options.complete) {
options.complete();
}
}
if (!el.attr) { // HTML element, #409
$(el).setStyle(params);
}
},
// this only occurs in higcharts 2.0+
stop: function (el) {
var key;
if (el.<API key> && el.<API key>) {
for (key in el.<API key>) {
// Cancel the animation
// The 'finish' function in the Effect object will remove the reference
el.<API key>[key].cancel();
}
}
},
// um.. each
each: function (arr, fn) {
$A(arr).each(fn);
},
inArray: function (item, arr, from) {
return arr ? arr.indexOf(item, from) : -1;
},
/**
* Get the cumulative offset relative to the top left of the page. This method, unlike its
* jQuery and MooTools counterpart, still suffers from issue #208 regarding the position
* of a chart within a fixed container.
*/
offset: function (el) {
return $(el).cumulativeOffset();
},
// fire an event based on an event name (event) and an object (el).
// again, el may not be a dom element
fireEvent: function (el, event, eventArguments, defaultFunction) {
if (el.fire) {
el.fire(HighchartsAdapter.addNS(event), eventArguments);
} else if (el.<API key>) {
eventArguments = eventArguments || {};
el._highcharts_fire(event, eventArguments);
}
if (eventArguments && eventArguments.defaultPrevented) {
defaultFunction = null;
}
if (defaultFunction) {
defaultFunction(eventArguments);
}
},
removeEvent: function (el, event, handler) {
if ($(el).stopObserving) {
if (event) {
event = HighchartsAdapter.addNS(event);
}
$(el).stopObserving(event, handler);
} if (window === el) {
Event.stopObserving(el, event, handler);
} else {
HighchartsAdapter._extend(el);
el.<API key>(event, handler);
}
},
washMouseEvent: function (e) {
return e;
},
// um, grep
grep: function (arr, fn) {
return arr.findAll(fn);
},
// um, map
map: function (arr, fn) {
return arr.map(fn);
},
// extend an object to handle highchart events (highchart objects, not svg elements).
// this is a very simple way of handling events but whatever, it works (i think)
_extend: function (object) {
if (!object.<API key>) {
Object.extend(object, {
_highchart_events: {},
<API key>: null,
<API key>: true,
_highcharts_observe: function (name, fn) {
this._highchart_events[name] = [this._highchart_events[name], fn].compact().flatten();
},
<API key>: function (name, fn) {
if (name) {
if (fn) {
this._highchart_events[name] = [this._highchart_events[name]].compact().flatten().without(fn);
} else {
delete this._highchart_events[name];
}
} else {
this._highchart_events = {};
}
},
_highcharts_fire: function (name, args) {
var target = this;
(this._highchart_events[name] || []).each(function (fn) {
// args is never null here
if (args.stopped) {
return; // "throw $break" wasn't working. i think because of the scope of 'this'.
}
// Attach a simple preventDefault function to skip default handler if called
args.preventDefault = function () {
args.defaultPrevented = true;
};
args.target = target;
// If the event handler return false, prevent the default handler from executing
if (fn.bind(this)(args) === false) {
args.preventDefault();
}
}
.bind(this));
}
});
}
}
};
}()); |
#ifndef _ASM_IA64_BREAK_H
#define _ASM_IA64_BREAK_H
/*
* OS-specific debug break numbers:
*/
#define __IA64_BREAK_KDB 0x80100
#define __IA64_BREAK_KPROBE 0x81000 /* .. 0x81fff */
#define __IA64_BREAK_JPROBE 0x82000
/*
* OS-specific break numbers:
*/
#define <API key> 0x100000
#endif /* _ASM_IA64_BREAK_H */ |
export * from './hero-list';
export * from './shared'; |
# prefix.rb
module Puppet::Parser::Functions
newfunction(:prefix, :type => :rvalue, :doc => <<-EOS
This function applies a prefix to all elements in an array.
*Examples:*
prefix(['a','b','c'], 'p')
Will return: ['pa','pb','pc']
EOS
) do |arguments|
# Technically we support two arguments but only first is mandatory ...
raise(Puppet::ParseError, "prefix(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1
array = arguments[0]
unless array.is_a?(Array)
raise Puppet::ParseError, "prefix(): expected first argument to be an Array, got #{array.inspect}"
end
prefix = arguments[1] if arguments[1]
if prefix
unless prefix.is_a?(String)
raise Puppet::ParseError, "prefix(): expected second argument to be a String, got #{suffix.inspect}"
end
end
# Turn everything into string same as join would do ...
result = array.collect do |i|
i = i.to_s
prefix ? prefix + i : i
end
return result
end
end
# vim: set ts=2 sw=2 et : |
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-<API key>: 100%;
}
body {
margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
}
input[type="number"]::-<API key>,
input[type="number"]::-<API key> {
height: auto;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-<API key>,
input[type="search"]::-<API key> {
-webkit-appearance: none;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
@media print {
* {
text-shadow: none !important;
color: #000 !important;
background: transparent !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
select {
background: #fff !important;
}
.navbar {
display: none;
}
.table td,
.table th {
background-color: #fff !important;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/<API key>.eot');
src: url('../fonts/<API key>.eot?#iefix') format('embedded-opentype'), url('../fonts/<API key>.woff') format('woff'), url('../fonts/<API key>.ttf') format('truetype'), url('../fonts/<API key>.svg#<API key>') format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-<API key>: antialiased;
-<API key>: grayscale;
}
.glyphicon-asterisk:before {
content: "\2a";
}
.glyphicon-plus:before {
content: "\2b";
}
.glyphicon-euro:before {
content: "\20ac";
}
.glyphicon-minus:before {
content: "\2212";
}
.glyphicon-cloud:before {
content: "\2601";
}
.glyphicon-envelope:before {
content: "\2709";
}
.glyphicon-pencil:before {
content: "\270f";
}
.glyphicon-glass:before {
content: "\e001";
}
.glyphicon-music:before {
content: "\e002";
}
.glyphicon-search:before {
content: "\e003";
}
.glyphicon-heart:before {
content: "\e005";
}
.glyphicon-star:before {
content: "\e006";
}
.<API key>:before {
content: "\e007";
}
.glyphicon-user:before {
content: "\e008";
}
.glyphicon-film:before {
content: "\e009";
}
.glyphicon-th-large:before {
content: "\e010";
}
.glyphicon-th:before {
content: "\e011";
}
.glyphicon-th-list:before {
content: "\e012";
}
.glyphicon-ok:before {
content: "\e013";
}
.glyphicon-remove:before {
content: "\e014";
}
.glyphicon-zoom-in:before {
content: "\e015";
}
.glyphicon-zoom-out:before {
content: "\e016";
}
.glyphicon-off:before {
content: "\e017";
}
.glyphicon-signal:before {
content: "\e018";
}
.glyphicon-cog:before {
content: "\e019";
}
.glyphicon-trash:before {
content: "\e020";
}
.glyphicon-home:before {
content: "\e021";
}
.glyphicon-file:before {
content: "\e022";
}
.glyphicon-time:before {
content: "\e023";
}
.glyphicon-road:before {
content: "\e024";
}
.<API key>:before {
content: "\e025";
}
.glyphicon-download:before {
content: "\e026";
}
.glyphicon-upload:before {
content: "\e027";
}
.glyphicon-inbox:before {
content: "\e028";
}
.<API key>:before {
content: "\e029";
}
.glyphicon-repeat:before {
content: "\e030";
}
.glyphicon-refresh:before {
content: "\e031";
}
.glyphicon-list-alt:before {
content: "\e032";
}
.glyphicon-lock:before {
content: "\e033";
}
.glyphicon-flag:before {
content: "\e034";
}
.<API key>:before {
content: "\e035";
}
.<API key>:before {
content: "\e036";
}
.<API key>:before {
content: "\e037";
}
.glyphicon-volume-up:before {
content: "\e038";
}
.glyphicon-qrcode:before {
content: "\e039";
}
.glyphicon-barcode:before {
content: "\e040";
}
.glyphicon-tag:before {
content: "\e041";
}
.glyphicon-tags:before {
content: "\e042";
}
.glyphicon-book:before {
content: "\e043";
}
.glyphicon-bookmark:before {
content: "\e044";
}
.glyphicon-print:before {
content: "\e045";
}
.glyphicon-camera:before {
content: "\e046";
}
.glyphicon-font:before {
content: "\e047";
}
.glyphicon-bold:before {
content: "\e048";
}
.glyphicon-italic:before {
content: "\e049";
}
.<API key>:before {
content: "\e050";
}
.<API key>:before {
content: "\e051";
}
.<API key>:before {
content: "\e052";
}
.<API key>:before {
content: "\e053";
}
.<API key>:before {
content: "\e054";
}
.<API key>:before {
content: "\e055";
}
.glyphicon-list:before {
content: "\e056";
}
.<API key>:before {
content: "\e057";
}
.<API key>:before {
content: "\e058";
}
.<API key>:before {
content: "\e059";
}
.glyphicon-picture:before {
content: "\e060";
}
.<API key>:before {
content: "\e062";
}
.glyphicon-adjust:before {
content: "\e063";
}
.glyphicon-tint:before {
content: "\e064";
}
.glyphicon-edit:before {
content: "\e065";
}
.glyphicon-share:before {
content: "\e066";
}
.glyphicon-check:before {
content: "\e067";
}
.glyphicon-move:before {
content: "\e068";
}
.<API key>:before {
content: "\e069";
}
.<API key>:before {
content: "\e070";
}
.glyphicon-backward:before {
content: "\e071";
}
.glyphicon-play:before {
content: "\e072";
}
.glyphicon-pause:before {
content: "\e073";
}
.glyphicon-stop:before {
content: "\e074";
}
.glyphicon-forward:before {
content: "\e075";
}
.<API key>:before {
content: "\e076";
}
.<API key>:before {
content: "\e077";
}
.glyphicon-eject:before {
content: "\e078";
}
.<API key>:before {
content: "\e079";
}
.<API key>:before {
content: "\e080";
}
.glyphicon-plus-sign:before {
content: "\e081";
}
.<API key>:before {
content: "\e082";
}
.<API key>:before {
content: "\e083";
}
.glyphicon-ok-sign:before {
content: "\e084";
}
.<API key>:before {
content: "\e085";
}
.glyphicon-info-sign:before {
content: "\e086";
}
.<API key>:before {
content: "\e087";
}
.<API key>:before {
content: "\e088";
}
.glyphicon-ok-circle:before {
content: "\e089";
}
.<API key>:before {
content: "\e090";
}
.<API key>:before {
content: "\e091";
}
.<API key>:before {
content: "\e092";
}
.glyphicon-arrow-up:before {
content: "\e093";
}
.<API key>:before {
content: "\e094";
}
.glyphicon-share-alt:before {
content: "\e095";
}
.<API key>:before {
content: "\e096";
}
.<API key>:before {
content: "\e097";
}
.<API key>:before {
content: "\e101";
}
.glyphicon-gift:before {
content: "\e102";
}
.glyphicon-leaf:before {
content: "\e103";
}
.glyphicon-fire:before {
content: "\e104";
}
.glyphicon-eye-open:before {
content: "\e105";
}
.glyphicon-eye-close:before {
content: "\e106";
}
.<API key>:before {
content: "\e107";
}
.glyphicon-plane:before {
content: "\e108";
}
.glyphicon-calendar:before {
content: "\e109";
}
.glyphicon-random:before {
content: "\e110";
}
.glyphicon-comment:before {
content: "\e111";
}
.glyphicon-magnet:before {
content: "\e112";
}
.<API key>:before {
content: "\e113";
}
.<API key>:before {
content: "\e114";
}
.glyphicon-retweet:before {
content: "\e115";
}
.<API key>:before {
content: "\e116";
}
.<API key>:before {
content: "\e117";
}
.<API key>:before {
content: "\e118";
}
.<API key>:before {
content: "\e119";
}
.<API key>:before {
content: "\e120";
}
.glyphicon-hdd:before {
content: "\e121";
}
.glyphicon-bullhorn:before {
content: "\e122";
}
.glyphicon-bell:before {
content: "\e123";
}
.<API key>:before {
content: "\e124";
}
.glyphicon-thumbs-up:before {
content: "\e125";
}
.<API key>:before {
content: "\e126";
}
.<API key>:before {
content: "\e127";
}
.glyphicon-hand-left:before {
content: "\e128";
}
.glyphicon-hand-up:before {
content: "\e129";
}
.glyphicon-hand-down:before {
content: "\e130";
}
.<API key>:before {
content: "\e131";
}
.<API key>:before {
content: "\e132";
}
.<API key>:before {
content: "\e133";
}
.<API key>:before {
content: "\e134";
}
.glyphicon-globe:before {
content: "\e135";
}
.glyphicon-wrench:before {
content: "\e136";
}
.glyphicon-tasks:before {
content: "\e137";
}
.glyphicon-filter:before {
content: "\e138";
}
.glyphicon-briefcase:before {
content: "\e139";
}
.<API key>:before {
content: "\e140";
}
.glyphicon-dashboard:before {
content: "\e141";
}
.glyphicon-paperclip:before {
content: "\e142";
}
.<API key>:before {
content: "\e143";
}
.glyphicon-link:before {
content: "\e144";
}
.glyphicon-phone:before {
content: "\e145";
}
.glyphicon-pushpin:before {
content: "\e146";
}
.glyphicon-usd:before {
content: "\e148";
}
.glyphicon-gbp:before {
content: "\e149";
}
.glyphicon-sort:before {
content: "\e150";
}
.<API key>:before {
content: "\e151";
}
.<API key>:before {
content: "\e152";
}
.<API key>:before {
content: "\e153";
}
.<API key>:before {
content: "\e154";
}
.<API key>:before {
content: "\e155";
}
.<API key>:before {
content: "\e156";
}
.glyphicon-unchecked:before {
content: "\e157";
}
.glyphicon-expand:before {
content: "\e158";
}
.<API key>:before {
content: "\e159";
}
.<API key>:before {
content: "\e160";
}
.glyphicon-log-in:before {
content: "\e161";
}
.glyphicon-flash:before {
content: "\e162";
}
.glyphicon-log-out:before {
content: "\e163";
}
.<API key>:before {
content: "\e164";
}
.glyphicon-record:before {
content: "\e165";
}
.glyphicon-save:before {
content: "\e166";
}
.glyphicon-open:before {
content: "\e167";
}
.glyphicon-saved:before {
content: "\e168";
}
.glyphicon-import:before {
content: "\e169";
}
.glyphicon-export:before {
content: "\e170";
}
.glyphicon-send:before {
content: "\e171";
}
.<API key>:before {
content: "\e172";
}
.<API key>:before {
content: "\e173";
}
.<API key>:before {
content: "\e174";
}
.<API key>:before {
content: "\e175";
}
.<API key>:before {
content: "\e176";
}
.<API key>:before {
content: "\e177";
}
.glyphicon-transfer:before {
content: "\e178";
}
.glyphicon-cutlery:before {
content: "\e179";
}
.glyphicon-header:before {
content: "\e180";
}
.<API key>:before {
content: "\e181";
}
.glyphicon-earphone:before {
content: "\e182";
}
.glyphicon-phone-alt:before {
content: "\e183";
}
.glyphicon-tower:before {
content: "\e184";
}
.glyphicon-stats:before {
content: "\e185";
}
.glyphicon-sd-video:before {
content: "\e186";
}
.glyphicon-hd-video:before {
content: "\e187";
}
.glyphicon-subtitles:before {
content: "\e188";
}
.<API key>:before {
content: "\e189";
}
.<API key>:before {
content: "\e190";
}
.glyphicon-sound-5-1:before {
content: "\e191";
}
.glyphicon-sound-6-1:before {
content: "\e192";
}
.glyphicon-sound-7-1:before {
content: "\e193";
}
.<API key>:before {
content: "\e194";
}
.<API key>:before {
content: "\e195";
}
.<API key>:before {
content: "\e197";
}
.<API key>:before {
content: "\e198";
}
.<API key>:before {
content: "\e199";
}
.<API key>:before {
content: "\e200";
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 10px;
-<API key>: rgba(0, 0, 0, 0);
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
background-color: #ffffff;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
a {
color: #2fa4e7;
text-decoration: none;
}
a:hover,
a:focus {
color: #157ab5;
text-decoration: underline;
}
a:focus {
outline: thin dotted;
outline: 5px auto -<API key>;
outline-offset: -2px;
}
figure {
margin: 0;
}
img {
vertical-align: middle;
}
.img-responsive,
.thumbnail > img,
.thumbnail a > img,
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
display: block;
width: 100% \9;
max-width: 100%;
height: auto;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
padding: 4px;
line-height: 1.42857143;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
width: 100% \9;
max-width: 100%;
height: auto;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 500;
line-height: 1.1;
color: #317eac;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small,
.h1 small,
.h2 small,
.h3 small,
.h4 small,
.h5 small,
.h6 small,
h1 .small,
h2 .small,
h3 .small,
h4 .small,
h5 .small,
h6 .small,
.h1 .small,
.h2 .small,
.h3 .small,
.h4 .small,
.h5 .small,
.h6 .small {
font-weight: normal;
line-height: 1;
color: #999999;
}
h1,
.h1,
h2,
.h2,
h3,
.h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h1 small,
.h1 small,
h2 small,
.h2 small,
h3 small,
.h3 small,
h1 .small,
.h1 .small,
h2 .small,
.h2 .small,
h3 .small,
.h3 .small {
font-size: 65%;
}
h4,
.h4,
h5,
.h5,
h6,
.h6 {
margin-top: 10px;
margin-bottom: 10px;
}
h4 small,
.h4 small,
h5 small,
.h5 small,
h6 small,
.h6 small,
h4 .small,
.h4 .small,
h5 .small,
.h5 .small,
h6 .small,
.h6 .small {
font-size: 75%;
}
h1,
.h1 {
font-size: 36px;
}
h2,
.h2 {
font-size: 30px;
}
h3,
.h3 {
font-size: 24px;
}
h4,
.h4 {
font-size: 18px;
}
h5,
.h5 {
font-size: 14px;
}
h6,
.h6 {
font-size: 12px;
}
p {
margin: 0 0 10px;
}
.lead {
margin-bottom: 20px;
font-size: 16px;
font-weight: 300;
line-height: 1.4;
}
@media (min-width: 768px) {
.lead {
font-size: 21px;
}
}
small,
.small {
font-size: 85%;
}
cite {
font-style: normal;
}
mark,
.mark {
background-color: #fcf8e3;
padding: .2em;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-center {
text-align: center;
}
.text-justify {
text-align: justify;
}
.text-nowrap {
white-space: nowrap;
}
.text-lowercase {
text-transform: lowercase;
}
.text-uppercase {
text-transform: uppercase;
}
.text-capitalize {
text-transform: capitalize;
}
.text-muted {
color: #999999;
}
.text-primary {
color: #2fa4e7;
}
a.text-primary:hover {
color: #178acc;
}
.text-success {
color: #468847;
}
a.text-success:hover {
color: #356635;
}
.text-info {
color: #3a87ad;
}
a.text-info:hover {
color: #2d6987;
}
.text-warning {
color: #c09853;
}
a.text-warning:hover {
color: #a47e3c;
}
.text-danger {
color: #b94a48;
}
a.text-danger:hover {
color: #953b39;
}
.bg-primary {
color: #fff;
background-color: #2fa4e7;
}
a.bg-primary:hover {
background-color: #178acc;
}
.bg-success {
background-color: #dff0d8;
}
a.bg-success:hover {
background-color: #c1e2b3;
}
.bg-info {
background-color: #d9edf7;
}
a.bg-info:hover {
background-color: #afd9ee;
}
.bg-warning {
background-color: #fcf8e3;
}
a.bg-warning:hover {
background-color: #f7ecb5;
}
.bg-danger {
background-color: #f2dede;
}
a.bg-danger:hover {
background-color: #e4b9b9;
}
.page-header {
padding-bottom: 9px;
margin: 40px 0 20px;
border-bottom: 1px solid #eeeeee;
}
ul,
ol {
margin-top: 0;
margin-bottom: 10px;
}
ul ul,
ol ul,
ul ol,
ol ol {
margin-bottom: 0;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
.list-inline {
padding-left: 0;
list-style: none;
margin-left: -5px;
}
.list-inline > li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
dl {
margin-top: 0;
margin-bottom: 20px;
}
dt,
dd {
line-height: 1.42857143;
}
dt {
font-weight: bold;
}
dd {
margin-left: 0;
}
@media (min-width: 768px) {
.dl-horizontal dt {
float: left;
width: 160px;
clear: left;
text-align: right;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dl-horizontal dd {
margin-left: 180px;
}
}
abbr[title],
abbr[data-original-title] {
cursor: help;
border-bottom: 1px dotted #999999;
}
.initialism {
font-size: 90%;
text-transform: uppercase;
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eeeeee;
}
blockquote p:last-child,
blockquote ul:last-child,
blockquote ol:last-child {
margin-bottom: 0;
}
blockquote footer,
blockquote small,
blockquote .small {
display: block;
font-size: 80%;
line-height: 1.42857143;
color: #999999;
}
blockquote footer:before,
blockquote small:before,
blockquote .small:before {
content: '\2014 \00A0';
}
.blockquote-reverse,
blockquote.pull-right {
padding-right: 15px;
padding-left: 0;
border-right: 5px solid #eeeeee;
border-left: 0;
text-align: right;
}
.blockquote-reverse footer:before,
blockquote.pull-right footer:before,
.blockquote-reverse small:before,
blockquote.pull-right small:before,
.blockquote-reverse .small:before,
blockquote.pull-right .small:before {
content: '';
}
.blockquote-reverse footer:after,
blockquote.pull-right footer:after,
.blockquote-reverse small:after,
blockquote.pull-right small:after,
.blockquote-reverse .small:after,
blockquote.pull-right .small:after {
content: '\00A0 \2014';
}
blockquote:before,
blockquote:after {
content: "";
}
address {
margin-bottom: 20px;
font-style: normal;
line-height: 1.42857143;
}
code,
kbd,
pre,
samp {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px;
}
kbd {
padding: 2px 4px;
font-size: 90%;
color: #ffffff;
background-color: #333333;
border-radius: 3px;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
kbd kbd {
padding: 0;
font-size: 100%;
box-shadow: none;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.42857143;
word-break: break-all;
word-wrap: break-word;
color: #333333;
background-color: #f5f5f5;
border: 1px solid #cccccc;
border-radius: 4px;
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
.pre-scrollable {
max-height: 340px;
overflow-y: scroll;
}
.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
.container-fluid {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
.row {
margin-left: -15px;
margin-right: -15px;
}
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
float: left;
}
.col-xs-12 {
width: 100%;
}
.col-xs-11 {
width: 91.66666667%;
}
.col-xs-10 {
width: 83.33333333%;
}
.col-xs-9 {
width: 75%;
}
.col-xs-8 {
width: 66.66666667%;
}
.col-xs-7 {
width: 58.33333333%;
}
.col-xs-6 {
width: 50%;
}
.col-xs-5 {
width: 41.66666667%;
}
.col-xs-4 {
width: 33.33333333%;
}
.col-xs-3 {
width: 25%;
}
.col-xs-2 {
width: 16.66666667%;
}
.col-xs-1 {
width: 8.33333333%;
}
.col-xs-pull-12 {
right: 100%;
}
.col-xs-pull-11 {
right: 91.66666667%;
}
.col-xs-pull-10 {
right: 83.33333333%;
}
.col-xs-pull-9 {
right: 75%;
}
.col-xs-pull-8 {
right: 66.66666667%;
}
.col-xs-pull-7 {
right: 58.33333333%;
}
.col-xs-pull-6 {
right: 50%;
}
.col-xs-pull-5 {
right: 41.66666667%;
}
.col-xs-pull-4 {
right: 33.33333333%;
}
.col-xs-pull-3 {
right: 25%;
}
.col-xs-pull-2 {
right: 16.66666667%;
}
.col-xs-pull-1 {
right: 8.33333333%;
}
.col-xs-pull-0 {
right: auto;
}
.col-xs-push-12 {
left: 100%;
}
.col-xs-push-11 {
left: 91.66666667%;
}
.col-xs-push-10 {
left: 83.33333333%;
}
.col-xs-push-9 {
left: 75%;
}
.col-xs-push-8 {
left: 66.66666667%;
}
.col-xs-push-7 {
left: 58.33333333%;
}
.col-xs-push-6 {
left: 50%;
}
.col-xs-push-5 {
left: 41.66666667%;
}
.col-xs-push-4 {
left: 33.33333333%;
}
.col-xs-push-3 {
left: 25%;
}
.col-xs-push-2 {
left: 16.66666667%;
}
.col-xs-push-1 {
left: 8.33333333%;
}
.col-xs-push-0 {
left: auto;
}
.col-xs-offset-12 {
margin-left: 100%;
}
.col-xs-offset-11 {
margin-left: 91.66666667%;
}
.col-xs-offset-10 {
margin-left: 83.33333333%;
}
.col-xs-offset-9 {
margin-left: 75%;
}
.col-xs-offset-8 {
margin-left: 66.66666667%;
}
.col-xs-offset-7 {
margin-left: 58.33333333%;
}
.col-xs-offset-6 {
margin-left: 50%;
}
.col-xs-offset-5 {
margin-left: 41.66666667%;
}
.col-xs-offset-4 {
margin-left: 33.33333333%;
}
.col-xs-offset-3 {
margin-left: 25%;
}
.col-xs-offset-2 {
margin-left: 16.66666667%;
}
.col-xs-offset-1 {
margin-left: 8.33333333%;
}
.col-xs-offset-0 {
margin-left: 0%;
}
@media (min-width: 768px) {
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
float: left;
}
.col-sm-12 {
width: 100%;
}
.col-sm-11 {
width: 91.66666667%;
}
.col-sm-10 {
width: 83.33333333%;
}
.col-sm-9 {
width: 75%;
}
.col-sm-8 {
width: 66.66666667%;
}
.col-sm-7 {
width: 58.33333333%;
}
.col-sm-6 {
width: 50%;
}
.col-sm-5 {
width: 41.66666667%;
}
.col-sm-4 {
width: 33.33333333%;
}
.col-sm-3 {
width: 25%;
}
.col-sm-2 {
width: 16.66666667%;
}
.col-sm-1 {
width: 8.33333333%;
}
.col-sm-pull-12 {
right: 100%;
}
.col-sm-pull-11 {
right: 91.66666667%;
}
.col-sm-pull-10 {
right: 83.33333333%;
}
.col-sm-pull-9 {
right: 75%;
}
.col-sm-pull-8 {
right: 66.66666667%;
}
.col-sm-pull-7 {
right: 58.33333333%;
}
.col-sm-pull-6 {
right: 50%;
}
.col-sm-pull-5 {
right: 41.66666667%;
}
.col-sm-pull-4 {
right: 33.33333333%;
}
.col-sm-pull-3 {
right: 25%;
}
.col-sm-pull-2 {
right: 16.66666667%;
}
.col-sm-pull-1 {
right: 8.33333333%;
}
.col-sm-pull-0 {
right: auto;
}
.col-sm-push-12 {
left: 100%;
}
.col-sm-push-11 {
left: 91.66666667%;
}
.col-sm-push-10 {
left: 83.33333333%;
}
.col-sm-push-9 {
left: 75%;
}
.col-sm-push-8 {
left: 66.66666667%;
}
.col-sm-push-7 {
left: 58.33333333%;
}
.col-sm-push-6 {
left: 50%;
}
.col-sm-push-5 {
left: 41.66666667%;
}
.col-sm-push-4 {
left: 33.33333333%;
}
.col-sm-push-3 {
left: 25%;
}
.col-sm-push-2 {
left: 16.66666667%;
}
.col-sm-push-1 {
left: 8.33333333%;
}
.col-sm-push-0 {
left: auto;
}
.col-sm-offset-12 {
margin-left: 100%;
}
.col-sm-offset-11 {
margin-left: 91.66666667%;
}
.col-sm-offset-10 {
margin-left: 83.33333333%;
}
.col-sm-offset-9 {
margin-left: 75%;
}
.col-sm-offset-8 {
margin-left: 66.66666667%;
}
.col-sm-offset-7 {
margin-left: 58.33333333%;
}
.col-sm-offset-6 {
margin-left: 50%;
}
.col-sm-offset-5 {
margin-left: 41.66666667%;
}
.col-sm-offset-4 {
margin-left: 33.33333333%;
}
.col-sm-offset-3 {
margin-left: 25%;
}
.col-sm-offset-2 {
margin-left: 16.66666667%;
}
.col-sm-offset-1 {
margin-left: 8.33333333%;
}
.col-sm-offset-0 {
margin-left: 0%;
}
}
@media (min-width: 992px) {
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left;
}
.col-md-12 {
width: 100%;
}
.col-md-11 {
width: 91.66666667%;
}
.col-md-10 {
width: 83.33333333%;
}
.col-md-9 {
width: 75%;
}
.col-md-8 {
width: 66.66666667%;
}
.col-md-7 {
width: 58.33333333%;
}
.col-md-6 {
width: 50%;
}
.col-md-5 {
width: 41.66666667%;
}
.col-md-4 {
width: 33.33333333%;
}
.col-md-3 {
width: 25%;
}
.col-md-2 {
width: 16.66666667%;
}
.col-md-1 {
width: 8.33333333%;
}
.col-md-pull-12 {
right: 100%;
}
.col-md-pull-11 {
right: 91.66666667%;
}
.col-md-pull-10 {
right: 83.33333333%;
}
.col-md-pull-9 {
right: 75%;
}
.col-md-pull-8 {
right: 66.66666667%;
}
.col-md-pull-7 {
right: 58.33333333%;
}
.col-md-pull-6 {
right: 50%;
}
.col-md-pull-5 {
right: 41.66666667%;
}
.col-md-pull-4 {
right: 33.33333333%;
}
.col-md-pull-3 {
right: 25%;
}
.col-md-pull-2 {
right: 16.66666667%;
}
.col-md-pull-1 {
right: 8.33333333%;
}
.col-md-pull-0 {
right: auto;
}
.col-md-push-12 {
left: 100%;
}
.col-md-push-11 {
left: 91.66666667%;
}
.col-md-push-10 {
left: 83.33333333%;
}
.col-md-push-9 {
left: 75%;
}
.col-md-push-8 {
left: 66.66666667%;
}
.col-md-push-7 {
left: 58.33333333%;
}
.col-md-push-6 {
left: 50%;
}
.col-md-push-5 {
left: 41.66666667%;
}
.col-md-push-4 {
left: 33.33333333%;
}
.col-md-push-3 {
left: 25%;
}
.col-md-push-2 {
left: 16.66666667%;
}
.col-md-push-1 {
left: 8.33333333%;
}
.col-md-push-0 {
left: auto;
}
.col-md-offset-12 {
margin-left: 100%;
}
.col-md-offset-11 {
margin-left: 91.66666667%;
}
.col-md-offset-10 {
margin-left: 83.33333333%;
}
.col-md-offset-9 {
margin-left: 75%;
}
.col-md-offset-8 {
margin-left: 66.66666667%;
}
.col-md-offset-7 {
margin-left: 58.33333333%;
}
.col-md-offset-6 {
margin-left: 50%;
}
.col-md-offset-5 {
margin-left: 41.66666667%;
}
.col-md-offset-4 {
margin-left: 33.33333333%;
}
.col-md-offset-3 {
margin-left: 25%;
}
.col-md-offset-2 {
margin-left: 16.66666667%;
}
.col-md-offset-1 {
margin-left: 8.33333333%;
}
.col-md-offset-0 {
margin-left: 0%;
}
}
@media (min-width: 1200px) {
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
.col-lg-12 {
width: 100%;
}
.col-lg-11 {
width: 91.66666667%;
}
.col-lg-10 {
width: 83.33333333%;
}
.col-lg-9 {
width: 75%;
}
.col-lg-8 {
width: 66.66666667%;
}
.col-lg-7 {
width: 58.33333333%;
}
.col-lg-6 {
width: 50%;
}
.col-lg-5 {
width: 41.66666667%;
}
.col-lg-4 {
width: 33.33333333%;
}
.col-lg-3 {
width: 25%;
}
.col-lg-2 {
width: 16.66666667%;
}
.col-lg-1 {
width: 8.33333333%;
}
.col-lg-pull-12 {
right: 100%;
}
.col-lg-pull-11 {
right: 91.66666667%;
}
.col-lg-pull-10 {
right: 83.33333333%;
}
.col-lg-pull-9 {
right: 75%;
}
.col-lg-pull-8 {
right: 66.66666667%;
}
.col-lg-pull-7 {
right: 58.33333333%;
}
.col-lg-pull-6 {
right: 50%;
}
.col-lg-pull-5 {
right: 41.66666667%;
}
.col-lg-pull-4 {
right: 33.33333333%;
}
.col-lg-pull-3 {
right: 25%;
}
.col-lg-pull-2 {
right: 16.66666667%;
}
.col-lg-pull-1 {
right: 8.33333333%;
}
.col-lg-pull-0 {
right: auto;
}
.col-lg-push-12 {
left: 100%;
}
.col-lg-push-11 {
left: 91.66666667%;
}
.col-lg-push-10 {
left: 83.33333333%;
}
.col-lg-push-9 {
left: 75%;
}
.col-lg-push-8 {
left: 66.66666667%;
}
.col-lg-push-7 {
left: 58.33333333%;
}
.col-lg-push-6 {
left: 50%;
}
.col-lg-push-5 {
left: 41.66666667%;
}
.col-lg-push-4 {
left: 33.33333333%;
}
.col-lg-push-3 {
left: 25%;
}
.col-lg-push-2 {
left: 16.66666667%;
}
.col-lg-push-1 {
left: 8.33333333%;
}
.col-lg-push-0 {
left: auto;
}
.col-lg-offset-12 {
margin-left: 100%;
}
.col-lg-offset-11 {
margin-left: 91.66666667%;
}
.col-lg-offset-10 {
margin-left: 83.33333333%;
}
.col-lg-offset-9 {
margin-left: 75%;
}
.col-lg-offset-8 {
margin-left: 66.66666667%;
}
.col-lg-offset-7 {
margin-left: 58.33333333%;
}
.col-lg-offset-6 {
margin-left: 50%;
}
.col-lg-offset-5 {
margin-left: 41.66666667%;
}
.col-lg-offset-4 {
margin-left: 33.33333333%;
}
.col-lg-offset-3 {
margin-left: 25%;
}
.col-lg-offset-2 {
margin-left: 16.66666667%;
}
.col-lg-offset-1 {
margin-left: 8.33333333%;
}
.col-lg-offset-0 {
margin-left: 0%;
}
}
table {
background-color: transparent;
}
th {
text-align: left;
}
.table {
width: 100%;
max-width: 100%;
margin-bottom: 20px;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
padding: 8px;
line-height: 1.42857143;
vertical-align: top;
border-top: 1px solid #dddddd;
}
.table > thead > tr > th {
vertical-align: bottom;
border-bottom: 2px solid #dddddd;
}
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.table > tbody + tbody {
border-top: 2px solid #dddddd;
}
.table .table {
background-color: #ffffff;
}
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
padding: 5px;
}
.table-bordered {
border: 1px solid #dddddd;
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
border: 1px solid #dddddd;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f9f9f9;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
background-color: #f5f5f5;
}
table col[class*="col-"] {
position: static;
float: none;
display: table-column;
}
table td[class*="col-"],
table th[class*="col-"] {
position: static;
float: none;
display: table-cell;
}
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
background-color: #f5f5f5;
}
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover,
.table-hover > tbody > tr.active:hover > td,
.table-hover > tbody > tr:hover > .active,
.table-hover > tbody > tr.active:hover > th {
background-color: #e8e8e8;
}
.table > thead > tr > td.success,
.table > tbody > tr > td.success,
.table > tfoot > tr > td.success,
.table > thead > tr > th.success,
.table > tbody > tr > th.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > tbody > tr.success > td,
.table > tfoot > tr.success > td,
.table > thead > tr.success > th,
.table > tbody > tr.success > th,
.table > tfoot > tr.success > th {
background-color: #dff0d8;
}
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover,
.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr:hover > .success,
.table-hover > tbody > tr.success:hover > th {
background-color: #d0e9c6;
}
.table > thead > tr > td.info,
.table > tbody > tr > td.info,
.table > tfoot > tr > td.info,
.table > thead > tr > th.info,
.table > tbody > tr > th.info,
.table > tfoot > tr > th.info,
.table > thead > tr.info > td,
.table > tbody > tr.info > td,
.table > tfoot > tr.info > td,
.table > thead > tr.info > th,
.table > tbody > tr.info > th,
.table > tfoot > tr.info > th {
background-color: #d9edf7;
}
.table-hover > tbody > tr > td.info:hover,
.table-hover > tbody > tr > th.info:hover,
.table-hover > tbody > tr.info:hover > td,
.table-hover > tbody > tr:hover > .info,
.table-hover > tbody > tr.info:hover > th {
background-color: #c4e3f3;
}
.table > thead > tr > td.warning,
.table > tbody > tr > td.warning,
.table > tfoot > tr > td.warning,
.table > thead > tr > th.warning,
.table > tbody > tr > th.warning,
.table > tfoot > tr > th.warning,
.table > thead > tr.warning > td,
.table > tbody > tr.warning > td,
.table > tfoot > tr.warning > td,
.table > thead > tr.warning > th,
.table > tbody > tr.warning > th,
.table > tfoot > tr.warning > th {
background-color: #fcf8e3;
}
.table-hover > tbody > tr > td.warning:hover,
.table-hover > tbody > tr > th.warning:hover,
.table-hover > tbody > tr.warning:hover > td,
.table-hover > tbody > tr:hover > .warning,
.table-hover > tbody > tr.warning:hover > th {
background-color: #faf2cc;
}
.table > thead > tr > td.danger,
.table > tbody > tr > td.danger,
.table > tfoot > tr > td.danger,
.table > thead > tr > th.danger,
.table > tbody > tr > th.danger,
.table > tfoot > tr > th.danger,
.table > thead > tr.danger > td,
.table > tbody > tr.danger > td,
.table > tfoot > tr.danger > td,
.table > thead > tr.danger > th,
.table > tbody > tr.danger > th,
.table > tfoot > tr.danger > th {
background-color: #f2dede;
}
.table-hover > tbody > tr > td.danger:hover,
.table-hover > tbody > tr > th.danger:hover,
.table-hover > tbody > tr.danger:hover > td,
.table-hover > tbody > tr:hover > .danger,
.table-hover > tbody > tr.danger:hover > th {
background-color: #ebcccc;
}
@media screen and (max-width: 767px) {
.table-responsive {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
overflow-x: auto;
-ms-overflow-style: -<API key>;
border: 1px solid #dddddd;
-<API key>: touch;
}
.table-responsive > .table {
margin-bottom: 0;
}
.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > th,
.table-responsive > .table > tfoot > tr > th,
.table-responsive > .table > thead > tr > td,
.table-responsive > .table > tbody > tr > td,
.table-responsive > .table > tfoot > tr > td {
white-space: nowrap;
}
.table-responsive > .table-bordered {
border: 0;
}
.table-responsive > .table-bordered > thead > tr > th:first-child,
.table-responsive > .table-bordered > tbody > tr > th:first-child,
.table-responsive > .table-bordered > tfoot > tr > th:first-child,
.table-responsive > .table-bordered > thead > tr > td:first-child,
.table-responsive > .table-bordered > tbody > tr > td:first-child,
.table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.table-responsive > .table-bordered > thead > tr > th:last-child,
.table-responsive > .table-bordered > tbody > tr > th:last-child,
.table-responsive > .table-bordered > tfoot > tr > th:last-child,
.table-responsive > .table-bordered > thead > tr > td:last-child,
.table-responsive > .table-bordered > tbody > tr > td:last-child,
.table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.table-responsive > .table-bordered > tbody > tr:last-child > th,
.table-responsive > .table-bordered > tfoot > tr:last-child > th,
.table-responsive > .table-bordered > tbody > tr:last-child > td,
.table-responsive > .table-bordered > tfoot > tr:last-child > td {
border-bottom: 0;
}
}
fieldset {
padding: 0;
margin: 0;
border: 0;
min-width: 0;
}
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: 20px;
font-size: 21px;
line-height: inherit;
color: #555555;
border: 0;
border-bottom: 1px solid #e5e5e5;
}
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: bold;
}
input[type="search"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9;
line-height: normal;
}
input[type="file"] {
display: block;
}
input[type="range"] {
display: block;
width: 100%;
}
select[multiple],
select[size] {
height: auto;
}
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
outline: thin dotted;
outline: 5px auto -<API key>;
outline-offset: -2px;
}
output {
display: block;
padding-top: 9px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
}
.form-control {
display: block;
width: 100%;
height: 38px;
padding: 8px 12px;
font-size: 14px;
line-height: 1.42857143;
color: #555555;
background-color: #ffffff;
background-image: none;
border: 1px solid #cccccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.form-control::-moz-placeholder {
color: #999999;
opacity: 1;
}
.form-control:-<API key> {
color: #999999;
}
.form-control::-<API key> {
color: #999999;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
cursor: not-allowed;
background-color: #eeeeee;
opacity: 1;
}
textarea.form-control {
height: auto;
}
input[type="search"] {
-webkit-appearance: none;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
line-height: 38px;
line-height: 1.42857143 \0;
}
input[type="date"].input-sm,
input[type="time"].input-sm,
input[type="datetime-local"].input-sm,
input[type="month"].input-sm {
line-height: 30px;
}
input[type="date"].input-lg,
input[type="time"].input-lg,
input[type="datetime-local"].input-lg,
input[type="month"].input-lg {
line-height: 54px;
}
.form-group {
margin-bottom: 15px;
}
.radio,
.checkbox {
position: relative;
display: block;
min-height: 20px;
margin-top: 10px;
margin-bottom: 10px;
}
.radio label,
.checkbox label {
padding-left: 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
position: absolute;
margin-left: -20px;
margin-top: 4px \9;
}
.radio + .radio,
.checkbox + .checkbox {
margin-top: -5px;
}
.radio-inline,
.checkbox-inline {
display: inline-block;
padding-left: 20px;
margin-bottom: 0;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
.radio-inline + .radio-inline,
.checkbox-inline + .checkbox-inline {
margin-top: 0;
margin-left: 10px;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"].disabled,
input[type="checkbox"].disabled,
fieldset[disabled] input[type="radio"],
fieldset[disabled] input[type="checkbox"] {
cursor: not-allowed;
}
.radio-inline.disabled,
.checkbox-inline.disabled,
fieldset[disabled] .radio-inline,
fieldset[disabled] .checkbox-inline {
cursor: not-allowed;
}
.radio.disabled label,
.checkbox.disabled label,
fieldset[disabled] .radio label,
fieldset[disabled] .checkbox label {
cursor: not-allowed;
}
.form-control-static {
padding-top: 9px;
padding-bottom: 9px;
margin-bottom: 0;
}
.form-control-static.input-lg,
.form-control-static.input-sm {
padding-left: 0;
padding-right: 0;
}
.input-sm,
.form-horizontal .form-group-sm .form-control {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-sm {
height: 30px;
line-height: 30px;
}
textarea.input-sm,
select[multiple].input-sm {
height: auto;
}
.input-lg,
.form-horizontal .form-group-lg .form-control {
height: 54px;
padding: 14px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.input-lg {
height: 54px;
line-height: 54px;
}
textarea.input-lg,
select[multiple].input-lg {
height: auto;
}
.has-feedback {
position: relative;
}
.has-feedback .form-control {
padding-right: 47.5px;
}
.<API key> {
position: absolute;
top: 25px;
right: 0;
z-index: 2;
display: block;
width: 38px;
height: 38px;
line-height: 38px;
text-align: center;
}
.input-lg + .<API key> {
width: 54px;
height: 54px;
line-height: 54px;
}
.input-sm + .<API key> {
width: 30px;
height: 30px;
line-height: 30px;
}
.has-success .help-block,
.has-success .control-label,
.has-success .radio,
.has-success .checkbox,
.has-success .radio-inline,
.has-success .checkbox-inline {
color: #468847;
}
.has-success .form-control {
border-color: #468847;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-success .form-control:focus {
border-color: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.has-success .input-group-addon {
color: #468847;
border-color: #468847;
background-color: #dff0d8;
}
.has-success .<API key> {
color: #468847;
}
.has-warning .help-block,
.has-warning .control-label,
.has-warning .radio,
.has-warning .checkbox,
.has-warning .radio-inline,
.has-warning .checkbox-inline {
color: #c09853;
}
.has-warning .form-control {
border-color: #c09853;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-warning .form-control:focus {
border-color: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.has-warning .input-group-addon {
color: #c09853;
border-color: #c09853;
background-color: #fcf8e3;
}
.has-warning .<API key> {
color: #c09853;
}
.has-error .help-block,
.has-error .control-label,
.has-error .radio,
.has-error .checkbox,
.has-error .radio-inline,
.has-error .checkbox-inline {
color: #b94a48;
}
.has-error .form-control {
border-color: #b94a48;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .form-control:focus {
border-color: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.has-error .input-group-addon {
color: #b94a48;
border-color: #b94a48;
background-color: #f2dede;
}
.has-error .<API key> {
color: #b94a48;
}
.has-feedback label.sr-only ~ .<API key> {
top: 0;
}
.help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: #959595;
}
@media (min-width: 768px) {
.form-inline .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.form-inline .input-group {
display: inline-table;
vertical-align: middle;
}
.form-inline .input-group .input-group-addon,
.form-inline .input-group .input-group-btn,
.form-inline .input-group .form-control {
width: auto;
}
.form-inline .input-group > .form-control {
width: 100%;
}
.form-inline .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio,
.form-inline .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.form-inline .radio label,
.form-inline .checkbox label {
padding-left: 0;
}
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.form-inline .has-feedback .<API key> {
top: 0;
}
}
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
margin-top: 0;
margin-bottom: 0;
padding-top: 9px;
}
.form-horizontal .radio,
.form-horizontal .checkbox {
min-height: 29px;
}
.form-horizontal .form-group {
margin-left: -15px;
margin-right: -15px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
text-align: right;
margin-bottom: 0;
padding-top: 9px;
}
}
.form-horizontal .has-feedback .<API key> {
top: 0;
right: 15px;
}
@media (min-width: 768px) {
.form-horizontal .form-group-lg .control-label {
padding-top: 19.62px;
}
}
@media (min-width: 768px) {
.form-horizontal .form-group-sm .control-label {
padding-top: 6px;
}
}
.btn {
display: inline-block;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 8px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn:focus,
.btn:active:focus,
.btn.active:focus {
outline: thin dotted;
outline: 5px auto -<API key>;
outline-offset: -2px;
}
.btn:hover,
.btn:focus {
color: #555555;
text-decoration: none;
}
.btn:active,
.btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
cursor: not-allowed;
pointer-events: none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-default {
color: #555555;
background-color: #ffffff;
border-color: rgba(0, 0, 0, 0.1);
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #555555;
background-color: #e6e6e6;
border-color: rgba(0, 0, 0, 0.1);
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
background-image: none;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
background-color: #ffffff;
border-color: rgba(0, 0, 0, 0.1);
}
.btn-default .badge {
color: #ffffff;
background-color: #555555;
}
.btn-primary {
color: #ffffff;
background-color: #2fa4e7;
border-color: #2fa4e7;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: #ffffff;
background-color: #178acc;
border-color: #1684c2;
}
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
background-color: #2fa4e7;
border-color: #2fa4e7;
}
.btn-primary .badge {
color: #2fa4e7;
background-color: #ffffff;
}
.btn-success {
color: #ffffff;
background-color: #73a839;
border-color: #73a839;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
color: #ffffff;
background-color: #59822c;
border-color: #547a29;
}
.btn-success:active,
.btn-success.active,
.open > .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #73a839;
border-color: #73a839;
}
.btn-success .badge {
color: #73a839;
background-color: #ffffff;
}
.btn-info {
color: #ffffff;
background-color: #033c73;
border-color: #033c73;
}
.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
color: #ffffff;
background-color: #022241;
border-color: #011d37;
}
.btn-info:active,
.btn-info.active,
.open > .dropdown-toggle.btn-info {
background-image: none;
}
.btn-info.disabled,
.btn-info[disabled],
fieldset[disabled] .btn-info,
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled:active,
.btn-info[disabled]:active,
fieldset[disabled] .btn-info:active,
.btn-info.disabled.active,
.btn-info[disabled].active,
fieldset[disabled] .btn-info.active {
background-color: #033c73;
border-color: #033c73;
}
.btn-info .badge {
color: #033c73;
background-color: #ffffff;
}
.btn-warning {
color: #ffffff;
background-color: #dd5600;
border-color: #dd5600;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
color: #ffffff;
background-color: #aa4200;
border-color: #a03e00;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
background-image: none;
}
.btn-warning.disabled,
.btn-warning[disabled],
fieldset[disabled] .btn-warning,
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active,
.btn-warning.disabled.active,
.btn-warning[disabled].active,
fieldset[disabled] .btn-warning.active {
background-color: #dd5600;
border-color: #dd5600;
}
.btn-warning .badge {
color: #dd5600;
background-color: #ffffff;
}
.btn-danger {
color: #ffffff;
background-color: #c71c22;
border-color: #c71c22;
}
.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
color: #ffffff;
background-color: #9a161a;
border-color: #911419;
}
.btn-danger:active,
.btn-danger.active,
.open > .dropdown-toggle.btn-danger {
background-image: none;
}
.btn-danger.disabled,
.btn-danger[disabled],
fieldset[disabled] .btn-danger,
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled:active,
.btn-danger[disabled]:active,
fieldset[disabled] .btn-danger:active,
.btn-danger.disabled.active,
.btn-danger[disabled].active,
fieldset[disabled] .btn-danger.active {
background-color: #c71c22;
border-color: #c71c22;
}
.btn-danger .badge {
color: #c71c22;
background-color: #ffffff;
}
.btn-link {
color: #2fa4e7;
font-weight: normal;
cursor: pointer;
border-radius: 0;
}
.btn-link,
.btn-link:active,
.btn-link[disabled],
fieldset[disabled] .btn-link {
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:active {
border-color: transparent;
}
.btn-link:hover,
.btn-link:focus {
color: #157ab5;
text-decoration: underline;
background-color: transparent;
}
.btn-link[disabled]:hover,
fieldset[disabled] .btn-link:hover,
.btn-link[disabled]:focus,
fieldset[disabled] .btn-link:focus {
color: #999999;
text-decoration: none;
}
.btn-lg,
.btn-group-lg > .btn {
padding: 14px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
.btn-sm,
.btn-group-sm > .btn {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-xs,
.btn-group-xs > .btn {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
.btn-block {
display: block;
width: 100%;
}
.btn-block + .btn-block {
margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
width: 100%;
}
.fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.fade.in {
opacity: 1;
}
.collapse {
display: none;
}
.collapse.in {
display: block;
}
tr.collapse.in {
display: table-row;
}
tbody.collapse.in {
display: table-row-group;
}
.collapsing {
position: relative;
height: 0;
overflow: hidden;
-webkit-transition: height 0.35s ease;
-o-transition: height 0.35s ease;
transition: height 0.35s ease;
}
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
}
.dropdown {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
font-size: 14px;
text-align: left;
background-color: #ffffff;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
.dropdown-menu.pull-right {
right: 0;
left: auto;
}
.dropdown-menu .divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #333333;
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
text-decoration: none;
color: #ffffff;
background-color: #2fa4e7;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
background-color: #2fa4e7;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
color: #999999;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
cursor: not-allowed;
}
.open > .dropdown-menu {
display: block;
}
.open > a {
outline: 0;
}
.dropdown-menu-right {
left: auto;
right: 0;
}
.dropdown-menu-left {
left: 0;
right: auto;
}
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: 12px;
line-height: 1.42857143;
color: #999999;
white-space: nowrap;
}
.dropdown-backdrop {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 990;
}
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
.dropup .caret,
.navbar-fixed-bottom .dropdown .caret {
border-top: 0;
border-bottom: 4px solid;
content: "";
}
.dropup .dropdown-menu,
.navbar-fixed-bottom .dropdown .dropdown-menu {
top: auto;
bottom: 100%;
margin-bottom: 1px;
}
@media (min-width: 768px) {
.navbar-right .dropdown-menu {
left: auto;
right: 0;
}
.navbar-right .dropdown-menu-left {
left: 0;
right: auto;
}
}
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.btn-group > .btn,
.btn-group-vertical > .btn {
position: relative;
float: left;
}
.btn-group > .btn:hover,
.btn-group-vertical > .btn:hover,
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus,
.btn-group > .btn:active,
.btn-group-vertical > .btn:active,
.btn-group > .btn.active,
.btn-group-vertical > .btn.active {
z-index: 2;
}
.btn-group > .btn:focus,
.btn-group-vertical > .btn:focus {
outline: 0;
}
.btn-group .btn + .btn,
.btn-group .btn + .btn-group,
.btn-group .btn-group + .btn,
.btn-group .btn-group + .btn-group {
margin-left: -1px;
}
.btn-toolbar {
margin-left: -5px;
}
.btn-toolbar .btn-group,
.btn-toolbar .input-group {
float: left;
}
.btn-toolbar > .btn,
.btn-toolbar > .btn-group,
.btn-toolbar > .input-group {
margin-left: 5px;
}
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius: 0;
}
.btn-group > .btn:first-child {
margin-left: 0;
}
.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
<API key>: 0;
<API key>: 0;
}
.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
<API key>: 0;
<API key>: 0;
}
.btn-group > .btn-group {
float: left;
}
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group > .btn-group:first-child > .btn:last-child,
.btn-group > .btn-group:first-child > .dropdown-toggle {
<API key>: 0;
<API key>: 0;
}
.btn-group > .btn-group:last-child > .btn:first-child {
<API key>: 0;
<API key>: 0;
}
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group > .btn + .dropdown-toggle {
padding-left: 8px;
padding-right: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow: none;
box-shadow: none;
}
.btn .caret {
margin-left: 0;
}
.btn-lg .caret {
border-width: 5px 5px 0;
border-bottom-width: 0;
}
.dropup .btn-lg .caret {
border-width: 0 5px 5px;
}
.btn-group-vertical > .btn,
.btn-group-vertical > .btn-group,
.btn-group-vertical > .btn-group > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
.btn-group-vertical > .btn-group > .btn {
float: none;
}
.btn-group-vertical > .btn + .btn,
.btn-group-vertical > .btn + .btn-group,
.btn-group-vertical > .btn-group + .btn,
.btn-group-vertical > .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
border-radius: 0;
}
.btn-group-vertical > .btn:first-child:not(:last-child) {
<API key>: 4px;
<API key>: 0;
<API key>: 0;
}
.btn-group-vertical > .btn:last-child:not(:first-child) {
<API key>: 4px;
<API key>: 0;
<API key>: 0;
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
<API key>: 0;
<API key>: 0;
}
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
<API key>: 0;
<API key>: 0;
}
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
float: none;
display: table-cell;
width: 1%;
}
.btn-group-justified > .btn-group .btn {
width: 100%;
}
.btn-group-justified > .btn-group .dropdown-menu {
left: auto;
}
[data-toggle="buttons"] > .btn > input[type="radio"],
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
position: absolute;
z-index: -1;
opacity: 0;
filter: alpha(opacity=0);
}
.input-group {
position: relative;
display: table;
border-collapse: separate;
}
.input-group[class*="col-"] {
float: none;
padding-left: 0;
padding-right: 0;
}
.input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0;
}
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
height: 54px;
padding: 14px 16px;
font-size: 18px;
line-height: 1.33;
border-radius: 6px;
}
select.input-group-lg > .form-control,
select.input-group-lg > .input-group-addon,
select.input-group-lg > .input-group-btn > .btn {
height: 54px;
line-height: 54px;
}
textarea.input-group-lg > .form-control,
textarea.input-group-lg > .input-group-addon,
textarea.input-group-lg > .input-group-btn > .btn,
select[multiple].input-group-lg > .form-control,
select[multiple].input-group-lg > .input-group-addon,
select[multiple].input-group-lg > .input-group-btn > .btn {
height: auto;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
height: 30px;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
}
select.input-group-sm > .form-control,
select.input-group-sm > .input-group-addon,
select.input-group-sm > .input-group-btn > .btn {
height: 30px;
line-height: 30px;
}
textarea.input-group-sm > .form-control,
textarea.input-group-sm > .input-group-addon,
textarea.input-group-sm > .input-group-btn > .btn,
select[multiple].input-group-sm > .form-control,
select[multiple].input-group-sm > .input-group-addon,
select[multiple].input-group-sm > .input-group-btn > .btn {
height: auto;
}
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
}
.input-group-addon:not(:first-child):not(:last-child),
.input-group-btn:not(:first-child):not(:last-child),
.input-group .form-control:not(:first-child):not(:last-child) {
border-radius: 0;
}
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle;
}
.input-group-addon {
padding: 8px 12px;
font-size: 14px;
font-weight: normal;
line-height: 1;
color: #555555;
text-align: center;
background-color: #eeeeee;
border: 1px solid #cccccc;
border-radius: 4px;
}
.input-group-addon.input-sm {
padding: 5px 10px;
font-size: 12px;
border-radius: 3px;
}
.input-group-addon.input-lg {
padding: 14px 16px;
font-size: 18px;
border-radius: 6px;
}
.input-group-addon input[type="radio"],
.input-group-addon input[type="checkbox"] {
margin-top: 0;
}
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
<API key>: 0;
<API key>: 0;
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child),
.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
<API key>: 0;
<API key>: 0;
}
.input-group-addon:last-child {
border-left: 0;
}
.input-group-btn {
position: relative;
font-size: 0;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-left: -1px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:focus,
.input-group-btn > .btn:active {
z-index: 2;
}
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
margin-right: -1px;
}
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .btn-group {
margin-left: -1px;
}
.nav {
margin-bottom: 0;
padding-left: 0;
list-style: none;
}
.nav > li {
position: relative;
display: block;
}
.nav > li > a {
position: relative;
display: block;
padding: 10px 15px;
}
.nav > li > a:hover,
.nav > li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.nav > li.disabled > a {
color: #999999;
}
.nav > li.disabled > a:hover,
.nav > li.disabled > a:focus {
color: #999999;
text-decoration: none;
background-color: transparent;
cursor: not-allowed;
}
.nav .open > a,
.nav .open > a:hover,
.nav .open > a:focus {
background-color: #eeeeee;
border-color: #2fa4e7;
}
.nav .nav-divider {
height: 1px;
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
.nav > li > a > img {
max-width: none;
}
.nav-tabs {
border-bottom: 1px solid #dddddd;
}
.nav-tabs > li {
float: left;
margin-bottom: -1px;
}
.nav-tabs > li > a {
margin-right: 2px;
line-height: 1.42857143;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
}
.nav-tabs > li > a:hover {
border-color: #eeeeee #eeeeee #dddddd;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
color: #555555;
background-color: #ffffff;
border: 1px solid #dddddd;
border-bottom-color: transparent;
cursor: default;
}
.nav-tabs.nav-justified {
width: 100%;
border-bottom: 0;
}
.nav-tabs.nav-justified > li {
float: none;
}
.nav-tabs.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
.nav-tabs.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-tabs.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs.nav-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.nav-tabs.nav-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs.nav-justified > .active > a,
.nav-tabs.nav-justified > .active > a:hover,
.nav-tabs.nav-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.nav-pills > li {
float: left;
}
.nav-pills > li > a {
border-radius: 4px;
}
.nav-pills > li + li {
margin-left: 2px;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
color: #ffffff;
background-color: #2fa4e7;
}
.nav-stacked > li {
float: none;
}
.nav-stacked > li + li {
margin-top: 2px;
margin-left: 0;
}
.nav-justified {
width: 100%;
}
.nav-justified > li {
float: none;
}
.nav-justified > li > a {
text-align: center;
margin-bottom: 5px;
}
.nav-justified > .dropdown .dropdown-menu {
top: auto;
left: auto;
}
@media (min-width: 768px) {
.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-justified > li > a {
margin-bottom: 0;
}
}
.nav-tabs-justified {
border-bottom: 0;
}
.nav-tabs-justified > li > a {
margin-right: 0;
border-radius: 4px;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border: 1px solid #dddddd;
}
@media (min-width: 768px) {
.nav-tabs-justified > li > a {
border-bottom: 1px solid #dddddd;
border-radius: 4px 4px 0 0;
}
.nav-tabs-justified > .active > a,
.nav-tabs-justified > .active > a:hover,
.nav-tabs-justified > .active > a:focus {
border-bottom-color: #ffffff;
}
}
.tab-content > .tab-pane {
display: none;
}
.tab-content > .active {
display: block;
}
.nav-tabs .dropdown-menu {
margin-top: -1px;
<API key>: 0;
<API key>: 0;
}
.navbar {
position: relative;
min-height: 50px;
margin-bottom: 20px;
border: 1px solid transparent;
}
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-collapse {
overflow-x: visible;
padding-right: 15px;
padding-left: 15px;
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-<API key>: touch;
}
.navbar-collapse.in {
overflow-y: auto;
}
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
border-top: 0;
box-shadow: none;
}
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
overflow: visible !important;
}
.navbar-collapse.in {
overflow-y: visible;
}
.navbar-fixed-top .navbar-collapse,
.navbar-static-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
padding-left: 0;
padding-right: 0;
}
}
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 340px;
}
@media (max-width: 480px) and (orientation: landscape) {
.navbar-fixed-top .navbar-collapse,
.navbar-fixed-bottom .navbar-collapse {
max-height: 200px;
}
}
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.container > .navbar-header,
.container-fluid > .navbar-header,
.container > .navbar-collapse,
.container-fluid > .navbar-collapse {
margin-right: 0;
margin-left: 0;
}
}
.navbar-static-top {
z-index: 1000;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.navbar-static-top {
border-radius: 0;
}
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
@media (min-width: 768px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
border-width: 0 0 1px;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
border-width: 1px 0 0;
}
.navbar-brand {
float: left;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
height: 50px;
}
.navbar-brand:hover,
.navbar-brand:focus {
text-decoration: none;
}
@media (min-width: 768px) {
.navbar > .container .navbar-brand,
.navbar > .container-fluid .navbar-brand {
margin-left: -15px;
}
}
.navbar-toggle {
position: relative;
float: right;
margin-right: 15px;
padding: 9px 10px;
margin-top: 8px;
margin-bottom: 8px;
background-color: transparent;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
}
.navbar-toggle:focus {
outline: 0;
}
.navbar-toggle .icon-bar {
display: block;
width: 22px;
height: 2px;
border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
margin-top: 4px;
}
@media (min-width: 768px) {
.navbar-toggle {
display: none;
}
}
.navbar-nav {
margin: 7.5px -15px;
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.navbar-nav .open .dropdown-menu > li > a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
}
.navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-nav .open .dropdown-menu > li > a:focus {
background-image: none;
}
}
@media (min-width: 768px) {
.navbar-nav {
float: left;
margin: 0;
}
.navbar-nav > li {
float: left;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
.navbar-nav.navbar-right:last-child {
margin-right: -15px;
}
}
@media (min-width: 768px) {
.navbar-left {
float: left !important;
}
.navbar-right {
float: right !important;
}
}
.navbar-form {
margin-left: -15px;
margin-right: -15px;
padding: 10px 15px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
margin-top: 6px;
margin-bottom: 6px;
}
@media (min-width: 768px) {
.navbar-form .form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
.navbar-form .input-group {
display: inline-table;
vertical-align: middle;
}
.navbar-form .input-group .input-group-addon,
.navbar-form .input-group .input-group-btn,
.navbar-form .input-group .form-control {
width: auto;
}
.navbar-form .input-group > .form-control {
width: 100%;
}
.navbar-form .control-label {
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio,
.navbar-form .checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
.navbar-form .radio label,
.navbar-form .checkbox label {
padding-left: 0;
}
.navbar-form .radio input[type="radio"],
.navbar-form .checkbox input[type="checkbox"] {
position: relative;
margin-left: 0;
}
.navbar-form .has-feedback .<API key> {
top: 0;
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar-form.navbar-right:last-child {
margin-right: -15px;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
<API key>: 0;
<API key>: 0;
}
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
<API key>: 0;
<API key>: 0;
}
.navbar-btn {
margin-top: 6px;
margin-bottom: 6px;
}
.navbar-btn.btn-sm {
margin-top: 10px;
margin-bottom: 10px;
}
.navbar-btn.btn-xs {
margin-top: 14px;
margin-bottom: 14px;
}
.navbar-text {
margin-top: 15px;
margin-bottom: 15px;
}
@media (min-width: 768px) {
.navbar-text {
float: left;
margin-left: 15px;
margin-right: 15px;
}
.navbar-text.navbar-right:last-child {
margin-right: 0;
}
}
.navbar-default {
background-color: #2fa4e7;
border-color: #1995dc;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #ffffff;
background-color: none;
}
.navbar-default .navbar-text {
color: #dddddd;
}
.navbar-default .navbar-nav > li > a {
color: #ffffff;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #ffffff;
background-color: #178acc;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #178acc;
}
.navbar-default .navbar-nav > .disabled > a,
.navbar-default .navbar-nav > .disabled > a:hover,
.navbar-default .navbar-nav > .disabled > a:focus {
color: #dddddd;
background-color: transparent;
}
.navbar-default .navbar-toggle {
border-color: #178acc;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #178acc;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #1995dc;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
background-color: #178acc;
color: #ffffff;
}
@media (max-width: 767px) {
.navbar-default .navbar-nav .open .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: #178acc;
}
.navbar-default .navbar-nav .open .dropdown-menu > .active > a,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #178acc;
}
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #dddddd;
background-color: transparent;
}
}
.navbar-default .navbar-link {
color: #ffffff;
}
.navbar-default .navbar-link:hover {
color: #ffffff;
}
.navbar-default .btn-link {
color: #ffffff;
}
.navbar-default .btn-link:hover,
.navbar-default .btn-link:focus {
color: #ffffff;
}
.navbar-default .btn-link[disabled]:hover,
fieldset[disabled] .navbar-default .btn-link:hover,
.navbar-default .btn-link[disabled]:focus,
fieldset[disabled] .navbar-default .btn-link:focus {
color: #dddddd;
}
.navbar-inverse {
background-color: #033c73;
border-color: #022f5a;
}
.navbar-inverse .navbar-brand {
color: #ffffff;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #ffffff;
background-color: none;
}
.navbar-inverse .navbar-text {
color: #ffffff;
}
.navbar-inverse .navbar-nav > li > a {
color: #ffffff;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #ffffff;
background-color: #022f5a;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #ffffff;
background-color: #022f5a;
}
.navbar-inverse .navbar-nav > .disabled > a,
.navbar-inverse .navbar-nav > .disabled > a:hover,
.navbar-inverse .navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.navbar-inverse .navbar-toggle {
border-color: #022f5a;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #022f5a;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border-color: #022a50;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
background-color: #022f5a;
color: #ffffff;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
border-color: #022f5a;
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color: #022f5a;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: #022f5a;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #022f5a;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
}
.navbar-inverse .navbar-link {
color: #ffffff;
}
.navbar-inverse .navbar-link:hover {
color: #ffffff;
}
.navbar-inverse .btn-link {
color: #ffffff;
}
.navbar-inverse .btn-link:hover,
.navbar-inverse .btn-link:focus {
color: #ffffff;
}
.navbar-inverse .btn-link[disabled]:hover,
fieldset[disabled] .navbar-inverse .btn-link:hover,
.navbar-inverse .btn-link[disabled]:focus,
fieldset[disabled] .navbar-inverse .btn-link:focus {
color: #cccccc;
}
.breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: #f5f5f5;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
content: "/\00a0";
padding: 0 5px;
color: #cccccc;
}
.breadcrumb > .active {
color: #999999;
}
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
}
.pagination > li {
display: inline;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 8px 12px;
line-height: 1.42857143;
text-decoration: none;
color: #2fa4e7;
background-color: #ffffff;
border: 1px solid #dddddd;
margin-left: -1px;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
<API key>: 4px;
<API key>: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
<API key>: 4px;
<API key>: 4px;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
color: #157ab5;
background-color: #eeeeee;
border-color: #dddddd;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
z-index: 2;
color: #999999;
background-color: #f5f5f5;
border-color: #dddddd;
cursor: default;
}
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus,
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus {
color: #999999;
background-color: #ffffff;
border-color: #dddddd;
cursor: not-allowed;
}
.pagination-lg > li > a,
.pagination-lg > li > span {
padding: 14px 16px;
font-size: 18px;
}
.pagination-lg > li:first-child > a,
.pagination-lg > li:first-child > span {
<API key>: 6px;
<API key>: 6px;
}
.pagination-lg > li:last-child > a,
.pagination-lg > li:last-child > span {
<API key>: 6px;
<API key>: 6px;
}
.pagination-sm > li > a,
.pagination-sm > li > span {
padding: 5px 10px;
font-size: 12px;
}
.pagination-sm > li:first-child > a,
.pagination-sm > li:first-child > span {
<API key>: 3px;
<API key>: 3px;
}
.pagination-sm > li:last-child > a,
.pagination-sm > li:last-child > span {
<API key>: 3px;
<API key>: 3px;
}
.pager {
padding-left: 0;
margin: 20px 0;
list-style: none;
text-align: center;
}
.pager li {
display: inline;
}
.pager li > a,
.pager li > span {
display: inline-block;
padding: 5px 14px;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 15px;
}
.pager li > a:hover,
.pager li > a:focus {
text-decoration: none;
background-color: #eeeeee;
}
.pager .next > a,
.pager .next > span {
float: right;
}
.pager .previous > a,
.pager .previous > span {
float: left;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
color: #999999;
background-color: #ffffff;
cursor: not-allowed;
}
.label {
display: inline;
padding: .2em .6em .3em;
font-size: 75%;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
}
a.label:hover,
a.label:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.label:empty {
display: none;
}
.btn .label {
position: relative;
top: -1px;
}
.label-default {
background-color: #999999;
}
.label-default[href]:hover,
.label-default[href]:focus {
background-color: #808080;
}
.label-primary {
background-color: #2fa4e7;
}
.label-primary[href]:hover,
.label-primary[href]:focus {
background-color: #178acc;
}
.label-success {
background-color: #73a839;
}
.label-success[href]:hover,
.label-success[href]:focus {
background-color: #59822c;
}
.label-info {
background-color: #033c73;
}
.label-info[href]:hover,
.label-info[href]:focus {
background-color: #022241;
}
.label-warning {
background-color: #dd5600;
}
.label-warning[href]:hover,
.label-warning[href]:focus {
background-color: #aa4200;
}
.label-danger {
background-color: #c71c22;
}
.label-danger[href]:hover,
.label-danger[href]:focus {
background-color: #9a161a;
}
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
color: #ffffff;
line-height: 1;
vertical-align: baseline;
white-space: nowrap;
text-align: center;
background-color: #2fa4e7;
border-radius: 10px;
}
.badge:empty {
display: none;
}
.btn .badge {
position: relative;
top: -1px;
}
.btn-xs .badge {
top: 0;
padding: 1px 5px;
}
a.badge:hover,
a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
a.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #2fa4e7;
background-color: #ffffff;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}
.jumbotron {
padding: 30px;
margin-bottom: 30px;
color: inherit;
background-color: #eeeeee;
}
.jumbotron h1,
.jumbotron .h1 {
color: inherit;
}
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
}
.jumbotron > hr {
border-top-color: #d5d5d5;
}
.container .jumbotron {
border-radius: 6px;
}
.jumbotron .container {
max-width: 100%;
}
@media screen and (min-width: 768px) {
.jumbotron {
padding-top: 48px;
padding-bottom: 48px;
}
.container .jumbotron {
padding-left: 60px;
padding-right: 60px;
}
.jumbotron h1,
.jumbotron .h1 {
font-size: 63px;
}
}
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.thumbnail > img,
.thumbnail a > img {
margin-left: auto;
margin-right: auto;
}
a.thumbnail:hover,
a.thumbnail:focus,
a.thumbnail.active {
border-color: #2fa4e7;
}
.thumbnail .caption {
padding: 9px;
color: #555555;
}
.alert {
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
}
.alert h4 {
margin-top: 0;
color: inherit;
}
.alert .alert-link {
font-weight: bold;
}
.alert > p,
.alert > ul {
margin-bottom: 0;
}
.alert > p + p {
margin-top: 5px;
}
.alert-dismissable,
.alert-dismissible {
padding-right: 35px;
}
.alert-dismissable .close,
.alert-dismissible .close {
position: relative;
top: -2px;
right: -21px;
color: inherit;
}
.alert-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #468847;
}
.alert-success hr {
border-top-color: #c9e2b3;
}
.alert-success .alert-link {
color: #356635;
}
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #3a87ad;
}
.alert-info hr {
border-top-color: #a6e1ec;
}
.alert-info .alert-link {
color: #2d6987;
}
.alert-warning {
background-color: #fcf8e3;
border-color: #fbeed5;
color: #c09853;
}
.alert-warning hr {
border-top-color: #f8e5be;
}
.alert-warning .alert-link {
color: #a47e3c;
}
.alert-danger {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
}
.alert-danger hr {
border-top-color: #e6c1c7;
}
.alert-danger .alert-link {
color: #953b39;
}
@-webkit-keyframes <API key> {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@keyframes <API key> {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress {
overflow: hidden;
height: 20px;
margin-bottom: 20px;
background-color: #f5f5f5;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.progress-bar {
float: left;
width: 0%;
height: 100%;
font-size: 12px;
line-height: 20px;
color: #ffffff;
text-align: center;
background-color: #2fa4e7;
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-webkit-transition: width 0.6s ease;
-o-transition: width 0.6s ease;
transition: width 0.6s ease;
}
.progress-striped .progress-bar,
.<API key> {
background-image: -<API key>(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-size: 40px 40px;
}
.progress.active .progress-bar,
.progress-bar.active {
-webkit-animation: <API key> 2s linear infinite;
-o-animation: <API key> 2s linear infinite;
animation: <API key> 2s linear infinite;
}
.progress-bar[aria-valuenow="1"],
.progress-bar[aria-valuenow="2"] {
min-width: 30px;
}
.progress-bar[aria-valuenow="0"] {
color: #999999;
min-width: 30px;
background-color: transparent;
background-image: none;
box-shadow: none;
}
.<API key> {
background-color: #73a839;
}
.progress-striped .<API key> {
background-image: -<API key>(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-info {
background-color: #033c73;
}
.progress-striped .progress-bar-info {
background-image: -<API key>(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.<API key> {
background-color: #dd5600;
}
.progress-striped .<API key> {
background-image: -<API key>(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.progress-bar-danger {
background-color: #c71c22;
}
.progress-striped .progress-bar-danger {
background-image: -<API key>(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
.media,
.media-body {
overflow: hidden;
zoom: 1;
}
.media,
.media .media {
margin-top: 15px;
}
.media:first-child {
margin-top: 0;
}
.media-object {
display: block;
}
.media-heading {
margin: 0 0 5px;
}
.media > .pull-left {
margin-right: 10px;
}
.media > .pull-right {
margin-left: 10px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.list-group {
margin-bottom: 20px;
padding-left: 0;
}
.list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: #ffffff;
border: 1px solid #dddddd;
}
.list-group-item:first-child {
<API key>: 4px;
<API key>: 4px;
}
.list-group-item:last-child {
margin-bottom: 0;
<API key>: 4px;
<API key>: 4px;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
a.list-group-item {
color: #555555;
}
a.list-group-item .<API key> {
color: #333333;
}
a.list-group-item:hover,
a.list-group-item:focus {
text-decoration: none;
color: #555555;
background-color: #f5f5f5;
}
.list-group-item.disabled,
.list-group-item.disabled:hover,
.list-group-item.disabled:focus {
background-color: #eeeeee;
color: #999999;
}
.list-group-item.disabled .<API key>,
.list-group-item.disabled:hover .<API key>,
.list-group-item.disabled:focus .<API key> {
color: inherit;
}
.list-group-item.disabled .<API key>,
.list-group-item.disabled:hover .<API key>,
.list-group-item.disabled:focus .<API key> {
color: #999999;
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
z-index: 2;
color: #ffffff;
background-color: #2fa4e7;
border-color: #2fa4e7;
}
.list-group-item.active .<API key>,
.list-group-item.active:hover .<API key>,
.list-group-item.active:focus .<API key>,
.list-group-item.active .<API key> > small,
.list-group-item.active:hover .<API key> > small,
.list-group-item.active:focus .<API key> > small,
.list-group-item.active .<API key> > .small,
.list-group-item.active:hover .<API key> > .small,
.list-group-item.active:focus .<API key> > .small {
color: inherit;
}
.list-group-item.active .<API key>,
.list-group-item.active:hover .<API key>,
.list-group-item.active:focus .<API key> {
color: #e6f4fc;
}
.<API key> {
color: #468847;
background-color: #dff0d8;
}
a.<API key> {
color: #468847;
}
a.<API key> .<API key> {
color: inherit;
}
a.<API key>:hover,
a.<API key>:focus {
color: #468847;
background-color: #d0e9c6;
}
a.<API key>.active,
a.<API key>.active:hover,
a.<API key>.active:focus {
color: #fff;
background-color: #468847;
border-color: #468847;
}
.<API key> {
color: #3a87ad;
background-color: #d9edf7;
}
a.<API key> {
color: #3a87ad;
}
a.<API key> .<API key> {
color: inherit;
}
a.<API key>:hover,
a.<API key>:focus {
color: #3a87ad;
background-color: #c4e3f3;
}
a.<API key>.active,
a.<API key>.active:hover,
a.<API key>.active:focus {
color: #fff;
background-color: #3a87ad;
border-color: #3a87ad;
}
.<API key> {
color: #c09853;
background-color: #fcf8e3;
}
a.<API key> {
color: #c09853;
}
a.<API key> .<API key> {
color: inherit;
}
a.<API key>:hover,
a.<API key>:focus {
color: #c09853;
background-color: #faf2cc;
}
a.<API key>.active,
a.<API key>.active:hover,
a.<API key>.active:focus {
color: #fff;
background-color: #c09853;
border-color: #c09853;
}
.<API key> {
color: #b94a48;
background-color: #f2dede;
}
a.<API key> {
color: #b94a48;
}
a.<API key> .<API key> {
color: inherit;
}
a.<API key>:hover,
a.<API key>:focus {
color: #b94a48;
background-color: #ebcccc;
}
a.<API key>.active,
a.<API key>.active:hover,
a.<API key>.active:focus {
color: #fff;
background-color: #b94a48;
border-color: #b94a48;
}
.<API key> {
margin-top: 0;
margin-bottom: 5px;
}
.<API key> {
margin-bottom: 0;
line-height: 1.3;
}
.panel {
margin-bottom: 20px;
background-color: #ffffff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-body {
padding: 15px;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
<API key>: 3px;
<API key>: 3px;
}
.panel-heading > .dropdown .dropdown-toggle {
color: inherit;
}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: inherit;
}
.panel-title > a {
color: inherit;
}
.panel-footer {
padding: 10px 15px;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
<API key>: 3px;
<API key>: 3px;
}
.panel > .list-group {
margin-bottom: 0;
}
.panel > .list-group .list-group-item {
border-width: 1px 0;
border-radius: 0;
}
.panel > .list-group:first-child .list-group-item:first-child {
border-top: 0;
<API key>: 3px;
<API key>: 3px;
}
.panel > .list-group:last-child .list-group-item:last-child {
border-bottom: 0;
<API key>: 3px;
<API key>: 3px;
}
.panel-heading + .list-group .list-group-item:first-child {
border-top-width: 0;
}
.list-group + .panel-footer {
border-top-width: 0;
}
.panel > .table,
.panel > .table-responsive > .table,
.panel > .panel-collapse > .table {
margin-bottom: 0;
}
.panel > .table:first-child,
.panel > .table-responsive:first-child > .table:first-child {
<API key>: 3px;
<API key>: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
<API key>: 3px;
}
.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
<API key>: 3px;
}
.panel > .table:last-child,
.panel > .table-responsive:last-child > .table:last-child {
<API key>: 3px;
<API key>: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
<API key>: 3px;
}
.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
<API key>: 3px;
}
.panel > .panel-body + .table,
.panel > .panel-body + .table-responsive {
border-top: 1px solid #dddddd;
}
.panel > .table > tbody:first-child > tr:first-child th,
.panel > .table > tbody:first-child > tr:first-child td {
border-top: 0;
}
.panel > .table-bordered,
.panel > .table-responsive > .table-bordered {
border: 0;
}
.panel > .table-bordered > thead > tr > th:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
.panel > .table-bordered > tbody > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
.panel > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
.panel > .table-bordered > thead > tr > td:first-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
.panel > .table-bordered > tbody > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
.panel > .table-bordered > tfoot > tr > td:first-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
border-left: 0;
}
.panel > .table-bordered > thead > tr > th:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
.panel > .table-bordered > tbody > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
.panel > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
.panel > .table-bordered > thead > tr > td:last-child,
.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
.panel > .table-bordered > tbody > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
.panel > .table-bordered > tfoot > tr > td:last-child,
.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
border-right: 0;
}
.panel > .table-bordered > thead > tr:first-child > td,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
.panel > .table-bordered > tbody > tr:first-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
.panel > .table-bordered > thead > tr:first-child > th,
.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
.panel > .table-bordered > tbody > tr:first-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
border-bottom: 0;
}
.panel > .table-bordered > tbody > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
.panel > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
.panel > .table-bordered > tbody > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
.panel > .table-bordered > tfoot > tr:last-child > th,
.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
border-bottom: 0;
}
.panel > .table-responsive {
border: 0;
margin-bottom: 0;
}
.panel-group {
margin-bottom: 20px;
}
.panel-group .panel {
margin-bottom: 0;
border-radius: 4px;
}
.panel-group .panel + .panel {
margin-top: 5px;
}
.panel-group .panel-heading {
border-bottom: 0;
}
.panel-group .panel-heading + .panel-collapse > .panel-body {
border-top: 1px solid #dddddd;
}
.panel-group .panel-footer {
border-top: 0;
}
.panel-group .panel-footer + .panel-collapse .panel-body {
border-bottom: 1px solid #dddddd;
}
.panel-default {
border-color: #dddddd;
}
.panel-default > .panel-heading {
color: #555555;
background-color: #f5f5f5;
border-color: #dddddd;
}
.panel-default > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-default > .panel-heading .badge {
color: #f5f5f5;
background-color: #555555;
}
.panel-default > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.panel-primary {
border-color: #dddddd;
}
.panel-primary > .panel-heading {
color: #ffffff;
background-color: #2fa4e7;
border-color: #dddddd;
}
.panel-primary > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-primary > .panel-heading .badge {
color: #2fa4e7;
background-color: #ffffff;
}
.panel-primary > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.panel-success {
border-color: #dddddd;
}
.panel-success > .panel-heading {
color: #468847;
background-color: #73a839;
border-color: #dddddd;
}
.panel-success > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-success > .panel-heading .badge {
color: #73a839;
background-color: #468847;
}
.panel-success > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.panel-info {
border-color: #dddddd;
}
.panel-info > .panel-heading {
color: #3a87ad;
background-color: #033c73;
border-color: #dddddd;
}
.panel-info > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-info > .panel-heading .badge {
color: #033c73;
background-color: #3a87ad;
}
.panel-info > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.panel-warning {
border-color: #dddddd;
}
.panel-warning > .panel-heading {
color: #c09853;
background-color: #dd5600;
border-color: #dddddd;
}
.panel-warning > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-warning > .panel-heading .badge {
color: #dd5600;
background-color: #c09853;
}
.panel-warning > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.panel-danger {
border-color: #dddddd;
}
.panel-danger > .panel-heading {
color: #b94a48;
background-color: #c71c22;
border-color: #dddddd;
}
.panel-danger > .panel-heading + .panel-collapse > .panel-body {
border-top-color: #dddddd;
}
.panel-danger > .panel-heading .badge {
color: #c71c22;
background-color: #b94a48;
}
.panel-danger > .panel-footer + .panel-collapse > .panel-body {
border-bottom-color: #dddddd;
}
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden;
}
.embed-responsive .<API key>,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
border: 0;
}
.embed-responsive.<API key> {
padding-bottom: 56.25%;
}
.embed-responsive.<API key> {
padding-bottom: 75%;
}
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.well blockquote {
border-color: #ddd;
border-color: rgba(0, 0, 0, 0.15);
}
.well-lg {
padding: 24px;
border-radius: 6px;
}
.well-sm {
padding: 9px;
border-radius: 3px;
}
.close {
float: right;
font-size: 21px;
font-weight: bold;
line-height: 1;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
.close:hover,
.close:focus {
color: #000000;
text-decoration: none;
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: hidden;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
-<API key>: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transform: translate3d(0, -25%, 0);
transform: translate3d(0, -25%, 0);
-webkit-transition: -webkit-transform 0.3s ease-out;
-moz-transition: -moz-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal-dialog {
position: relative;
width: auto;
margin: 10px;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
background-clip: padding-box;
outline: 0;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
min-height: 16.42857143px;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.42857143;
}
.modal-body {
position: relative;
padding: 20px;
}
.modal-footer {
padding: 20px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
.<API key> {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll;
}
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.modal-sm {
width: 300px;
}
}
@media (min-width: 992px) {
.modal-lg {
width: 900px;
}
}
.tooltip {
position: absolute;
z-index: 1070;
display: block;
visibility: visible;
font-size: 12px;
line-height: 1.4;
opacity: 0;
filter: alpha(opacity=0);
}
.tooltip.in {
opacity: 0.9;
filter: alpha(opacity=90);
}
.tooltip.top {
margin-top: -3px;
padding: 5px 0;
}
.tooltip.right {
margin-left: 3px;
padding: 0 5px;
}
.tooltip.bottom {
margin-top: 3px;
padding: 5px 0;
}
.tooltip.left {
margin-left: -3px;
padding: 0 5px;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
text-decoration: none;
background-color: rgba(0, 0, 0, 0.9);
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: rgba(0, 0, 0, 0.9);
}
.tooltip.top-left .tooltip-arrow {
bottom: 0;
left: 5px;
border-width: 5px 5px 0;
border-top-color: rgba(0, 0, 0, 0.9);
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
right: 5px;
border-width: 5px 5px 0;
border-top-color: rgba(0, 0, 0, 0.9);
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: rgba(0, 0, 0, 0.9);
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: rgba(0, 0, 0, 0.9);
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: rgba(0, 0, 0, 0.9);
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
left: 5px;
border-width: 0 5px 5px;
border-bottom-color: rgba(0, 0, 0, 0.9);
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
right: 5px;
border-width: 0 5px 5px;
border-bottom-color: rgba(0, 0, 0, 0.9);
}
.popover {
position: absolute;
top: 0;
left: 0;
z-index: 1060;
display: none;
max-width: 276px;
padding: 1px;
text-align: left;
background-color: #ffffff;
background-clip: padding-box;
border: 1px solid #cccccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
white-space: normal;
}
.popover.top {
margin-top: -10px;
}
.popover.right {
margin-left: 10px;
}
.popover.bottom {
margin-top: 10px;
}
.popover.left {
margin-left: -10px;
}
.popover-title {
margin: 0;
padding: 8px 14px;
font-size: 14px;
font-weight: normal;
line-height: 18px;
background-color: #f7f7f7;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}
.popover-content {
padding: 9px 14px;
}
.popover > .arrow,
.popover > .arrow:after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
.popover > .arrow {
border-width: 11px;
}
.popover > .arrow:after {
border-width: 10px;
content: "";
}
.popover.top > .arrow {
left: 50%;
margin-left: -11px;
border-bottom-width: 0;
border-top-color: #999999;
border-top-color: rgba(0, 0, 0, 0.25);
bottom: -11px;
}
.popover.top > .arrow:after {
content: " ";
bottom: 1px;
margin-left: -10px;
border-bottom-width: 0;
border-top-color: #ffffff;
}
.popover.right > .arrow {
top: 50%;
left: -11px;
margin-top: -11px;
border-left-width: 0;
border-right-color: #999999;
border-right-color: rgba(0, 0, 0, 0.25);
}
.popover.right > .arrow:after {
content: " ";
left: 1px;
bottom: -10px;
border-left-width: 0;
border-right-color: #ffffff;
}
.popover.bottom > .arrow {
left: 50%;
margin-left: -11px;
border-top-width: 0;
border-bottom-color: #999999;
border-bottom-color: rgba(0, 0, 0, 0.25);
top: -11px;
}
.popover.bottom > .arrow:after {
content: " ";
top: 1px;
margin-left: -10px;
border-top-width: 0;
border-bottom-color: #ffffff;
}
.popover.left > .arrow {
top: 50%;
right: -11px;
margin-top: -11px;
border-right-width: 0;
border-left-color: #999999;
border-left-color: rgba(0, 0, 0, 0.25);
}
.popover.left > .arrow:after {
content: " ";
right: 1px;
border-right-width: 0;
border-left-color: #ffffff;
bottom: -10px;
}
.carousel {
position: relative;
}
.carousel-inner {
position: relative;
overflow: hidden;
width: 100%;
}
.carousel-inner > .item {
display: none;
position: relative;
-webkit-transition: 0.6s ease-in-out left;
-o-transition: 0.6s ease-in-out left;
transition: 0.6s ease-in-out left;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
line-height: 1;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
display: block;
}
.carousel-inner > .active {
left: 0;
}
.carousel-inner > .next,
.carousel-inner > .prev {
position: absolute;
top: 0;
width: 100%;
}
.carousel-inner > .next {
left: 100%;
}
.carousel-inner > .prev {
left: -100%;
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
left: 0;
}
.carousel-inner > .active.left {
left: -100%;
}
.carousel-inner > .active.right {
left: 100%;
}
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-control.left {
background-image: -<API key>(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
}
.carousel-control.right {
left: auto;
right: 0;
background-image: -<API key>(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
}
.carousel-control:hover,
.carousel-control:focus {
outline: 0;
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.carousel-control .icon-prev,
.carousel-control .icon-next,
.carousel-control .<API key>,
.carousel-control .<API key> {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
.carousel-control .icon-prev,
.carousel-control .<API key> {
left: 50%;
margin-left: -10px;
}
.carousel-control .icon-next,
.carousel-control .<API key> {
right: 50%;
margin-right: -10px;
}
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 20px;
height: 20px;
margin-top: -10px;
font-family: serif;
}
.carousel-control .icon-prev:before {
content: '\2039';
}
.carousel-control .icon-next:before {
content: '\203a';
}
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
}
.carousel-indicators li {
display: inline-block;
width: 10px;
height: 10px;
margin: 1px;
text-indent: -999px;
border: 1px solid #ffffff;
border-radius: 10px;
cursor: pointer;
background-color: #000 \9;
background-color: rgba(0, 0, 0, 0);
}
.carousel-indicators .active {
margin: 0;
width: 12px;
height: 12px;
background-color: #ffffff;
}
.carousel-caption {
position: absolute;
left: 15%;
right: 15%;
bottom: 20px;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.carousel-caption .btn {
text-shadow: none;
}
@media screen and (min-width: 768px) {
.carousel-control .<API key>,
.carousel-control .<API key>,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;
height: 30px;
margin-top: -15px;
font-size: 30px;
}
.carousel-control .<API key>,
.carousel-control .icon-prev {
margin-left: -15px;
}
.carousel-control .<API key>,
.carousel-control .icon-next {
margin-right: -15px;
}
.carousel-caption {
left: 20%;
right: 20%;
padding-bottom: 30px;
}
.carousel-indicators {
bottom: 20px;
}
}
.clearfix:before,
.clearfix:after,
.dl-horizontal dd:before,
.dl-horizontal dd:after,
.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.btn-toolbar:before,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:before,
.btn-group-vertical > .btn-group:after,
.nav:before,
.nav:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.pager:before,
.pager:after,
.panel-body:before,
.panel-body:after,
.modal-footer:before,
.modal-footer:after {
content: " ";
display: table;
}
.clearfix:after,
.dl-horizontal dd:after,
.container:after,
.container-fluid:after,
.row:after,
.form-horizontal .form-group:after,
.btn-toolbar:after,
.btn-group-vertical > .btn-group:after,
.nav:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.pager:after,
.panel-body:after,
.modal-footer:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.affix {
position: fixed;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
@-ms-viewport {
width: device-width;
}
.visible-xs,
.visible-sm,
.visible-md,
.visible-lg {
display: none !important;
}
.visible-xs-block,
.visible-xs-inline,
.<API key>,
.visible-sm-block,
.visible-sm-inline,
.<API key>,
.visible-md-block,
.visible-md-inline,
.<API key>,
.visible-lg-block,
.visible-lg-inline,
.<API key> {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
}
table.visible-xs {
display: table;
}
tr.visible-xs {
display: table-row !important;
}
th.visible-xs,
td.visible-xs {
display: table-cell !important;
}
}
@media (max-width: 767px) {
.visible-xs-block {
display: block !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline {
display: inline !important;
}
}
@media (max-width: 767px) {
.<API key> {
display: inline-block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
}
table.visible-sm {
display: table;
}
tr.visible-sm {
display: table-row !important;
}
th.visible-sm,
td.visible-sm {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-block {
display: block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline {
display: inline !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.<API key> {
display: inline-block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
}
table.visible-md {
display: table;
}
tr.visible-md {
display: table-row !important;
}
th.visible-md,
td.visible-md {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-block {
display: block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline {
display: inline !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.<API key> {
display: inline-block !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
}
table.visible-lg {
display: table;
}
tr.visible-lg {
display: table-row !important;
}
th.visible-lg,
td.visible-lg {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg-block {
display: block !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline {
display: inline !important;
}
}
@media (min-width: 1200px) {
.<API key> {
display: inline-block !important;
}
}
@media (max-width: 767px) {
.hidden-xs {
display: none !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.hidden-sm {
display: none !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.hidden-md {
display: none !important;
}
}
@media (min-width: 1200px) {
.hidden-lg {
display: none !important;
}
}
.visible-print {
display: none !important;
}
@media print {
.visible-print {
display: block !important;
}
table.visible-print {
display: table;
}
tr.visible-print {
display: table-row !important;
}
th.visible-print,
td.visible-print {
display: table-cell !important;
}
}
.visible-print-block {
display: none !important;
}
@media print {
.visible-print-block {
display: block !important;
}
}
.<API key> {
display: none !important;
}
@media print {
.<API key> {
display: inline !important;
}
}
.<API key> {
display: none !important;
}
@media print {
.<API key> {
display: inline-block !important;
}
}
@media print {
.hidden-print {
display: none !important;
}
}
.navbar {
background-image: -<API key>(#54b4eb, #2fa4e7 60%, #1d9ce5);
background-image: -o-linear-gradient(#54b4eb, #2fa4e7 60%, #1d9ce5);
background-image: linear-gradient(#54b4eb, #2fa4e7 60%, #1d9ce5);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff54b4eb', endColorstr='#ff1d9ce5', GradientType=0);
border-bottom: 1px solid #178acc;
filter: none;
-webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
}
.navbar-default .badge {
background-color: #fff;
color: #2fa4e7;
}
.navbar-inverse {
background-image: -<API key>(#04519b, #044687 60%, #033769);
background-image: -o-linear-gradient(#04519b, #044687 60%, #033769);
background-image: linear-gradient(#04519b, #044687 60%, #033769);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff04519b', endColorstr='#ff033769', GradientType=0);
filter: none;
border-bottom: 1px solid #022241;
}
.navbar-inverse .badge {
background-color: #fff;
color: #033c73;
}
.navbar .navbar-nav > li > a,
.navbar-brand {
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
@media (max-width: 767px) {
.navbar .dropdown-header {
color: #fff;
}
}
.btn {
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
.btn .caret {
border-top-color: #fff;
}
.btn-default {
background-image: -<API key>(#ffffff, #ffffff 60%, #f5f5f5);
background-image: -o-linear-gradient(#ffffff, #ffffff 60%, #f5f5f5);
background-image: linear-gradient(#ffffff, #ffffff 60%, #f5f5f5);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff5f5f5', GradientType=0);
filter: none;
border-bottom: 1px solid #e6e6e6;
}
.btn-default:hover {
color: #555555;
}
.btn-default .caret {
border-top-color: #555555;
}
.btn-default {
background-image: -<API key>(#ffffff, #ffffff 60%, #f5f5f5);
background-image: -o-linear-gradient(#ffffff, #ffffff 60%, #f5f5f5);
background-image: linear-gradient(#ffffff, #ffffff 60%, #f5f5f5);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff5f5f5', GradientType=0);
filter: none;
border-bottom: 1px solid #e6e6e6;
}
.btn-primary {
background-image: -<API key>(#54b4eb, #2fa4e7 60%, #1d9ce5);
background-image: -o-linear-gradient(#54b4eb, #2fa4e7 60%, #1d9ce5);
background-image: linear-gradient(#54b4eb, #2fa4e7 60%, #1d9ce5);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff54b4eb', endColorstr='#ff1d9ce5', GradientType=0);
filter: none;
border-bottom: 1px solid #178acc;
}
.btn-success {
background-image: -<API key>(#88c149, #73a839 60%, #699934);
background-image: -o-linear-gradient(#88c149, #73a839 60%, #699934);
background-image: linear-gradient(#88c149, #73a839 60%, #699934);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff88c149', endColorstr='#ff699934', GradientType=0);
filter: none;
border-bottom: 1px solid #59822c;
}
.btn-info {
background-image: -<API key>(#04519b, #033c73 60%, #02325f);
background-image: -o-linear-gradient(#04519b, #033c73 60%, #02325f);
background-image: linear-gradient(#04519b, #033c73 60%, #02325f);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff04519b', endColorstr='#ff02325f', GradientType=0);
filter: none;
border-bottom: 1px solid #022241;
}
.btn-warning {
background-image: -<API key>(#ff6707, #dd5600 60%, #c94e00);
background-image: -o-linear-gradient(#ff6707, #dd5600 60%, #c94e00);
background-image: linear-gradient(#ff6707, #dd5600 60%, #c94e00);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff6707', endColorstr='#ffc94e00', GradientType=0);
filter: none;
border-bottom: 1px solid #aa4200;
}
.btn-danger {
background-image: -<API key>(#e12b31, #c71c22 60%, #b5191f);
background-image: -o-linear-gradient(#e12b31, #c71c22 60%, #b5191f);
background-image: linear-gradient(#e12b31, #c71c22 60%, #b5191f);
background-repeat: no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe12b31', endColorstr='#ffb5191f', GradientType=0);
filter: none;
border-bottom: 1px solid #9a161a;
}
.panel-primary .panel-heading,
.panel-success .panel-heading,
.panel-warning .panel-heading,
.panel-danger .panel-heading,
.panel-info .panel-heading,
.panel-primary .panel-title,
.panel-success .panel-title,
.panel-warning .panel-title,
.panel-danger .panel-title,
.panel-info .panel-title {
color: #fff;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.