File: driver-spondoolies-sp10-p.c

package info (click to toggle)
cgminer 4.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,860 kB
  • sloc: ansic: 75,257; php: 2,792; java: 387; makefile: 278; python: 73; sh: 31; ruby: 23
file content (44 lines) | stat: -rw-r--r-- 1,384 bytes parent folder | download
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
/*
 * Copyright 2014-2015 Con Kolivas <kernel@kolivas.org>
 * Copyright 2014 Zvi (Zvisha) Shteingart - Spondoolies-tech.com
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 3 of the License, or (at your option)
 * any later version.  See COPYING for more details.
 *
 * Note that changing this SW will void your miners guaranty
 */

/*
	This file holds functions needed for minergate packet parsing/creation
	by Zvisha Shteingart
*/

#include "driver-spondoolies-sp10-p.h"
#include "assert.h"
//#include "spond_debug.h"

minergate_req_packet *allocate_minergate_packet_req(uint8_t requester_id, uint8_t request_id)
{
	minergate_req_packet *p  = cgmalloc(sizeof(minergate_req_packet));
	p->requester_id = requester_id;
	p->req_count = 0;
	p->protocol_version = MINERGATE_PROTOCOL_VERSION;
	p->request_id = request_id;
	p->magic = 0xcaf4;
	p->mask |= 0x01; // first packet
	return p;
}

minergate_rsp_packet *allocate_minergate_packet_rsp(uint8_t requester_id, uint8_t request_id)
{
	minergate_rsp_packet *p  = cgmalloc(sizeof(minergate_rsp_packet));
	p->requester_id = requester_id;
	p->rsp_count = 0;
	p->protocol_version = MINERGATE_PROTOCOL_VERSION;
	p->request_id = request_id;
	p->magic = 0xcaf4;
	p->gh_div_10_rate = 0;
	return p;
}