summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/pata_arasan_cf_data.h
blob: 9fade5dd2e869219b8ff193e4f9a0bbdd1aac83f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * include/linux/pata_arasan_cf_data.h
 *
 * Arasan Compact Flash host controller platform data header file
 *
 * Copyright (C) 2011 ST Microelectronics
 * Viresh Kumar <vireshk@kernel.org>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#ifndef _PATA_ARASAN_CF_DATA_H
#define _PATA_ARASAN_CF_DATA_H

#include <linux/platform_device.h>

struct arasan_cf_pdata {
	u8 cf_if_clk;
	#define CF_IF_CLK_100M			(0x0)
	#define CF_IF_CLK_75M			(0x1)
	#define CF_IF_CLK_66M			(0x2)
	#define CF_IF_CLK_50M			(0x3)
	#define CF_IF_CLK_40M			(0x4)
	#define CF_IF_CLK_33M			(0x5)
	#define CF_IF_CLK_25M			(0x6)
	#define CF_IF_CLK_125M			(0x7)
	#define CF_IF_CLK_150M			(0x8)
	#define CF_IF_CLK_166M			(0x9)
	#define CF_IF_CLK_200M			(0xA)
	/*
	 * Platform specific incapabilities of CF controller is handled via
	 * quirks
	 */
	u32 quirk;
	#define CF_BROKEN_PIO			(1)
	#define CF_BROKEN_MWDMA			(1 << 1)
	#define CF_BROKEN_UDMA			(1 << 2)
};

static inline void
set_arasan_cf_pdata(struct platform_device *pdev, struct arasan_cf_pdata *data)
{
	pdev->dev.platform_data = data;
}
#endif /* _PATA_ARASAN_CF_DATA_H */
an class="o">= 'heat-admin' self.node_info = {'servers': {}} def create_cli_parser(self, parser): parser.add_argument('--out-file', help="File where pod config will be written to. " "Defaults to ./node.yaml", default=constants.NODE_YAML_PATH, dest="out_file", required=False) return parser def run(self, sys_args, config): self.gen_node_info() shutil.mkdir_if_not_exist(os.path.dirname(sys_args.out_file)) utils_yaml.write_dict_to_yaml(self.node_info, sys_args.out_file) def gen_node_info(self): overcloud_ip_list = TripleoHelper.find_overcloud_ips() for node_ip in overcloud_ip_list: LOG.info('Introspecting node %s' % node_ip) node = Node('intro-%s' % node_ip, address=node_ip, user=self.overcloud_user) node_mac = None virsh_domain = None server_name, _ = node.execute('hostname') server_name = server_name.rstrip() if 'overcloud-controller' in server_name: node_type = 'controller' elif 'overcloud-novacompute' in server_name: node_type = 'compute' else: raise TripleOInspectorException('Unknown type ' '(controller/compute) %s ' % server_name) try: processutils.execute('ping -c 1 %s' % node_ip) res, _ = processutils.execute('/usr/sbin/arp -a ' '%s' % node_ip) node_mac = \ re.search('([0-9a-z]+:){5}[0-9a-z]+', res).group(0) virsh_domain = \ TripleoHelper.get_virtual_node_name_from_mac(node_mac) except AttributeError: LOG.warning("Unable to find MAC address for node {" "}".format(node_ip)) # find ovs controller and manager ovs_controller = self.get_ovs_controller(node) out, _ = node.execute('ovs-vsctl get-manager', as_root=True) ovs_managers = out.rstrip().split("\n") if all(ovs_manager == '' for ovs_manager in ovs_managers): LOG.warning("OVS managers for node {} is empty!".format( node_ip)) self.node_info['servers'][server_name] = { 'address': node_ip, 'user': self.overcloud_user, 'type': node_type, 'orig-ctl-mac': node_mac, 'vNode-name': virsh_domain, 'ovs-controller': ovs_controller, 'ovs-managers': ovs_managers} @staticmethod def copy_ssh_id_and_overcloudrc(dest): undercloud = TripleoHelper.get_undercloud() # copy overcloudrc undercloud.copy('from', dest, './overcloudrc') # copy ssh id undercloud.copy('from', dest, '.ssh/id_rsa') @staticmethod def get_ovs_controller(node): # find ovs controller and manager ovs_controller, _ = node.execute('ovs-vsctl get-controller ' 'br-int', as_root=True) ovs_controller = ovs_controller.rstrip() if ovs_controller == '': LOG.warning("OVS controller for node {} is empty!".format( node.address)) else: return ovs_controller class TripleOInspectorException(Exception): def __init__(self, value): self.value = value def __str__(self): return self.value def main(): TripleOIntrospector().start() if __name__ == '__main__': main()